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

Fix Prometheus metrics MIME type and bump prometheus-client to 0.21.1 #1016

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

psrok1
Copy link
Member

@psrok1 psrok1 commented Jan 10, 2025

Your checklist for this pull request

  • I've read the contributing guideline.
  • I've tested my changes by building and running the project, and testing changed functionality (if applicable)
  • I've added automated tests for my change (if applicable, optional)
  • I've updated documentation to reflect my change (if applicable)

What is the current behaviour?

  • /api/varz offers Prometheus metrics but sends them with generic application/octet-stream Content Type.
  • Because of that, there are issues with compatibility with Prometheus v3 which is more strict concerning the Content-Type and doesn't automatically fallback to legacy protocol unless it's configured to do so (https://prometheus.io/docs/prometheus/latest/migration/).

What is the new behaviour?

  • Set correct Content-Type for the response (got from prometheus_client.CONTENT_TYPE_LATEST)
  • Bumped prometheus-client to latest. I initially thought that 0.20.0 updates the PrometheusText version to 1.0.0, but misread the changelog and the bump was for OpenMetricsText, so the format we're using stays on 0.0.4. Anyway, it's always a good opportunity to bump the version.

@psrok1 psrok1 merged commit 390bcce into master Jan 10, 2025
12 checks passed
@psrok1 psrok1 deleted the fix/metrics-mime-type branch January 10, 2025 16:32
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.

1 participant