Allow metric instrument names to contain `:` characters
How about
:? Prometheus also allows colons if that is a concern.
Originally posted by @kes2464 in #3422
What are you trying to achieve?
Prometheus already supports instrument names containing :, and our production codes also contain : in many instruments.
Additional context.
https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
https://github.com/open-telemetry/opentelemetry-specification/issues/4371#issuecomment-2651367885
OTel is now more restrictive than Prometheus, so would be good to relax some of the restrictions.
It would be interesting to know what @open-telemetry/prometheus-interoperability thinks about this
My understanding of https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/metrics/api.md#instrument-name-syntax is that it is a restriction on the OTel SDK (despite being in the API document), since APIs accept strings, and validation is done in the SDK. From a protocol perspective, OTLP supports UTF-8, since strings in proto are utf8. So this is only a potential issue migrating to the OTel SDK from a Prometheus client library, and doesn't impact any of the collector components.
From https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
NOTE: Colons (':') are reserved for user-defined recording rules. They SHOULD NOT be used by exporters or direct instrumentation.
So Prometheus instrumentation SHOULD NOT have colons in it. Prometheus also now supports UTF-8. We could choose to similarly remove all naming restrictions if we wanted to prioritize compatibility, and ensure that any Prometheus instrumentation could always migrate to OpenTelemetry. But it doesn't seem to me like colons are more important than any other restricted character. If anything, instrumentation with colons might be be more confusing for the Prometheus ecosystem, given their designated use for recording rules.