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

Adjust Content-Type header for Prometheus endpoint to include version #15072

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

Woutifier
Copy link
Contributor

Prometheus v3 will, by default, be more strict about the content-types returned from scrape endpoints. With the current value (just text/plain), it would fail to scrape.

In this commit the value is changed from text/plain to text/plain; version=0.0.4.

See also [1] and [2]
[1] https://prometheus.io/docs/instrumenting/exposition_formats/ [2] https://prometheus.io/docs/prometheus/3.0/migration/

Short description

This closes #15071

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

Prometheus v3 will, by default, be more strict about the content-types
returned from scrape endpoints. With the current value (just
`text/plain`), it would fail to scrape.

In this commit the value is changed from `text/plain` to `text/plain;
version=0.0.4`.

See also [1] and [2]
[1] https://prometheus.io/docs/instrumenting/exposition_formats/
[2] https://prometheus.io/docs/prometheus/3.0/migration/
Copy link
Contributor

@miodvallat miodvallat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good; version=0.0.4

@zeha
Copy link
Collaborator

zeha commented Jan 21, 2025

Can we clarify this first please? #15071 (comment)

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12889200336

Details

  • 2 of 3 (66.67%) changed or added relevant lines in 3 files are covered.
  • 46 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.01%) to 64.709%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pdns/ws-auth.cc 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
pdns/packethandler.cc 1 72.79%
modules/gpgsqlbackend/gpgsqlbackend.cc 1 88.62%
pdns/misc.cc 2 62.49%
pdns/backends/gsql/gsqlbackend.hh 2 97.71%
pdns/iputils.cc 3 56.07%
pdns/recursordist/recpacketcache.hh 3 89.55%
pdns/rcpgenerator.cc 3 90.37%
pdns/recursordist/test-syncres_cc1.cc 5 89.87%
pdns/signingpipe.cc 5 83.38%
pdns/dnsdistdist/dnsdist-carbon.cc 9 61.87%
Totals Coverage Status
Change from base Build 12884379895: 0.01%
Covered Lines: 127804
Relevant Lines: 166433

💛 - Coveralls

@rgacogne rgacogne added this to the common-soon milestone Jan 21, 2025
@rgacogne rgacogne merged commit 9a9bed3 into PowerDNS:master Jan 23, 2025
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return proper Content-Type on all Prometheus endpoints
6 participants