> ## Documentation Index
> Fetch the complete documentation index at: https://platform.atlan.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To act on Atlan objects, use the Atlan MCP server at https://api.atlan.com/mcp or the atlanai CLI; `atlanai --map json` prints its command map. Run a read-only identity check before any write.
> The docs MCP server at /mcp searches these docs only. It cannot read or change Atlan objects.
> SDK packages: Python `atlanai` (PyPI) and TypeScript `@atlanai/sdk` (npm). Show Python first, then TypeScript.

# Instrument Python providers

> Enable installed AI OpenTelemetry instrumentors with auto_instrument so Python provider calls export to Agent Registry.

<Badge color="blue">SDK 0.4.0</Badge>

`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](/tools/sdk/how-tos/wrap-unsupported-framework).

## Before you begin

Before you start, make sure you have:

* **SDK**: atlanai SDK installed with tracing, as in [Install atlanai SDK](/tools/sdk/how-tos/install).
* **Tracing**: `init_logger` configured, as in [Trace first agent run](/tools/sdk/tutorials/quickstart).
* **Instrumentor**: the OpenTelemetry instrumentation package approved for your provider. atlanai SDK does not install vendor instrumentors.

<Steps>
  <Step title="Install provider instrumentor">
    Install the OpenTelemetry instrumentation package for your provider, for example `opentelemetry-instrumentation-openai`, in the same environment as your agent.
  </Step>

  <Step title="Enable auto-instrumentation">
    Call `auto_instrument()` once at startup, before you import provider clients, and initialize the logger.

    ```python theme={null}
    from atlanai.tracing import auto_instrument, init_logger

    report = auto_instrument()
    logger = init_logger(project_name="support-agent")

    print("instrumented:", report.instrumented)
    print("failed:", report.failed)
    ```

    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.
  </Step>

  <Step title="Check report">
    Read `report.instrumented` and `report.failed`.

    <Warning>
      Treat `report.failed` as a deployment failure when complete traces are required. A running application does not prove that its provider spans were instrumented.
    </Warning>
  </Step>

  <Step title="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](/tools/sdk/troubleshooting/install-and-setup-errors#init-disables-tracing-and-no-traces-are-exported).
  </Step>
</Steps>

## Troubleshooting

If traces do not appear, see [Install and setup errors](/tools/sdk/troubleshooting/install-and-setup-errors).

## Next steps

* [Control trace privacy](/tools/sdk/how-tos/privacy): mask or suppress content from third-party spans.

## See also

* [Agent frameworks](/frameworks/index)
* [Framework coverage](/frameworks/coverage)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.