Skip to content

Commit 9e02fa1

Browse files
authored
OpenTelemetry guide: document the info function's churn handling (#2776)
Signed-off-by: Arve Knudsen <[email protected]>
1 parent 98ccc3a commit 9e02fa1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/guides/opentelemetry.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ In other words, the `job` and `instance` labels are shared between `http_server_
138138
The `k8s_cluster_name` label, on the other hand, corresponds to the OTel resource attribute `k8s.cluster.name` (Prometheus converts dots to underscores, unless configured otherwise).
139139

140140
Be aware though that the `info` function is generally more performant than raw join queries, because it only selects `target_info` series with matching `job` and `instance` labels.
141+
Maybe more importantly, the `info` function solves an old and rather esoteric problem with the join query approach.
142+
When the values of other labels than the ones being joined on (i.e. the so-called identifying labels) change (i.e. churn), unless the old `target_info` version gets marked as stale, there will be overlap between the old and new version of `target_info` for the duration of the PromQL lookback delta (5 minutes by default).
143+
For this duration, join queries against `target_info` will fail due to there being two matching distinct `target_info` time series.
144+
Fortunately, the `info` function doesn't suffer from this issue however, because it always picks the time series with the latest sample!
141145

142146
So, what is the relation between the `target_info` metric and OTel resource attributes?
143147
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.

0 commit comments

Comments
 (0)