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 metrics content-type #1361

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ilrudie
Copy link
Contributor

@ilrudie ilrudie commented Nov 8, 2024

mostly serve metrics with text/plain unless given an openmetrics Accept header

fixes #1356

@ilrudie ilrudie requested a review from a team as a code owner November 8, 2024 21:09
@istio-policy-bot
Copy link

😊 Welcome @ilrudie! This is either your first contribution to the Istio ztunnel repo, or it's been
a while since you've been here.

You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@istio-testing istio-testing added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 8, 2024
.to_lowercase()
.split(";")
.collect::<Vec<_>>()
.first()
Copy link
Member

Choose a reason for hiding this comment

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

Do we know that prometheus will always scrape with openmetrics as the first 'accept'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, that is likely not a safe invariant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finally got back around to this. Got it reworked to support multiple Accept headers and added testing.

@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

metrics endpoint sends content-type: application/openmetrics-text
4 participants