Trace query syntax
The Traces query bar combines with the toolbar filters; every term must match. Terms are separated by spaces (or commas); quote values containing spaces, e.g. name="GET /api".
service=checkout status=error dur>200ms http.status_code>=500
Terms
| Term | Matches |
|---|---|
service=checkout, service!=checkout | Span's service (case-insensitive) |
name:users, name="SELECT users", name!=… | Span name contains / equals |
status=error / ok / unset | Span status |
kind=server / client / internal / producer / consumer | Span kind |
http.route=/api, key:value | Attribute contains the text (case-insensitive) |
key!=value | Attribute does not contain the text (spans without it also match) |
http.status_code>=500, >, <, <= | Numeric attribute comparison |
has:key or a dotted db.system | Attribute is present |
-key | Attribute is absent |
dur>200ms, dur<1.5s (us, ms, s, m, h) | Trace duration |
trace:4bf92f | Trace ID contains |
any other word, or "a phrase" | A span name or the trace ID contains it |
Span terms must hold on the same span
service=checkout status=error finds traces where a checkout span failed — not traces where checkout ran and something else failed.
Examples
| Query | Finds |
|---|---|
status=error dur>200ms | Slow traces containing a failed span |
kind=server http.status_code>=500 | Server spans that returned a 5xx |
db.system name:SELECT | Traces with a database span whose name contains SELECT |
service=payments -http.route | Payments spans without an HTTP route |
trace:4bf92f | A trace whose ID contains 4bf92f |
Limits
Queries are limited to 1000 characters and 20 terms; unrecognised terms are listed and ignored. The same syntax is used by the #otelTraces AI tool.