During a critical production incident, bouncing between separate browser tabs and copy-pasting IDs across disconnected tools is the primary reason for prolonged MTTR (Mean Time To Resolution). The architectural strength of the modern observability stack (Prometheus, Grafana Loki, and Grafana Tempo) lies in unifying telemetry into a seamless 1-click investigation flow: from the high-level symptom (Prometheus Metric) to the root cause statement (Loki Log) and the exact microservice bottleneck (Tempo Distributed Trace). Here is how to configure and master this workflow.
1. The Interconnected Observability Triad
Each pillar answers a distinct operational question during an incident:
Detects the anomaly: "HTTP 5xx error rate on service Checkout spiked to 8% at 14:02 UTC".
Explains the failure: "Connection timeout to payment database replica-02".
Pinpoints the bottleneck: "Span db.query SELECT invoices stalled for 4,200 ms inside pod checkout-84df7".
2. Setting Up 1-Click Data Links: Prometheus to Loki
Empower on-call SREs to click directly on a spike within an alerting graph and immediately pivot into matching Loki logs:
# Inside panel settings (Data Links):
Title: View Logs for Service (${__series.name})
URL: /explore?left={"datasource":"Loki","queries":[{"expr":"{service=\"${__field.labels.service}\"} |= \"error\""}],"range":{"from":"${__from}","to":"${__to}"}}
3. Seamless Trace Extraction from Loki to Tempo (Derived Fields)
When microservices emit OpenTelemetry trace IDs inside structured JSON logs, Grafana can automatically transform those strings into direct interactive links to Tempo traces.
In your Loki data source configuration (via YAML provisioning or the Grafana UI):
# provisioning/datasources/loki.yaml
apiVersion: 1
datasources:
- name: Loki
type: loki
url: http://loki:3100
jsonData:
derivedFields:
- datasourceUid: tempo
matcherRegex: '"trace_id":"([a-f0-9]+)"'
name: TraceID
url: '$${__value.raw}'
4. Live Crisis Investigation Workflow
The service error gauge triggers an alert. The engineer clicks on the error series and chooses the Loki Data Link.
Loki loads with the synchronized time range and
level="error" filter. Log lines appear with a blue, clickable TraceID pill.
Clicking the TraceID opens the distributed trace waterfall (Gantt chart). In seconds, the engineer identifies the failing downstream dependency.
Outcome: MTTR drops from 45 minutes to under 3 minutes without leaving Grafana or opening SSH terminals.