Skip to content
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

Change content type for openmetrics expositions to prometheus text format #1098

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alopezz
Copy link

@alopezz alopezz commented Oct 18, 2023

The format produced by this implementation is actually not adhering to the OpenMetrics standard, which causes problems for scrapers that rely on the content-type for deciding how to parse the metrics exposition. The official Prometheus Python client's parser will raise errors when trying to parse metrics coming out of this implementation. For example, NaN values are not allowed in histograms and summaries, and counters must include a _total suffix for the actual sample value.

The Prometheus text exposition format is much less strict and is therefore a better match for the way the current implementation exposes metrics. Thus, this PR suggests modifying the content type to match the one recommended for that format.

…rmat

The implementation is actually far from adhering to the OpenMetrics
standard, which causes problems for scrapers that rely on the
content-type for deciding how to parse the metrics exposition.
@electrum electrum requested a review from mattstep March 6, 2024 18:27
@mattstep
Copy link
Member

mattstep commented Mar 7, 2024

It would be better to fix the bugs you're pointing out rather than change the content type. Can you go into more detail or potentially look into fixing those issues in this PR instead? Ideally we'd support the full openmetrics standard. I think NaN values is something we've seen as well internally at Starburst.

@alopezz
Copy link
Author

alopezz commented Mar 8, 2024

I'm afraid I most definitely don't have the bandwidth to work on making the exposition OpenMetrics-compliant, but I'm also not sure there's a clear benefit to doing so; the Prometheus exposition format is still more widespread and widely supported than OpenMetrics.

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.

None yet

2 participants