> ## 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.

# Share OpenTelemetry provider

> Send spans through an application-owned OpenTelemetry TracerProvider by sharing it with atlanai SDK in Python or TypeScript.

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

atlanai SDK can export through a TracerProvider that your application already owns, so its spans and Atlan spans share one pipeline. Use it when OpenTelemetry is set up in your application before tracing is. If you do not own a provider, let `init_logger` create one.

## 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` or `initLogger` configured, as in [Trace first agent run](/tools/sdk/tutorials/quickstart).
* **OpenTelemetry**: the OpenTelemetry SDK packages for your language installed.

<Steps>
  <Step title="Share provider">
    Python reuses a global SDK `TracerProvider` that your application registered first. You can also pass it explicitly. OpenTelemetry JS allows only one global provider and does not let another SDK change it later, so in TypeScript you initialize in isolated mode and add the atlanai SDK processor when you construct your provider.

    <Tabs>
      <Tab title="Python">
        ```python theme={null}
        from opentelemetry import trace
        from opentelemetry.sdk.resources import Resource
        from opentelemetry.sdk.trace import TracerProvider
        from atlanai.tracing import init_logger

        provider = TracerProvider(resource=Resource.create({"service.name": "support-agent"}))
        trace.set_tracer_provider(provider)
        logger = init_logger(project_name="support-agent", tracer_provider=provider)
        ```
      </Tab>

      <Tab title="TypeScript">
        ```typescript theme={null}
        import { resourceFromAttributes } from "@opentelemetry/resources";
        import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
        import { initLogger } from "@atlanai/sdk/tracing";

        const logger = initLogger({ projectName: "support-agent", isolated: true });

        if (!logger.client.spanProcessor) {
          throw new Error("Atlan tracing is disabled");
        }

        const provider = new NodeTracerProvider({
          resource: resourceFromAttributes({ "service.name": "support-agent" }),
          spanProcessors: [logger.client.spanProcessor],
        });
        provider.register();
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Create clients after setup">
    Initialize one Atlan pipeline per process. Provider instrumentors, framework callbacks, and manual spans share that provider and its single asynchronous exporter, so do not create one Atlan logger per model provider. Create provider and framework clients after this setup. Otherwise they may retain a tracer from a different provider, and their spans do not reach Agent Registry.
  </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.