spans
Find individual spans matching filter criteria within a time range.
This is a DRILL-DOWN tool. For "where are errors / latency concentrated?" start with aggregate_spans, then use this to fetch example spans for a (service, operation).
Returns spans sorted by (timestamp, spanId) descending (newest first).
Returns the span's core fields by default; pass verbose=true to include its
attributes (flattened in, plus a resource object). Long string values are capped
(maxStringChars). For raw columns or custom selection use run_sql.
Defaults: from/to window open if none given; limit 100 (max 1000); all filters any. Common patterns:
Errored spans of an operation: statusCode="ERROR", name="http.client"
Slow spans: minDurationMs=500
Every span of a trace: traceId="..." (or use get_trace)
Returns: spans[], nextCursor (null on last page), queryStats.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End of window, ISO-8601 instant (exclusive) | |
| from | No | Start of window, ISO-8601 instant (inclusive) | |
| kind | No | Filter by kind: SERVER, CLIENT, PRODUCER, CONSUMER, INTERNAL | |
| name | No | Filter by operation/span name (e.g. 'GET /things') | |
| limit | No | Max spans, default 100, max 1000 | |
| cursor | No | Opaque cursor from a previous next_cursor | |
| service | No | Filter by service name | |
| traceId | No | Filter to a single trace id | |
| verbose | No | Return full spans incl. attributes and resource. Default false. | |
| statusCode | No | Filter by status: UNSET, OK, ERROR | |
| minDurationMs | No | Only spans at least this many milliseconds long | |
| maxStringChars | No | Max characters of any attribute string value before truncation. Omit to use the server default. |