Agent Trace Data Modeling
Description
Model agent runs, spans, tool calls, and token events into a queryable trace schema aligned with GenAI semantic conventions. The procedure is constrained by explicit inputs and acceptance criteria rather than best-effort judgment alone.
When to Use
- A task requires agent trace data modeling before downstream steps can proceed safely.
- Ambiguity or missing evidence would change the outcome.
- The result must be recorded with reasons and evidence for later verification.
Inputs / Outputs
| Area |
Contract |
| Inputs |
Task context, candidate inputs, and explicit acceptance criteria for agent trace data modeling. |
| Outputs |
A decision or artifact with recorded reasons, 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 data modeling steps in a bounded, checkpointed way.
- Compare the actual outcome against the expected outcome 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.
Runnable Example
def span(run_id, name, ms):
return {"run": run_id, "name": name, "duration_ms": ms}
def total(spans):
return sum(s["duration_ms"] for s in spans)
assert total([span("r", "llm", 10), span("r", "tool", 5)]) == 15
Failure Modes
- Acting outside the declared task boundary.
- Assuming an estimate or preview equals the verified effect.
- Retrying without preserving state or evidence.
- Using stale inputs as if they were current.
- Reporting success without checking the resulting state.
Boundary
This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result.
Evidence
Agent observability in 2026 converges on OTel GenAI semantic conventions for traces. These are dated public signals, not adoption metrics.
Related
- observability-instrumentation.md
- log-parsing.md
- time-series-reading.md
1---2name: agent-trace-data-modeling3description: Model agent runs, spans, tool calls, and token events into a queryable trace schema aligned with GenAI semantic conventions.4metadata:5 source: https://skillmd.com/skills/samotech/agent-trace-data-modeling6 upstream: skills/12-data/agent-trace-data-modeling.md7 category: 12-data8 version: "v1"9---1011# Agent Trace Data Modeling1213## Description14Model agent runs, spans, tool calls, and token events into a queryable trace schema aligned with GenAI semantic conventions. The procedure is constrained by explicit inputs and acceptance criteria rather than best-effort judgment alone.1516## When to Use17- A task requires agent trace data modeling before downstream steps can proceed safely.18- Ambiguity or missing evidence would change the outcome.19- The result must be recorded with reasons and evidence for later verification.2021## Inputs / Outputs22| Area | Contract |23|---|---|24| Inputs | Task context, candidate inputs, and explicit acceptance criteria for agent trace data modeling. |25| Outputs | A decision or artifact with recorded reasons, 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 data modeling steps in a bounded, checkpointed way.324. Compare the actual outcome against the expected outcome 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## Runnable Example37```python38def span(run_id, name, ms):39 return {"run": run_id, "name": name, "duration_ms": ms}40def total(spans):41 return sum(s["duration_ms"] for s in spans)42assert total([span("r", "llm", 10), span("r", "tool", 5)]) == 1543```4445## Failure Modes46- Acting outside the declared task boundary.47- Assuming an estimate or preview equals the verified effect.48- Retrying without preserving state or evidence.49- Using stale inputs as if they were current.50- Reporting success without checking the resulting state.5152## Boundary53This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result.5455## Evidence56Agent observability in 2026 converges on OTel GenAI semantic conventions for traces. These are dated public signals, not adoption metrics.5758## Related59- observability-instrumentation.md60- log-parsing.md61- time-series-reading.md