-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Spring Boot (version 3.1.2) has UNKNOWN status in prometheus metrics #31028
Comments
Hello! I can't reproduce this:
Maybe it has something to do with dropped requests? Do you have a sample application where this happens all the time? |
Thank you for response! Yes, I runnig spring boot app: Reproducer: untitled.zip And then I get this result: # HELP http_server_requests_seconds
# TYPE http_server_requests_seconds summary
http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/actuator/prometheus",} 996.0
http_server_requests_seconds_sum{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/actuator/prometheus",} 143.624052605
http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="UNKNOWN",status="UNKNOWN",uri="/actuator/prometheus",} 5.0
http_server_requests_seconds_sum{error="none",exception="none",method="GET",outcome="UNKNOWN",status="UNKNOWN",uri="/actuator/prometheus",} 0.855936009 Nobody dropped this requests. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Those are the "successful" requests:
Those are the "unsuccessful" ones:
So something is different with these requests. Let's see if we can find this when we get the sample. |
Nope, sorry, I can't reproduce this:
|
And if you increase the number of requests from 1000 to 10000? int numRequests = 1000; |
After running it multiple times with 10000 requests, I now got it:
|
There's some overlap between this issue and spring-projects/spring-boot#33300. However, the concerns about the benchmarking tool closing connections prematurely (from the server's perspective) doesn't apply here unless the HTTP client is doing something similar. |
It looks like the culprit is if (context.isConnectionAborted()) {
return HTTP_OUTCOME_UNKNOWN;
} Not sure if this can be triggered in any other case. When setting a breakpoint in |
Maybe it's a duplicate of #29720 |
mhalbritter This problem was not in version 2.2.13.RELEASE, but it appeared in version 3.1.2. |
We are seeing the same issue in production. When hitting the API through Postman, I can see 200 response code, but the same is captured as UNKNOWN in |
Closing because of #29720 (comment) |
Hi all. When I switched to spring boot from version 2.2.13.RELEASE to version 3.1.2, there was a problem with the metrics.
application.yml:
Namely, in some metrics, the UNKNOWN status appeared. Although in fact all requests were successful and should have a status of 200:
This can be easily reproduced by sending 1000 parallel requests to the /actuator/prometheus endpoint:
What could be causing this problem and how to fix it? Thank you!
The text was updated successfully, but these errors were encountered: