Skip to content

Conversation

@LukoJy3D
Copy link

@LukoJy3D LukoJy3D commented Mar 3, 2025

Previously, when creating a custom metric endpoint, we did not bother with setting the header, just making sure that the metric format met the standard. From the migration guide, it was unclear what format the content-type header is accepted in, and it is only visible in the source code. It would have helped me if I had found it sooner.

Signed-off-by: Lukas Juozas Janušaitis <lukas.janusaitis@hostinger.com>
@LukoJy3D LukoJy3D force-pushed the docs/migration/clarify_on_content_type_headers branch from c9de656 to 870b470 Compare March 3, 2025 14:52
@machine424
Copy link
Member

Thanks for this.
I think that instead of just listing the accepted protocols, which might lead users to choose the wrong one, it would be better to ensure that https://prometheus.io/docs/instrumenting/exposition_formats/ is as explicit and informative about the other formats as it is for the Text-based one. We can then simply link to that page in the migration guide.

There is #15830 to track that change, if you're interested.

(By the way, specifying the media type is sufficient, the version and other parameters are not required)

@github-actions github-actions bot added the stale label May 4, 2025
@bboreham
Copy link
Member

Hello from the bug-scrub! @LukoJy3D would you like to make a PR for the https://prometheus.io/docs/instrumenting/exposition_formats/ page as suggested?

@github-actions github-actions bot removed the stale label Oct 29, 2025
@LukoJy3D
Copy link
Author

LukoJy3D commented Nov 4, 2025

Hello, yes, let me look into this 👀

@LukoJy3D
Copy link
Author

LukoJy3D commented Nov 7, 2025

Landed a PR, yet while writing it felt like most of the info is already covered in https://prometheus.io/docs/instrumenting/content_negotiation/, so from my POV, while doing an upgrade I was kind of only missing some reference either to this page or some examples (including media type and not only the protocols)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants