jfcorugedo
jfcorugedo

Reputation: 10051

Using @Timed in service method

I'm working with Spring Boot, and I want to annotate some of my @Service methods with @Timed so I could view their statistics calling the metrics endpoint.

I've read from the Spring documentation that is can use dropwizard registry, but I can't find any example in which it uses dropwizar annotations.

How can I configure my Spring Boot app so each method annotated with @Timed automatically publishes its statistics using the build-in Spring actuator module?

Upvotes: 11

Views: 22489

Answers (1)

Shawn Clark
Shawn Clark

Reputation: 3440

Have you had a look at: http://www.ryantenney.com/metrics-spring/

Seems that you need to include that library if you want to use Spring with Metrics 3.0 / 3.1.

Upvotes: 1

Related Questions