title: Use dropwizards annotation with Spring Boot
body: <p>Instead of measuring by inserting code into each method of interest I intended to use the provided <code>@Timed</code> annotation. But the metrics do not show any corresponding values:</p>
  
  <p><a href="https://i.stack.imgur.com/trJo1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/trJo1.png" alt="Metrics"></a></p>
  
  <p>This is my code, the idea is having the execution times of the contained SQL being put into the metrics.</p>
  
  <pre><code>@Component
  public class Foo {
      private JdbcTemplate jdbcTemplate;
  
      @Autowired
      public Metadata(JdbcTemplate jdbcTemplate) {
          this.jdbcTemplate = jdbcTemplate;
      }
  
      @Timed(name = "myapp.get.foo")
      public boolean getFoo(final String foo ) {
          String foo = jdbcTemplate.query( ...
      }
  }
  </code></pre>
  
  <p>The problem with <code>@Timed</code> not showing up is probably because <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-metrics.html#production-ready-recording-metrics" rel="nofollow noreferrer">Spring Boot only supports Counter and Gauge</a>.</p>
  
  <p>But <code>@Gauge</code>, <code>@Metered</code> and <code>@Counted</code> don't work either.</p>
  
  <p>What am I missing in order to make at least those metrics annotation work that are supported by Spring Boot ? (1.3.1 in my tests)</p>