Analyze telemetry data for root cause analysis using Kopai CLI. Use when debugging errors, investigating latency issues, tracing request flows across services, or correlating logs with traces. Also use when users report production issues like "why is my API slow", "getting 500 errors", "service is down", "requests are timing out", or any symptom that needs telemetry-based investigation — even if they don't mention traces or observability explicitly.
100
100%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
| title | impact | tags |
|---|---|---|
| Pattern: Distributed Failures | HIGH | pattern, distributed, microservices |
Impact: HIGH
Diagnose failures across multiple services.
# 1. Find errors across services
npx @kopai/cli traces search --status-code ERROR --limit 50 --json
# 2. Group by service (use jq)
npx @kopai/cli traces search --status-code ERROR --json | jq 'group_by(.ServiceName) | map({service: .[0].ServiceName, count: length})'
# 3. Trace cross-service flow
npx @kopai/cli traces get <traceId> --fields ServiceName,SpanName,StatusCode --json| Field | Purpose |
|---|---|
| ServiceName | Which service |
| ParentSpanId | Call chain |
| SpanKind | CLIENT/SERVER/INTERNAL |