-
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
WebFlux server metrics record http status 200 for CancelledServerWebExchangeException #29599
Comments
The HTTP status doesn't imply success or failure from an application nor a client perspective, it just points to the HTTP response status. If the status was not set when the connection was interrupted, then we can only imply the default: 200 OK. Note that the outcome tag is set to "UNKNOWN", which is really the case here: we don't know if the server took longer than the configured timeout on the client side, or if the client didn't need the response after all. This can happen a lot with scatter/gather use cases with WebClient. Here's the problem with setting HTTP 400 here:
As discussed in #18444 (comment), there is no strong agreement there on the metrics side of things, and "UNKNOWN" is the recommendation so far. As for the HTTP status itself, I don't think we should change its meaning - we should either take what was set or leave the default. |
In metrics / Grafana we normally use only "status", outcome is not used as "overlapping". outcome was added only in springboot2. In spingboot1 outcome was missing, at least from initial versions. |
I completely understand the problem with dashboards, unfortunately there is no way to solve that without breaking other apps or making tags up from unknown data. I'm closing this issue for now, feel free to comment it with new information. |
Hello, I described related problem in stackoverflow post: https://stackoverflow.com/questions/69913027/webflux-cancelledserverwebexchangeexception-appears-in-metrics-for-seemingly-no |
@bclozel could you have a look? |
Version: Spring Boot 2.6.3.RELEASE with Webflux & Metrics
Scenario
In both the above cases, metrics are generated. However they are stored with status = 200 implying success. Eg:
Please see earlier issue #23606 for reference source code.
The correct status code for this situation is clearly not well defined. However by making it 200, the result looks like success if we monitor fot HTTP Status code. Something from the 400 series would suit this better.
The text was updated successfully, but these errors were encountered: