diff --git a/examples/kitchen-sink.yaml b/examples/kitchen-sink.yaml index 3bb08f20..29711a40 100644 --- a/examples/kitchen-sink.yaml +++ b/examples/kitchen-sink.yaml @@ -202,9 +202,11 @@ meter_provider: port: 9464 # Configure Prometheus Exporter to produce metrics without a unit suffix or UNIT metadata. # If omitted or null, false is used. + # Deprecated: Use .translation_strategy instead. When both are set, .translation_strategy takes precedence. without_units: false # Configure Prometheus Exporter to produce metrics without a type suffix. # If omitted or null, false is used. + # Deprecated: Use .translation_strategy instead. When both are set, .translation_strategy takes precedence. without_type_suffix: false # Configure Prometheus Exporter to produce metrics without a scope info metric. # If omitted or null, false is used. @@ -225,6 +227,15 @@ meter_provider: # If omitted, .included resource attributes are included. excluded: - "service.attr1" + # Configure how Prometheus metrics are exposed. Values include: + # + # * UnderscoreEscapingWithSuffixes, the default. This fully escapes metric names for classic Prometheus metric name compatibility, and includes appending type and unit suffixes. + # * UnderscoreEscapingWithoutSuffixes, metric names will continue to escape special characters to _, but suffixes won't be attached. + # * NoUTF8EscapingWithSuffixes will disable changing special characters to _. Special suffixes like units and _total for counters will be attached. + # * NoTranslation. This strategy bypasses all metric and label name translation, passing them through unaltered. + # + # If omitted or null, UnderscoreEscapingWithSuffixes is used. + translation_strategy: UnderscoreEscapingWithSuffixes # Configure metric producers. producers: - # Configure metric producer to be opencensus. diff --git a/schema/meter_provider.json b/schema/meter_provider.json index bc1e9210..82848187 100644 --- a/schema/meter_provider.json +++ b/schema/meter_provider.json @@ -206,6 +206,15 @@ }, "with_resource_constant_labels": { "$ref": "common.json#/$defs/IncludeExclude" + }, + "translation_strategy": { + "type": ["string", "null"], + "enum": [ + "UnderscoreEscapingWithSuffixes", + "UnderscoreEscapingWithoutSuffixes", + "NoUTF8EscapingWithSuffixes", + "NoTranslation" + ] } } }, diff --git a/schema/type_descriptions.yaml b/schema/type_descriptions.yaml index b19e8edd..7e545ec9 100644 --- a/schema/type_descriptions.yaml +++ b/schema/type_descriptions.yaml @@ -597,15 +597,28 @@ Configure Prometheus Exporter to produce metrics without a unit suffix or UNIT metadata. If omitted or null, false is used. + + Deprecated: Use .translation_strategy instead. When both are set, .translation_strategy takes precedence. without_type_suffix: > Configure Prometheus Exporter to produce metrics without a type suffix. If omitted or null, false is used. + + Deprecated: Use .translation_strategy instead. When both are set, .translation_strategy takes precedence. without_scope_info: > Configure Prometheus Exporter to produce metrics without a scope info metric. If omitted or null, false is used. with_resource_constant_labels: Configure Prometheus Exporter to add resource attributes as metrics attributes. + translation_strategy: > + Configure how Prometheus metrics are exposed. Values include: + + * UnderscoreEscapingWithSuffixes, the default. This fully escapes metric names for classic Prometheus metric name compatibility, and includes appending type and unit suffixes. + * UnderscoreEscapingWithoutSuffixes, metric names will continue to escape special characters to _, but suffixes won't be attached. + * NoUTF8EscapingWithSuffixes will disable changing special characters to _. Special suffixes like units and _total for counters will be attached. + * NoTranslation. This strategy bypasses all metric and label name translation, passing them through unaltered. + + If omitted or null, UnderscoreEscapingWithSuffixes is used. path_patterns: - .meter_provider.readers[].pull.exporter.prometheus/development - type: PrometheusIncludeExclude