datasources.yml (1823B)
1 # Grafana datasource provisioning 2 # Auto-configures Prometheus, Tempo, and Loki datasources on startup 3 4 apiVersion: 1 5 6 datasources: 7 # Prometheus — metrics backend 8 - name: prometheus 9 type: prometheus 10 uid: prometheus 11 access: proxy 12 url: http://prometheus:9090 13 isDefault: true 14 jsonData: 15 timeInterval: 60s # matches the OTel PeriodicReader export interval 16 exemplarTraceIdDestinations: 17 - name: trace_id 18 datasourceUid: tempo 19 20 # Loki — log aggregation backend (provisioned before Jaeger so tracesToLogsV2 can reference its UID) 21 - name: Loki 22 type: loki 23 access: proxy 24 url: http://loki:3100 25 uid: loki 26 editable: true 27 jsonData: 28 derivedFields: 29 # Logs → Traces: turn the `trace_id` structured-metadata field on every 30 # log record into a clickable link that opens the matching trace in 31 # Jaeger. Without this, the trace_id column in Loki Explore is plain 32 # text and the chapter's "click trace_id to jump to Jaeger" workflow 33 # silently doesn't work. 34 - name: TraceID 35 matcherType: label 36 matcherRegex: trace_id 37 datasourceUid: jaeger 38 url: '$${__value.raw}' 39 urlDisplayLabel: 'View Trace' 40 41 # Tempo — distributed tracing backend (after Loki so its UID is available) 42 - name: tempo 43 type: tempo 44 uid: tempo 45 access: proxy 46 url: http://tempo:3200 47 editable: true 48 jsonData: 49 tracesToLogsV2: 50 # Link from trace spans to Loki logs using trace_id structured metadata 51 datasourceUid: loki 52 spanStartTimeShift: "-1m" 53 spanEndTimeShift: "1m" 54 filterByTraceID: false 55 filterBySpanID: false 56 customQuery: true 57 query: '{service_name=~".+"} | trace_id = `$${__span.traceId}`'