CtrlK
BlogDocsLog inGet started
Tessl Logo

kopai/root-cause-analysis

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

Quality

100%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

pattern-log-driven.mdrules/

titleimpacttags
Pattern: Log-Driven InvestigationHIGHpattern, logs, investigation

Pattern: Log-Driven Investigation

Impact: HIGH

Start investigation from log entries when you don't have a trace ID.

Workflow

# 1. Search error logs (severity number >= 17 catches ERROR/FATAL regardless of text casing)
npx @kopai/cli logs search --severity-min 17 --limit 20 --json

# 2. Fallback: search for errors hidden in body/attributes (logged at INFO or no severity)
npx @kopai/cli logs search --body "error" --limit 20 --json

# 3. Extract TraceId from log output
# (look for TraceId field in JSON response)

# 4. Analyze full trace
npx @kopai/cli traces get <traceId> --json

Useful Log Searches

# By service
npx @kopai/cli logs search --service payment-api --severity-min 17 --json

# By body content
npx @kopai/cli logs search --body "connection refused" --json

# By custom attribute
npx @kopai/cli logs search --log-attr "error.type=timeout" --json

Log Fields

FieldPurpose
TraceIdCorrelate with traces
SpanIdSpecific span context
SeverityTextLog level
BodyLog message content

SKILL.md

tile.json