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
In v2.3.0, Prometheus endpoint returns HTTP 500 in response to "Accept: application/json" #21591
Comments
Thanks for the report, @mario-philipps-icw. Unfortunately, I cannot reproduce the behaviour you have described. I receive a 406 response from an app:
This was using @WebEndpointTest
void whenAcceptedContentTypeCannotBeProducedScrapeFailsWithNotAcceptable(WebTestClient client) {
client.get().uri("/actuator/prometheus").accept(MediaType.APPLICATION_JSON).exchange().expectStatus()
.isEqualTo(HttpStatus.NOT_ACCEPTABLE);
} This was added to If you would like us to spend some more time investigating, please spend some time creating a minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or zipping it up and attaching it to this issue. |
Further research revealed that the problem occurs when a separate management port is configured via Minimal (Kotlin) example application is attached, including a failing unit test. |
Thanks very much, @mario-philipps-icw. The use of a separate management port was the missing piece. I can reproduce the problem now. |
I've confirmed that this is another side-effect of the initial fix for #21036, with the same problem noted there: #21036 (comment). Marking this issue as a duplicate of the forward-merge issue #21875 for |
After upgrading to Spring Boot 2.3.0, I found that the Prometheus actuator endpoint returns an HTTP 500 response, if an
Accept: application/json
header is passed in the request. Actually, it seems that it happens with any JSON MIME type, e.g.application/vnd.something+json
, but not with other MIME types, such asapplication/xml
.With Spring Boot 2.2.5, the response was HTTP 406, which is what I'd expect.
The text was updated successfully, but these errors were encountered: