Closed space88man closed 2 months ago
Hey, thanks for the report. If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.
Update: the name had been used in a different method with a different set of tags; I see that the Prometheus registry doesn't allow this. Sorry for the noise.
No harm done, thanks for chiming back in.
I am annotating a public method (non-controller) with
@Timed
and I can see that it is created inPrometheusMeterRegistry
and appears in/actuator/metrics
— after being called at least once.Setting a breakpoint at
PrometheusMeterRegistry::newTimer
does show that the metric is being created in a hugeTimedAspect
call stack. I havemanagement.observations.annotations.enabled=true
set.However the endpoint
/actuator/prometheus
depends on aPrometheusRegistry
field (andPrometheusMeterRegistry
shares the same object as a fieldregistry
). However this field doen't seem to get updated duringnewTimer
so/actuator/prometheus
doesn't change.When scraping
/actuator/prometheus
the new Timer does not appear.OTOH in JMX, I do see the new Timer created with a very long name (it includes the class, exception, and extraTags).