Skip to content

Commit 15124d6

Browse files
fix: restore OTLP metrics ingestion into Prometheus
Prometheus 3.x replaced the otlp-write-receiver feature flag with --web.enable-otlp-receiver; with the old flag the collector's metrics export 404ed and all OTLP metrics were silently dropped (surfaced by the new demo). Also add a Loki derived field so trace_id arriving as OTLP structured metadata links to Tempo, not just trace ids in the log body.
1 parent 50e8476 commit 15124d6

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ services:
6262
- --storage.tsdb.path=/prometheus
6363
- --storage.tsdb.retention.time=30d
6464
- --web.enable-remote-write-receiver
65-
- --enable-feature=native-histograms,otlp-write-receiver,exemplar-storage
65+
# Prometheus 3.x: OTLP ingestion is its own flag, no longer a feature flag.
66+
- --web.enable-otlp-receiver
67+
- --enable-feature=native-histograms,exemplar-storage
6668
logging: *default-logging
6769

6870
grafana:

config/grafana/datasources.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ datasources:
2525
matcherRegex: "[tT]race[_-]?[iI][dD][\"=:\\s]+([A-Fa-f0-9]+)"
2626
url: "$${__value.raw}"
2727
datasourceUid: tempo
28+
# Same, for OTLP logs where trace_id is structured metadata, not body text.
29+
- name: trace_id (otlp)
30+
matcherType: label
31+
matcherRegex: trace_id
32+
url: "$${__value.raw}"
33+
datasourceUid: tempo
2834

2935
- name: Tempo
3036
type: tempo

0 commit comments

Comments
 (0)