-
Notifications
You must be signed in to change notification settings - Fork 304
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
Add charset to text/plain Content-Type #119
Conversation
expfmt/expfmt.go
Outdated
@@ -26,7 +26,7 @@ const ( | |||
|
|||
// The Content-Type values for the different wire protocols. | |||
FmtUnknown Format = `<unknown>` | |||
FmtText Format = `text/plain; version=` + TextVersion | |||
FmtText Format = `text/plain; charset=utf-8; version=` + TextVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We put it at the end usually: https://github.com/prometheus/client_python/blob/master/prometheus_client/exposition.py#L28
@brian-brazil I thought about that but couldn’t find definitive proof either way that was “legal” or not. I’ll change it to your suggestion momentarily. |
I believe it's valid both ways offhand, but may aswell keep things consistent in case someone is doing over-simplistic handling of the header. |
LGTM |
Thanks! |
Appears to be safe based on: prometheus/common#119 Signed-off-by: Tom DNetto <tom@tailscale.com> Updates: corp#17075
Appears to be safe based on: prometheus/common#119 Signed-off-by: Tom DNetto <tom@tailscale.com> Updates: corp#17075
This fixes encoding issues when viewing
/metrics
directly.See also prometheus/docs#557, prometheus/prometheus#1988