You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/guides/opentelemetry.md
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ By default, the OTLP receiver is disabled, similarly to the Remote Write receive
12
12
This is because Prometheus can work without any authentication, so it would not be
13
13
safe to accept incoming traffic unless explicitly configured.
14
14
15
-
To enable the receiver you need to toggle the CLI flag `--web.enable-otlp-receiver`.
16
-
This will cause Prometheus to serve OTLP metrics receiving on HTTP `/api/v1/otlp/v1/metrics` path.
15
+
To enable the receiver you need to toggle the CLI flag `--web.enable-otlp-receiver`.
16
+
This will cause Prometheus to serve OTLP metrics receiving on HTTP `/api/v1/otlp/v1/metrics` path.
17
17
18
18
```shell
19
19
$ prometheus --web.enable-otlp-receiver
@@ -147,16 +147,19 @@ For each of a resource's OTel metrics, Prometheus converts it to a corresponding
147
147
148
148
## UTF-8
149
149
150
-
From the 3.x version, Prometheus supports UTF-8 for metric names and labels, so [Prometheus normalization translator package from OpenTelemetry](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/translator/prometheus) can be omitted.
150
+
From the 3.x version, Prometheus supports UTF-8 for metric names and labels, so [Prometheus normalization translator package from OpenTelemetry](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/translator/prometheus) can be omitted. Note that when Prometheus announces through content negotiation that it allows UTF-8 characters, this does not require that metric names contain previously-unsupported characters. The OTLP metrics may be converted in several different ways, depending on the configuration of the endpoint. So while UTF-8 is enabled by default in Prometheus storage and UI, you need to set the `translation_strategy` for OTLP metrics receiver, which by default is set to old normalization `UnderscoreEscapingWithSuffixes`.
151
151
152
-
UTF-8 is enabled by default in Prometheus storage and UI, but you need to `translation_strategy` for OTLP metric receiver, which by default is set to old normalization `UnderscoreEscapingWithSuffixes`.
152
+
There are four possible translation strategies, two of which require UTF-8 support to be enabled in Prometheus:
153
153
154
-
Setting it to `NoUTF8EscapingWithSuffixes`, which we recommend, will disable changing special characters to `_` which allows native use of OpenTelemetry metric format, especially with [the semantic conventions](https://opentelemetry.io/docs/specs/semconv/general/metrics/). Note that special suffixes like units and `_total` for counters will be attached. There is [ongoing work to have no suffix generation](https://github.com/prometheus/proposals/pull/39), stay tuned for that.
154
+
* `UnderscoreEscapingWithSuffixes`, the default. This fully escapes metric names for classic Prometheus metric name compatibility, and includes appending type and unit suffixes.
155
+
* `NoUTF8EscapingWithSuffixes` will disable changing special characters to `_` which allows native use of OpenTelemetry metric format, especially with [the semantic conventions](https://opentelemetry.io/docs/specs/semconv/general/metrics/). Note that special suffixes like units and `_total` for counters will be attached to prevent possible collisions with multiple metrics of the same name having different type or units. This mode requires UTF-8 to be enabled.
156
+
* Coming soon: `UnderscoreEscapingWithoutSuffixes`, which will change special characters to `_` but not append suffixes. This mode will not be available until [Type and Unit metadata](https://github.com/prometheus/proposals/blob/main/proposals/2024-09-25_metadata-labels.md) is supported in Prometheus.
157
+
* `NoTranslation`. This strategy bypasses all metric and label name translation, passing them through unaltered. This mode requires UTF-8 to be enabled.
155
158
156
159
```
157
160
otlp:
158
161
# Ingest OTLP data keeping UTF-8 characters in metric/label names.
0 commit comments