Query distributed traces from Grafana Tempo using TraceQL via the HTTP API

domain: grafana.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Confirm Tempo is deployed with the query-frontend component exposed and note the base URL and authentication requirements
  2. Search for traces via POST to '/api/search' with JSON body containing 'q' (a TraceQL expression), 'start' and 'end' (Unix epoch seconds), and 'limit' for result count
  3. Construct a TraceQL expression to filter spans: '{ span.http.status_code = 500 }' returns traces containing spans with that attribute; '{ duration > 2s }' filters by span duration
  4. Fetch a full trace by trace ID via GET to '/api/traces/{traceID}' which returns the trace in OTLP JSON format with all spans and resource attributes
  5. Use '/api/search/tags' to discover available tag names and '/api/search/tag/{tag_name}/values' to see values before building TraceQL queries

Known gotchas

Related routes

Query distributed traces with Grafana Tempo TraceQL
grafana.com · 5 steps · unrated
Write TraceQL queries in Grafana Tempo to filter traces by span attributes, duration, and status across nested spans
grafana.com · 5 steps · unrated
Configure Grafana Tempo to ingest OTLP traces, enable TraceQL metrics, and link Tempo to a Loki datasource for trace-to-log correlation
grafana.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans