Skip to content

Commit 0696969

Browse files
authored
Merge pull request #2555 from prometheus/krajo/update-otel-prom-pr-15448
feat(docs/otel): describe keep_identifying_resource_attributes option
2 parents 21a41ed + 6c87833 commit 0696969

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

content/docs/guides/opentelemetry.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,15 @@ So, what is the relation between the `target_info` metric and OTel resource attr
130130
When Prometheus processes an OTLP write request, and provided that contained resources include the attributes `service.instance.id` and/or `service.name`, Prometheus generates the info metric `target_info` for every (OTel) resource.
131131
It adds to each such `target_info` series the label `instance` with the value of the `service.instance.id` resource attribute, and the label `job` with the value of the `service.name` resource attribute.
132132
If the resource attribute `service.namespace` exists, it's prefixed to the `job` label value (i.e., `<service.namespace>/<service.name>`).
133-
The rest of the resource attributes are also added as labels to the `target_info` series, names converted to Prometheus format (e.g. dots converted to underscores).
133+
134+
By default `service.name`, `service.namespace` and `service.instance.id` themselves are not added to `target_info`, because they are converted into `job` and `instance`. However the following configuration parameter can be enabled to add them to `target_info` directly (going through normalization to replace dots with underscores, if `otlp.translation_strategy` is `UnderscoreEscapingWithSuffixes`) on top of the conversion into `job` and `instance`.
135+
136+
```
137+
otlp:
138+
keep_identifying_resource_attributes: true
139+
```
140+
141+
The rest of the resource attributes are also added as labels to the `target_info` series, names converted to Prometheus format (e.g. dots converted to underscores) if `otlp.translation_strategy` is `UnderscoreEscapingWithSuffixes`.
134142
If a resource lacks both `service.instance.id` and `service.name` attributes, no corresponding `target_info` series is generated.
135143
136144
For each of a resource's OTel metrics, Prometheus converts it to a corresponding Prometheus time series, and (if `target_info` is generated) adds the right `instance` and `job` labels.

0 commit comments

Comments
 (0)