error_rate_rca
Rank services by 5xx error share vs fleet baseline, flag anomalies, and map dominant error codes to root causes and actions.
Instructions
[READ] Rank services by 5xx share vs the fleet baseline, cause + action.
The flagship error RCA: reads per-service status-code counters (traefik /metrics, haproxy stats), flags services whose 5xx rate crosses the threshold with enough traffic, and maps the dominant code to a cause (503 no-upstream / 502 conn-fail / 504 timeout / 500 app error). Every entry carries its numbers and its multiple vs the fleet baseline. Pass 'counters' for pure analysis. caddy targets return the support matrix's teaching note (no per-route counters).
Args: error_rate_pct: 5xx %% at/above which a service is flagged (default 5.0). min_requests: Minimum requests before a service can be flagged (default 30). counters: Injected rows {service, total, codes:{...}} and/or classes:{"5xx": n}; skips the live pull. target: Proxy target name from config; omit for the default.
Returns dict: {servicesEvaluated, flaggedCount, fleetErrorRatePct, thresholds, flagged:[{service, requestsTotal, errors5xx, errorRatePct, dominantCode, vsBaselineX, severity, cause, action}], note}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| counters | No | ||
| min_requests | No | ||
| error_rate_pct | No |