-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[exporter/prometheus] Content-Type header for Prometheus 3.0.0 #36655
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
👍 I think it's always valid to add the header. Even if the backend is a Prometheus < 3.0, adding it has no downsides. |
/label -needs-triage help-wanted |
According to the client_golang used to handle the prometheus scraping, it negotiates the content type and sets the header properly: May I ask what else needs to be done here? |
@ArthurSens do we just need to wait for the client_golang dependency to be bumped? |
That was my understanding when I opened the ticket. |
I'm not sure actually, looking at git blame I can see that code is there for a long time already: And the PR that moved the line adding content type header just moved that line from one place to another: Without looking deeper into the code I can't tell what needs to be done, but it doesn't seem to be a client_golang bump that would fix this |
The current client_golang version used in the exporter is 1.20.5 which is the latest release https://github.com/prometheus/client_golang/releases/tag/v1.20.5:
CMIIW but we don't need to do any extra work to support the content-type header. |
Component(s)
exporter/prometheus
Is your feature request related to a problem? Please describe.
Prometheus 3.0.0 has the option (by default) to be far more strict about what content it scrapes. This can cause unexpected scrape failures for the prometheus exporter.
Describe the solution you'd like
Set the header "to the correct value". It should probably be aware if "
enable_open_metrics
" is set.Describe alternatives you've considered
If a scrape target is not providing the correct Content-Type header the fallback protocol can be specified using the fallback_scrape_protocol parameter.
Additional context
From : https://prometheus.io/docs/prometheus/3.0/migration/
The text was updated successfully, but these errors were encountered: