grafana / pyroscope

Continuous Profiling Platform. Debug performance issues down to a single line of code
https://grafana.com/oss/pyroscope/
GNU Affero General Public License v3.0
9.98k stars 598 forks source link

chore: support dots in label names #3335

Closed kolesnikovae closed 4 months ago

kolesnikovae commented 4 months ago

We're currently using prometheus data model for labels (including those that are set as pprof tags) for consistency with other products:

Labels may contain ASCII letters, numbers, as well as underscores. They must match the regex [a-zA-Z][a-zA-Z0-9]*.

Although we can not easily loosen the requirement, I'm not very sure if discarding profiles that violate it is the best strategy.

There is ongoing work on support for UTF-8 labels in Prometheus: https://github.com/prometheus/prometheus/issues/13095:

OTel allows UTF-8 in label names while Prometheus has a much more restrictive set. This is causing friction for users when using Prometheus. In particular, . (dot) is a very common character in OTel and we convert that to _ when converting to Prometheus. For example, service.version becomes service_version.

Until the support is fully implemented, I propose to do the same in Pyroscope – convert . to _ in label names to make interoperability easier. Theoretically, we could replace any disallowed characters, but that leads to ambiguity in certain cases and may confuse users.