Find slow error traces with TraceQL
Find error spans of a service that take longer than 2s. It combines an attribute, status and duration
{ .service.name = "api" && status = error && duration > 2s }
- tool
- tempo3 commands
More tempo commands
-
curl -sG "$TEMPO_ADDR/api/search" --data-urlencode 'q={ .http.status_code >= 500 }' --data-urlencode 'limit=20' | jq '.traces[].traceID'Search traces with TraceQL over HTTP and list matching trace IDs. limit caps the number of results
-
curl -s "$TEMPO_ADDR/api/traces/<id>" | jq '.batches[].scopeSpans[].spans[] | {name, durationNs: (.endTimeUnixNano|tonumber)-(.startTimeUnixNano|tonumber)}'Get a trace by ID and calculate the duration of each span. Note: times are in Unix nanoseconds