Triage Trace
triage_traceIdentify the likely root cause of a trace by analyzing error chains and span self-time, returning a compact diagnosis instead of raw trace data.
Instructions
Synthesize a likely-root-cause diagnosis for a trace, instead of returning raw trace data for the caller to re-derive one from every time.
Computes a critical path (the "Last Finishing Child" chain actually responsible for the trace's total latency), ranks spans by self-time (latency contribution net of children, top 10), and - when the trace contains an error anywhere under any root span - identifies the deepest error span in the trace's error chain as the likely root cause. Falls back to the highest self-time span as a pure-latency diagnosis when no error is present. Deterministic (no LLM call); works against any configured backend.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trace_id | Yes | Trace identifier | |
| detail_level | No | "summary" (default) returns a compact diagnosis only - this differs from get_trace's own "full"-by-default, since a triage result is already a small synthesized diagnosis rather than a raw data dump, so there is no unbounded-by-default payload to guard against here. "full" additionally attaches the diagnosed root cause's raw error detail (message/type/ stacktrace) to both the verdict and the matching error_chain entry, when the verdict is error-driven. | summary |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| verdict | Yes | The synthesized root-cause diagnosis triage_trace produces. likely_root_cause is None only when the trace has no spans at all (a backend returned an empty TraceData) - every non-empty trace always finds a candidate, since the pure-latency fallback (confidence="low") applies whenever no error chain exists. | |
| trace_id | Yes | ||
| error_chain | Yes | ||
| critical_path | Yes | ||
| top_latency_contributors | Yes | Top spans by self-time (latency contribution net of children) across the whole trace, capped at 10 entries. |