Analyze OpenTelemetry Agent Trace Spans
systemores_analyze_trace_telemetryAnalyze OpenTelemetry trace JSON to detect token cost burn traps, repeated-span sub-agent loop deadlocks, and per-span latency hotspots in multi-span MCP sessions.
Instructions
Analyzes an OpenTelemetry trace JSON payload (otelTraceJson, max 100,000 chars; span array or { spans, traceId } object) to summarize session token cost burn traps (default > $2.50), repeated-span sub-agent loop deadlocks, and per-span latency hotspots (default > 3000ms). Deterministic, stateless check requiring a Pro/Trial API key; returns rating CRITICAL on malformed JSON. Use for multi-span OTel/MCP trace logs; use systemores_measure_drag for single-turn character/latency math or systemores_audit_agent_graph for static topology analysis.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"otelTraceJson": "<otelTraceJson>"
},
"name": "systemores_analyze_trace_telemetry"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| otelTraceJson | Yes | JSON string (max 100,000 chars) of OpenTelemetry spans — either a span array or an object with a 'spans' array and optional 'traceId'/'traceparent'. | |
| latencyThresholdMs | No | Per-span duration threshold in milliseconds above which a span is flagged as a latency hotspot (default 3000). | |
| maxCostThresholdUsd | No | Maximum allowable cost in USD per session before triggering burn trap alert. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rating | Yes | ||
| traceId | Yes | ||
| recommendations | Yes | ||
| estimatedCostUsd | Yes | ||
| latencyHotspotsMs | Yes | ||
| totalSpansEvaluated | Yes | ||
| costBurnTrapDetected | Yes | ||
| loopDeadlocksDetected | Yes | ||
| traceContextPropagated | Yes |