Micrometer: Blow up or warn when @Timed has no name on @Scheduled

Created on 26 May 2017  路  3Comments  路  Source: micrometer-metrics/micrometer

Most helpful comment

Right now, it's just used to instrument @Scheduled, and @RequestMapping (and the @GetMapping type variations). So it would do nothing.

Presumably we could add a pointcut to do something similar for an arbitrary method. For scheduled and request mappings, I'm trying to get the necessary changes in to spring framework 5.+ so that you don't need AOP at all.

All 3 comments

How does@Timed behave on non-@Scheduled methods? (IE if SomeBean.doWork() were annotated)

Right now, it's just used to instrument @Scheduled, and @RequestMapping (and the @GetMapping type variations). So it would do nothing.

Presumably we could add a pointcut to do something similar for an arbitrary method. For scheduled and request mappings, I'm trying to get the necessary changes in to spring framework 5.+ so that you don't need AOP at all.

It would be good to mention it in the documentation. I had spent some time before I found that issue trying to explain why my @Timed-annotated method with a non @RestTemplate remote server call doesn't generate any metrics...

Was this page helpful?
0 / 5 - 0 ratings