-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Controller level exceptions not getting populated in HTTP server requests metrics #33731
Comments
Thanks for the report. Unfortunately, your short description of the problem leaves too many unknowns for us to be able to diagnose it efficiently. If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue. |
We introduced this attribute in #24028, since we decided to remove this behavior by default in #23795. I think this is an oversight and that we should have:
Should we consider this a bug then and apply those changes in the next maintenance version? |
Thanks for filling in some blanks for me, @bclozel. @bunty-raghani there's no need for a sample now.
Yes, I think we should. |
Thank you @bclozel & @wilkinsona for considering this issue and for providing the required help. I tried the new code snippet and it is working fine. Also, apologies for not attaching the sample code to reproduce this issue. Thank you once again for all your help! Regards, |
Kindly ignore the closed and reopened message, it happened by mistake. Spring team will fix this in future versions as mentioned above. |
Exceptions handled at the controller level are not populated in the http.server.requests metrics.
As per the official docs, we need to set the request attribute in @ExceptionHandler method before returning a response. I tried this approach but exceptions are not included in "availableTags -> exception array".
Observed this issue only for exceptions that are handled at the controller level. For other exceptions, that are internally handled by the spring framework, such exceptions are visible in metrics.
Endpoint: /actuator/metrics/http.server.requests
Spring Boot Version: 3.0.1 (also, tried 3.0.2-SNAPSHOT)
The text was updated successfully, but these errors were encountered: