Skip to main content
SDK 0.4.0 auto_instrument() in atlanai SDK discovers the standard opentelemetry_instrumentor entry points installed in your Python environment and enables only recognized AI instrumentors. Use it when your provider library has an OpenTelemetry instrumentor and you want its spans in the same trace as your agent. For a library without one, use Wrap unsupported framework.

Before you begin

Before you start, make sure you have:
  • SDK: atlanai SDK installed with tracing, as in Install atlanai SDK.
  • Tracing: init_logger configured, as in Trace first agent run.
  • Instrumentor: the OpenTelemetry instrumentation package approved for your provider. atlanai SDK does not install vendor instrumentors.
1

Install provider instrumentor

Install the OpenTelemetry instrumentation package for your provider, for example opentelemetry-instrumentation-openai, in the same environment as your agent.
2

Enable auto-instrumentation

Call auto_instrument() once at startup, before you import provider clients, and initialize the logger.
Disable one installed integration with a flag such as auto_instrument(openai=False).init_logger captures every OpenTelemetry scope by default, including HTTP and database instrumentors already attached to the same provider. Pass capture_all=False to return to the AI-focused allowlist.
3

Check report

Read report.instrumented and report.failed.
Treat report.failed as a deployment failure when complete traces are required. A running application does not prove that its provider spans were instrumented.
4

Verify trace

Run one request, flush, and open the trace in Agent Registry. Confirm the root span, provider calls, tool calls, usage, and parent relationships.If no trace appears, see init() disables tracing and no traces are exported.

Troubleshooting

If traces do not appear, see Install and setup errors.

Next steps

See also