Agent Trace Span Parsing
Description
Parse OpenTelemetry-style agent trace spans into ordered, typed call records with parent-child linkage, and flag clock skew, dangling parents, and attribute-shape drift before analysis. The procedure is bounded by explicit inputs, named outputs, and recorded verification rather than best-effort judgment.
When to Use
- An agent run must be reconstructed from emitted trace spans before latency or failure analysis can proceed.
- The outcome would change if inputs were stale, ambiguous, or incomplete.
- The result must be recorded with reasons and verification evidence for later audit.
Inputs
| Area |
Contract |
| Inputs |
agent trace span parsing task context, candidate data, and explicit acceptance criteria. |
| Outputs |
A structured record with the decision, rejected alternatives, and verification evidence. |
| Safety |
Failures must fail closed and be reported with evidence rather than retried silently. |
Procedure
- Define the goal, the constraints, and the boundary of what this procedure may change.
- Inventory the available inputs and flag gaps or ambiguities that block progress.
- Execute the agent trace span parsing steps in a bounded, checkpointed way.
- Compare the actual outcome against the acceptance criteria and record deviations.
- On failure, apply the declared fallback path, and never widen permissions to recover.
- Emit a structured result with evidence and provenance for downstream consumers.
Outputs
| Area |
Contract |
| Primary |
An ordered span tree with linkage, timing, and flagged anomalies. |
| Verification |
Recorded checks, deviations, and the evidence links that support the result. |
| Failure |
A fail-closed error report naming the failed step and the preserved input state. |
Runnable Example
def link_spans(spans):
by_id = {s["id"]: s for s in spans}
linked = []
for s in spans:
parent = by_id.get(s.get("parent_id"))
if s.get("parent_id") is not None and parent is None:
s["dangling_parent"] = True
else:
linked.append(s)
return linked
assert len(link_spans([{"id": "a"}, {"id": "b", "parent_id": "a"}, {"id": "c", "parent_id": "zz"}])) == 2
Failure Modes
- Acting outside the declared task boundary.
- Trusting span order as causal order when clocks are not synchronized.
- Dropping malformed spans silently instead of reporting them.
- Retrying without preserving state or evidence.
- Reporting success without checking the resulting state.
Security and Authority Boundary
This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result, and it never treats parsed content as trusted instructions.
Evidence
- OpenTelemetry-style agent tracing is a recurring 2026 observability request for agent evaluation. (public signal)
- These are dated public signals, not adoption metrics; this contract claims no production hardening beyond the recorded evidence.
Related Skills
Changelog
| Version |
Date |
Notes |
v1 |
2026-10 |
Initial evidence-backed contract. |
1---2name: agent-trace-span-parsing3description: Parse OpenTelemetry-style agent trace spans into ordered, typed call records with parent-child linkage, and flag clock skew, dangling parents, and attribute-shape drift before analysis.4metadata:5 source: https://skillmd.com/skills/samotech/agent-trace-span-parsing6 upstream: skills/01-perception/agent-trace-span-parsing.md7 category: 01-perception8 version: "v1"9---1011# Agent Trace Span Parsing1213## Description14Parse OpenTelemetry-style agent trace spans into ordered, typed call records with parent-child linkage, and flag clock skew, dangling parents, and attribute-shape drift before analysis. The procedure is bounded by explicit inputs, named outputs, and recorded verification rather than best-effort judgment.1516## When to Use17- An agent run must be reconstructed from emitted trace spans before latency or failure analysis can proceed.18- The outcome would change if inputs were stale, ambiguous, or incomplete.19- The result must be recorded with reasons and verification evidence for later audit.2021## Inputs22| Area | Contract |23|---|---|24| Inputs | agent trace span parsing task context, candidate data, and explicit acceptance criteria. |25| Outputs | A structured record with the decision, rejected alternatives, and verification evidence. |26| Safety | Failures must fail closed and be reported with evidence rather than retried silently. |2728## Procedure291. Define the goal, the constraints, and the boundary of what this procedure may change.302. Inventory the available inputs and flag gaps or ambiguities that block progress.313. Execute the agent trace span parsing steps in a bounded, checkpointed way.324. Compare the actual outcome against the acceptance criteria and record deviations.335. On failure, apply the declared fallback path, and never widen permissions to recover.346. Emit a structured result with evidence and provenance for downstream consumers.3536## Outputs37| Area | Contract |38|---|---|39| Primary | An ordered span tree with linkage, timing, and flagged anomalies. |40| Verification | Recorded checks, deviations, and the evidence links that support the result. |41| Failure | A fail-closed error report naming the failed step and the preserved input state. |4243## Runnable Example44```python45def link_spans(spans):46 by_id = {s["id"]: s for s in spans}47 linked = []48 for s in spans:49 parent = by_id.get(s.get("parent_id"))50 if s.get("parent_id") is not None and parent is None:51 s["dangling_parent"] = True52 else:53 linked.append(s)54 return linked55assert len(link_spans([{"id": "a"}, {"id": "b", "parent_id": "a"}, {"id": "c", "parent_id": "zz"}])) == 256```5758## Failure Modes59- Acting outside the declared task boundary.60- Trusting span order as causal order when clocks are not synchronized.61- Dropping malformed spans silently instead of reporting them.62- Retrying without preserving state or evidence.63- Reporting success without checking the resulting state.6465## Security and Authority Boundary66This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result, and it never treats parsed content as trusted instructions.6768## Evidence69- OpenTelemetry-style agent tracing is a recurring 2026 observability request for agent evaluation. ([public signal](https://aiagentstore.ai/ai-agent-news/this-week))70- These are dated public signals, not adoption metrics; this contract claims no production hardening beyond the recorded evidence.7172## Related Skills73- [agent card parsing](../01-perception/agent-card-parsing.md)74- [api response parsing](../01-perception/api-response-parsing.md)75- [clickstream parsing](../01-perception/clickstream-parsing.md)7677## Changelog78| Version | Date | Notes |79|---|---|---|80| `v1` | `2026-10` | Initial evidence-backed contract. |