Search Spans
search_spans_toolFind individual OpenTelemetry spans by service, operation, LLM model, duration, error, or tag filters. Analyze specific operations or locate spans with target characteristics instead of grouped traces.
Instructions
Search for individual OpenTelemetry spans with optional filters.
Unlike search_traces, this returns individual spans rather than grouped traces, which is useful for analyzing specific operations or finding spans with certain characteristics (e.g., LLM tool calls with traceloop.span.kind == tool).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Additional tag filters as key-value pairs | |
| limit | No | Maximum number of spans to return (1-1000, default: 100) | |
| filters | No | Generic filter conditions - list of filter objects with: - field: Field name in dotted notation (e.g., "traceloop.span.kind") - operator: Comparison operator - value: Single value for most operators - values: List of values for "in", "not_in", "between" operators - value_type: Type of value(s) - "string", "number", or "boolean" | |
| end_time | No | End time in ISO 8601 format | |
| has_error | No | Filter spans with errors | |
| start_time | No | Start time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z) | |
| service_name | No | Filter by service name | |
| gen_ai_system | No | Filter by LLM provider (e.g., openai, anthropic) | |
| operation_name | No | Filter by operation/span name | |
| max_duration_ms | No | Maximum span duration in milliseconds | |
| min_duration_ms | No | Minimum span duration in milliseconds | |
| gen_ai_request_model | No | Filter by requested model name (e.g., "gpt-4") | |
| gen_ai_response_model | No | Filter by actual model used (e.g., "gpt-4-0613") |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | ||
| spans | Yes |