-
Notifications
You must be signed in to change notification settings - Fork 888
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
Fix OpenMetrics valid label keys, and specify prometheus conversion for metric name. #2788
Conversation
03335f1
to
3502920
Compare
cc @open-telemetry/wg-prometheus |
@dashpole related question, maybe not answered in this PR: |
For Prometheus/OpenMetrics, empty label keys aren't allowed. We should drop + warn for an empty label. For exporters written using prometheus client libraries, that is already done by the client's validation (e.g. prometheus/client_golang). It might be good to include a catchall statement somewhere to the effect of: "exporters should produce valid prometheus/openmetrics metrics, or MUST drop the metric and emit a warning". |
…or metric name. (open-telemetry#2788) * fix OpenMetrics valid label keys, and specify prometheus conversion for metric name. * deduplicate underscores and fix formatting Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Changes
This fixes an incorrect statement about the allowed characters in prometheus label keys found here: open-telemetry/opentelemetry-go#3135 (comment).
During the process, I also realized we don't specify conversion rules for the metric name, including the rules for sanitizing the metric name when converting from OTLP to Prom.
Source: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#abnf
In that spec,
metricname-initial-char
allows:
, butlabel-name-initial-char
does not.