jaeger_span_statistics
Compute latency percentiles and error rates per operation from recent traces to pinpoint slow or failing endpoints.
Instructions
Compute per-operation latency percentiles and error rates across recent traces.
Fetches up to limit traces for the given service (optionally filtered
by operation), then aggregates all spans by operation name. For each
operation reports: span count, p50/p95/p99 duration in microseconds,
error count, and error rate.
Duration values are in microseconds (integer). Error rate is
error_count / span_count (float, 0.0–1.0).
Examples:
- Use when: "What are the p95 latencies for each endpoint in order-service?"
→ service='order-service'; inspect each operation's p95_duration_us.
- Use when: "How often does the POST /checkout endpoint error?"
→ service='checkout-svc', operation='POST /checkout'; check
error_rate in the stats.
- Use when: "Compare latency distributions across operations"
→ look at p50 vs p99 spread to identify high-variance operations.
- Use when: "Get a larger sample for more accurate stats"
→ limit=100 for higher confidence percentiles.
- Don't use when: You want to compare two specific traces
(use jaeger_compare_traces instead).
- Don't use when: You want full span detail for a single trace
(use jaeger_get_trace instead).
Returns:
dict with service / operation / trace_count /
stats (list of per-operation stats with count, p50/p95/p99
duration_us, error_count, error_rate).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of traces to fetch and analyze (1-100, default 20). | |
| service | Yes | Service name to compute statistics for (required). Use jaeger_list_services to discover valid names. | |
| operation | No | Operation name filter (optional). When set, only traces matching this operation are fetched. Use jaeger_list_operations to discover valid names. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stats | Yes | ||
| service | Yes | ||
| operation | Yes | ||
| trace_count | Yes |