File tree Expand file tree Collapse file tree
exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -574,10 +574,12 @@ private static String convertLegacyLabelName(String key) {
574574 throw new IllegalArgumentException ("label name is empty" );
575575 }
576576
577- // The OTel compatibility spec requires invalid attribute-name characters and repeated
578- // underscores to collapse to a single "_". Prometheus label names beginning with "__" are
579- // reserved for internal labels like "__name__" and scrape/relabel labels, and Prometheus Java
580- // rejects them as user labels, so do not preserve "__...__" reserved-looking names here.
577+ // OTel owns OTLP-to-Prometheus translation. Prometheus Java validates and serializes names,
578+ // but no longer owns this naming mangling. The OTel compatibility spec requires invalid
579+ // attribute-name characters and repeated underscores to collapse to a single "_". Prometheus
580+ // label names beginning with "__" are reserved for internal labels like "__name__" and
581+ // scrape/relabel labels, and Prometheus Java rejects them as user labels, so do not preserve
582+ // "__...__" reserved-looking names here.
581583 StringBuilder result = new StringBuilder (key .length ());
582584 boolean previousWasUnderscore = false ;
583585 for (int i = 0 ; i < key .length (); ) {
You can’t perform that action at this time.
0 commit comments