title: Export Spring Boot Actuator Metrics using Dropwizard to Jmx or Graphite
body: <p>I want to use Spring Boot <code>MetricsWriter</code> to write/export data from my Spring Boot application to a data source of my choice (say - Jmx/Graphite). I can use <code>JmxReporter</code>/<code>GraphiteReporter</code>, but I guess Spring's abstraction of <code>Writer</code>/<code>Exporter</code> can play a vital role in terms of data source changes later.</p>
  
  <p>My REST endpoint is annotated with Dropwizard annotations</p>
  
  <pre><code>@Timed(absolute=true, name="invokeEndpoint")
  public ResponseEntity&lt;Object&gt; callSomeApi() {
     ...
  }
  </code></pre>
  
  <p>My configuration class looks like this:</p>
  
  <pre><code>@Configuration
  public class SpringBootMetrics {
  
      @Bean
      @ExportMetricReader
      public MetricReader metricReader() {
          return new MetricRegistryMetricReader(metricRegistry());
      }   
  
      public MetricRegistry metricRegistry() {
          final MetricRegistry metricRegistry = new MetricRegistry();
          return metricRegistry;
      }
  
      @Bean
      @ExportMetricWriter
      MetricWriter metricWriter(MBeanExporter exporter) {
          return new JmxMetricWriter(exporter);
      }
  }
  </code></pre>
  
  <p>I don't see any metrics for endpoint invocation to be collected in Jmx through my jconsole. What am I missing?</p>