Skip to content

Prometheus actuator endpoint should produce a text/plain response unless application/openmetrics-text is explicitly accepted #28446

@ThomasKasene

Description

@ThomasKasene

After upgrading from 2.5.5 to 2.5.6 I noticed my browser started downloading a file rather than displaying the Prometheus metrics in the tab. This makes it a little tedious to work with.

Anyway, the Accept header my browser is sending is:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9

... and the responses from 2.5.5 and 2.5.6 are:

2.5.5: Content-Type: text/plain;version=0.0.4;charset=utf-8
2.5.6: Content-Type: application/openmetrics-text;version=1.0.0;charset=utf-8

I made a minimal example on Github - just change the version of the Spring Boot parent in pom.xml to reproduce:
https://github.com/ThomasKasene/example-spring-boot-prometheus

My hunch says this might be related to the discussions over at #28130 or #28137, but I'm not completely sure.

EDIT:
I should point out that I don't actually know whether this is considered a bug, or if it's "working as intended", and that the browser is the one at fault.

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions