io.micrometer.core.annotation.Timed doesn't work

See original GitHub issue

quarkus version: 1.8.1

I’m using quarkus-smallrye-reactive-messaging-kafka and quarkus-resteasy-mutiny When I add that annotation to a resteasy endpoint nothing happens

@Timed(value = ".my.endpoint")

later when I open prometious metrics endpoint curl localhost:8080/metrics/ I don’t see my meters there. How can I time my endpoints?

Same happens when I try to time my kafka consumer. Nothing happens…

@Timed(value = ".my.consumer")
@Incoming("my-kafka-topic")

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ebullientcommented, Sep 29, 2020

Ok. PR attached – it hasn’t been reviewed, there will be force-pushes as I clean things up, but if you want to try something for experimentation purposes, here it is.

1reaction
ebullientcommented, Sep 28, 2020

Right. The micrometer org is a little mixed on their @Timed annotation… while present in core, support for it is optional. For Spring, e.g., supporting the @Timed annotation is optional (you have to add -aop because it is aspect based).

Any http endpoint is implicitly instrumented at the http level. I’m adding support for reactive messaging instrumentation now (which would also be automatic, and at a much lower level than the @Timed annotation would be).

So. I can add support for @Timed (via this issue) to the hopper. In the meanwhile, if you want to create a timer for some element of handling, inject the MeterRegistry, and use … any variant of Timer or LongTaskTimer methods to record how long certain steps take (probably along with results):

https://micrometer.io/docs/concepts#_timers https://micrometer.io/docs/concepts#_long_task_timers

Unless this is urgent, I want to work on the implicit instrumentation of reactive-messaging first. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Timed not working despite registering TimedAspect explicitly ...
I need to measure method-metrics using micrometer @Timed annotation. As it doesn't work on arbitrary methods; i added the configuration of ...
Read more >
[Java] What metrics does Micrometer @Timed expose in New ...
I am getting 5 metrics through this which are 'Avg, 'Count', 'Sum', 'Max' and 'Min'.
Read more >
Micrometer Application Monitoring
The micrometer-core modules contains a @Timed annotation that frameworks can use to add timing support to either specific types of methods such as...
Read more >
io.micrometer.core.annotation.Timed Java Examples
This page shows Java code examples of io.micrometer.core.annotation.Timed.
Read more >
@Timed Annotation Using Metrics and AspectJ | Baeldung
We need to ensure the AspectJ compilation plugin is included in the build for this to work. 4. Conclusion.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found