Opentelemetry-specification: Metrics API: instrument name and label name guidelines and limitations

Created on 13 Dec 2019  路  3Comments  路  Source: open-telemetry/opentelemetry-specification

Both Prometheus and Dogstatsd specify a set of valid characters for metric names and label names. The OTel specification should include more language in the specification about this sort of limitation.

Prometheus:

https://prometheus.io/docs/practices/naming/

Dogstatsd:

https://docs.datadoghq.com/developers/guide/what-best-practices-are-recommended-for-naming-metrics-and-tags/
https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=metrics
https://docs.datadoghq.com/tagging/

api needs discussion after-ga metrics

Most helpful comment

Some exporters also restrict labels. For example, Prometheus libraries will panic if you use the label "quantile". We should specify this sort of restriction somewhere.

All 3 comments

Some exporters also restrict labels. For example, Prometheus libraries will panic if you use the label "quantile". We should specify this sort of restriction somewhere.

This is partly addressed by #807 and #821. It will also be addressed in #504. The only remaining part, why I'm leaving this open, is to extend the guidelines to the naming of metric instruments. I believe the same logic for attribute and label naming applies, but more text will be needed.

This should have been resolved by #1578 which has defined the instrument names and also adopted Attributes.
The metrics backend might put more restriction on the attribute name, which could be the details of exporter (for example, key-value-pair fetched from baggage and context will also have such issues if the name won't fit the backend limitation).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrewhsu picture andrewhsu  路  3Comments

cijothomas picture cijothomas  路  3Comments

mateuszrzeszutek picture mateuszrzeszutek  路  4Comments

bogdandrutu picture bogdandrutu  路  4Comments

XSAM picture XSAM  路  3Comments