prometheus / client_java

Prometheus instrumentation library for JVM applications
http://prometheus.github.io/client_java/
Apache License 2.0
2.17k stars 796 forks source link

irregular syntax in content type #865

Open TomTriple opened 1 year ago

TomTriple commented 1 year ago

In https://github.com/prometheus/client_java/blob/a76a65ddb62b50eb2c33a46e98cde4f4479a54a6/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java#L25 you specified parameter version=1.0.0 which is not valid syntax according to https://www.w3.org/Protocols/rfc1341/4_Content-Type.html (it is not allowed to use . in an unquoted parameter value).

Please see also discussion here https://github.com/zio/zio-http/issues/2416#issuecomment-1727959470.

Valid syntax in this case should be version="1.0.0".

fstab commented 1 year ago

Thanks a lot! This is interesting: The content type String is literally copied out of the OpenMetrics spec:

The content type MUST be: application/openmetrics-text; version=1.0.0; charset=utf-8

Could you open an issue in the https://github.com/OpenObservability/OpenMetrics repo? I'm curious what they think.