Repository navigation
Conversation
prometheus/common v0.73 can parse OpenMetrics 0.0.1 and 1.0.0, so a push with Content-Type application/openmetrics-text now goes through that parser instead of the classic text parser. Names are validated with the same scheme as the other formats, and unknown versions are rejected. Exemplars from these pushes are kept. They're exposed on protobuf scrapes, and on OpenMetrics scrapes when the new --web.enable-openmetrics flag is set. It's off by default because Prometheus prefers OpenMetrics when it's offered, which would change the scrape format for existing setups. Fixes prometheus#400 Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #400
prometheus/common v0.73 has an OpenMetrics 1.0 parser now (prometheus/common#1015), which was the blocker beorn7 pointed out on the issue. So this bumps common to v0.73.1 and sends pushes with
Content-Type: application/openmetrics-textthroughexpfmt.NewDecoder. Versions 0.0.1 and 1.0.0 work, anything else gets a 400. Names are validated with the same scheme as the other formats, so--push.enable-utf8-namesbehaves the same way.The main thing people wanted was exemplars. They're kept on the pushed metrics and show up on protobuf scrapes. I also added
--web.enable-openmetricsso they can show up on OpenMetrics scrapes. It's off by default because Prometheus prefers OpenMetrics when a target offers it, and I didn't want existing setups to quietly switch scrape formats.Notes
Tests cover the three content type variants, a body without
# EOFand an unknown version. I haven't run them locally, CI will. The common bump also pulls a few x/ deps, same as what dependabot has queued in #886.