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

PrometheusScrapeEndpoint prefers OpenMetrics and ignores client preference #28934

Closed
jonatan-ivanov opened this issue Dec 9, 2021 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@jonatan-ivanov
Copy link
Member

This issue is closely connected to #28130
I think all of the versions that has the fix above (I tested 2.5.6 but 2.6.1 and latest snapshots should behave the same way) prefers OpenMetrics even if the client has a different preference, Examples:

  • Accept: text/plain;version=0.0.4;q=0.3,*/*;q=0.1 -> OpenMetrics
  • Accept: text/plain;version=0.0.4 -> PlainText

This is not incorrect since the first one also accepts */* so it should not complain even if the response is a zip file but it is somewhat unexpected since text/plain is also supported and preferred by the client.

A real life example is Telegraf's Prometheus plugin that does not support OpenMetrics but it accepts */* (incorrectly):

application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited;q=0.7,text/plain;version=0.0.4;q=0.3,*/*;q=0.1

Please notice that text/plain is preferred over */*.
Because of the above behavior, it will get a response in the OpenMetrics format from Boot and fails because it is not able to process it, see: influxdata/telegraf#10248

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 9, 2021
@wilkinsona
Copy link
Member

Duplicates #28446.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants