Skip to main content
Automatically capture agent runs, model calls, and tool executions from Microsoft Agent Framework through its built-in OpenTelemetry emission — no manual instrumentation of the framework required.

Install

Set up

Initialize traceroot before importing agent_framework, so the OpenTelemetry instrumentation is wired up before the framework emits its first span.

Usage

Once initialized, every agent invocation, model call, and tool execution is captured automatically:
Tools are plain functions — Agent Framework already emits an execute_tool span for each call, so they don’t need manual decoration.

Verify

Run your code and confirm the trace arrives:
  1. In the traceroot UI: Navigate to Tracing > Traces in traceroot Cloud. You should see a trace with root span invoke_agent Concierge — Agent Framework names each agent span invoke_agent <agent name>.
  2. Via the CLI: Run traceroot traces list to inspect your recent traces from the terminal.

What gets captured

Limitations

  • Requires installing the agent-framework extra via pip install "traceroot[agent-framework]".
  • traceroot must be initialized before importing agent_framework so that OpenTelemetry listeners are attached before spans are generated. Requires OpenTelemetry >= 1.39.

Run the example

Clone the repo and run a complete multi-agent example end-to-end.

Python

Run the Python example

Next steps

Python SDK Reference

Explore the full Python SDK reference and instrumentation options.

Cost Tracking

Learn how traceroot calculates token costs and tracks model spend.