-
Notifications
You must be signed in to change notification settings - Fork 40.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using @Timed, recommend that care is taken to avoid double instrumentation #44037
Comments
Unfortunately, I don't think there's anything that Boot can do here as it doesn't have the necessary information to detect a double registration. To do so, it would have to:
1 is possible. 2 is harder as it relies both on a If you've opted into using |
Hi @wilkinsona, thanks for the detailed answer, that makes sense. I've used the predicate workaround to solve this issue, but it took me quite a while to find out what the actual problem was. Maybe the metrics chapter |
Yes, I think we could add something to https://docs.spring.io/spring-boot/3.3/reference/actuator/metrics.html#actuator.metrics.supported.timed-annotation. Thanks for the suggestion. |
FWIW, I think by adding Because of these, I think Boot should not do anything but making it easy to turn auto-instrumentation on/off (this is already happening). @wilkinsona For the doc change, could you please also consider |
Today, I've stumbled over this issue:
micrometer-metrics/micrometer#780
It seems that this happens not only when annotating controller methods with
@Timed
but also when annotating Spring Data repositories (and possibly other beans).Is there some way for Spring Boot to prevent this?
The text was updated successfully, but these errors were encountered: