Agent Tracing
Agent tracing gives you a step-by-step record of how an AI workflow behaved in production. Anosys captures prompts, model calls, tool calls, retries, handoffs, latency, errors, cost, eval results, and business context so teams can debug agent failures with evidence instead of screenshots and guesses.
What It Does
Agent tracing turns every run into an inspectable timeline. You can follow the path from the original request through each model invocation, tool call, backend dependency, policy check, user action, and final outcome.
Anosys uses traces as the shared context for root cause analysis, cost intelligence, quality evaluation, incident response, governance, and business process monitoring.
When To Use It
Use agent tracing when you need to:
- Debug slow, failed, or low-quality agent runs.
- Understand which tool call, handoff, model choice, prompt, or backend dependency caused a bad outcome.
- Attribute latency and token cost to users, workflows, teams, and business processes.
- Compare production behavior against evals, policy checks, and expected outcomes.
- Give engineering, product, ML, support, and leadership the same evidence trail.
Prerequisites
Before you start, make sure you have:
- An Anosys workspace and endpoint.
- An API key or OpenTelemetry export configuration.
- A stable identifier for the workflow, user, session, or process you want to trace.
- Optional eval, cost, and business KPI fields if you want richer operational intelligence.
Step-By-Step Setup
- Create an Anosys endpoint for your agent or application.
- Choose the integration path that matches your stack:
- OpenAI Agents SDK.
- Claude Code hook.
- OpenTelemetry spans.
- REST API events.
- Custom LLM instrumentation.
- Add trace identifiers to every event in the workflow.
- Add span names for model calls, tool calls, handoffs, API calls, and process steps.
- Send duration, status, error, token, cost, and evaluation fields where available.
- Open the Anosys console and inspect the trace timeline or trace tree.
- Add alerts, dashboards, evals, or AI Assistant investigations on top of the trace data.
Example Trace Event
What Appears In The Console
After data arrives, you can see:
- A timeline of every span in the run.
- A trace tree showing agents, turns, tools, functions, handoffs, and responses.
- Latency, token usage, cost, eval score, and error status per span.
- Related logs, metrics, business KPIs, process units, and incidents.
- AI Assistant summaries that explain what happened and where to look next.
Common Mistakes
- Sending model calls without a shared
trace_id, which makes reconstruction difficult. - Treating tool calls as generic logs instead of named spans with duration and status.
- Omitting user, workflow, environment, or business process identifiers.
- Capturing cost without linking it to outcome or quality.
- Waiting until an incident to add eval, alert, and dashboard context.