TraceQL search via API
Search traces by TraceQL over HTTP and list matching trace IDs. limit caps results.
curl -sG "$TEMPO_ADDR/api/search" --data-urlencode 'q={ .http.status_code >= 500 }' --data-urlencode 'limit=20' | jq '.traces[].traceID'
- tool
- tempo3 commands
More tempo commands
-
curl -s "$TEMPO_ADDR/api/traces/<id>" | jq '.batches[].scopeSpans[].spans[] | {name, durationNs: (.endTimeUnixNano|tonumber)-(.startTimeUnixNano|tonumber)}'Pull a trace by ID and compute per-span duration. note: times are unix nanos.
-
{ .service.name = "api" && status = error && duration > 2s }Find error spans on a service slower than 2s. combine attribute, status and duration.