> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Auto-Instrumentation

> Auto-instrument your LLM application with pre-built integrations for 30+ providers and frameworks

Start where it's automatic. For supported providers and frameworks, install an instrumentor package, attach it once (`.instrument()` in Python, `registerInstrumentations({...})` / package-specific setup in JS/TS, or `option.WithMiddleware(...)` on the SDK client in Go), and every call is traced — no per-call code changes.

You can start from the Arize AX UI — when you create a new tracing project, the setup wizard walks you through choosing your integration and gives you the code to copy:

<Frame>
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/instrument/auto-instrumentation.png" alt="New Tracing Project setup wizard in Arize AX" />
</Frame>

Or follow the steps below.

# Set Up with Skills or Code

<Tabs>
  <Tab title="By Arize Skills">
    Three steps to instrument with your AI coding agent:

    **Install skill**

    ```bash theme={null}
    npx skills add Arize-ai/arize-skills --skill "arize-instrumentation" --yes
    ```

    **Set up authentication**

    ```bash theme={null}
    export ARIZE_API_KEY="YOUR_API_KEY"
    export ARIZE_SPACE_ID="YOUR_SPACE_ID"
    ```

    **Instrument your app**

    ```bash theme={null}
    # Ask your AI coding agent:
    "Set up Arize tracing in my application"
    ```

    Works with Cursor, Claude Code, Codex, and more. The skill analyzes your stack, picks the right OpenInference package, wires it in, and tells you exactly how to verify traces are flowing:

    <Frame>
      <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/instrument/auto_instrumentation_skill.png" alt="Arize instrumentation skill analyzing a Vercel AI SDK app and proposing the right OpenInference integration" />
    </Frame>
  </Tab>

  <Tab title="By Code">
    Install the [OpenInference](https://github.com/Arize-ai/openinference) instrumentor for your provider, register a tracer provider with your Arize credentials, and attach the instrumentor — `.instrument()` in Python, `registerInstrumentations({...})` / package-specific setup in JS/TS, or `option.WithMiddleware(...)` on the SDK client in Go.

    <Steps>
      <Step title="Install">
        <Tabs>
          <Tab title="Python">
            ```bash theme={null}
            pip install arize-otel openinference-instrumentation-openai openai
            ```
          </Tab>

          <Tab title="JS/TS">
            ```bash theme={null}
            npm install @arizeai/openinference-instrumentation-openai openai @opentelemetry/sdk-trace-node @opentelemetry/exporter-trace-otlp-proto @opentelemetry/resources @opentelemetry/instrumentation
            ```
          </Tab>

          <Tab title="Go">
            Requires Go 1.25+. Install [`arize-otel-go`](https://github.com/Arize-ai/arize-otel-go) for tracer setup plus the [`openinference-instrumentation-openai-go`](https://github.com/Arize-ai/openinference/tree/main/go/openinference-instrumentation-openai-go) middleware for the official [`openai/openai-go`](https://github.com/openai/openai-go) SDK:

            ```bash theme={null}
            go get \
              github.com/Arize-ai/arize-otel-go \
              github.com/Arize-ai/openinference/go/openinference-instrumentation-openai-go \
              github.com/openai/openai-go
            ```

            For Anthropic, swap the instrumentor for [`openinference-instrumentation-anthropic-sdk-go`](https://github.com/Arize-ai/openinference/tree/main/go/openinference-instrumentation-anthropic-sdk-go) and the SDK for [`anthropics/anthropic-sdk-go`](https://github.com/anthropics/anthropic-sdk-go). For clients without a first-party instrumentor, use [Manual instrumentation](/ax/instrument/manual-instrumentation).
          </Tab>
        </Tabs>
      </Step>

      <Step title="Register and instrument">
        <Tabs>
          <Tab title="Python">
            ```python theme={null}
            from arize.otel import register
            from openinference.instrumentation.openai import OpenAIInstrumentor

            tracer_provider = register(
                space_id="YOUR_SPACE_ID",        # Settings > API Keys in Arize AX
                api_key="YOUR_API_KEY",          # Settings > API Keys > + New API Key
                project_name="my-project",
            )
            OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)
            ```
          </Tab>

          <Tab title="JS/TS">
            ```typescript theme={null}
            import { NodeTracerProvider, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-node";
            import { registerInstrumentations } from "@opentelemetry/instrumentation";
            import { resourceFromAttributes } from "@opentelemetry/resources";
            import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
            import OpenAI from "openai";
            import { OpenAIInstrumentation } from "@arizeai/openinference-instrumentation-openai";

            const provider = new NodeTracerProvider({
                resource: resourceFromAttributes({
                    ["openinference.project.name"]: "my-project",
                }),
                spanProcessors: [
                    new SimpleSpanProcessor(
                        new OTLPTraceExporter({
                            url: "https://otlp.arize.com/v1/traces",
                            headers: {
                                'arize-space-id': 'YOUR_SPACE_ID',
                                'arize-api-key': 'YOUR_API_KEY',
                            },
                        }),
                    ),
                ],
            });

            const instrumentation = new OpenAIInstrumentation();
            instrumentation.manuallyInstrument(OpenAI);
            registerInstrumentations({ instrumentations: [instrumentation] });
            provider.register();
            ```
          </Tab>

          <Tab title="Go">
            `arizeotel.Register` returns a configured `*sdktrace.TracerProvider`, installs it as the global, and reads `ARIZE_SPACE_ID` / `ARIZE_API_KEY` from the environment when the matching `Options` fields are unset. Attach the OpenAI middleware via `option.WithMiddleware`:

            ```go theme={null}
            import (
                "context"
                "log"
                "os"
                "time"

                arizeotel "github.com/Arize-ai/arize-otel-go"
                openaiotel "github.com/Arize-ai/openinference/go/openinference-instrumentation-openai-go"
                "github.com/openai/openai-go"
                "github.com/openai/openai-go/option"
                "go.opentelemetry.io/otel"
            )

            tp, err := arizeotel.Register(ctx, arizeotel.Options{
                ProjectName: "my-project",
            })
            if err != nil { log.Printf("register tracer: %v", err); return }
            defer func() {
                shutdownCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
                defer cancel()
                _ = tp.Shutdown(shutdownCtx)
            }()

            client := openai.NewClient(
                option.WithAPIKey(os.Getenv("OPENAI_API_KEY")),
                option.WithMiddleware(openaiotel.Middleware(otel.Tracer("my-project"))),
            )
            ```
          </Tab>
        </Tabs>
      </Step>

      <Step title="Run your app">
        Every OpenAI call is now traced automatically:

        <Tabs>
          <Tab title="Python">
            ```python theme={null}
            import openai
            client = openai.OpenAI()
            response = client.chat.completions.create(
                model="gpt-4o",
                messages=[{"role": "user", "content": "What is observability?"}],
            )
            ```
          </Tab>

          <Tab title="JS/TS">
            ```typescript theme={null}
            const client = new OpenAI();
            const response = await client.chat.completions.create({
              model: "gpt-4o",
              messages: [{ role: "user", content: "What is observability?" }],
            });
            ```
          </Tab>

          <Tab title="Go">
            The middleware auto-emits an LLM-kind span around every `/v1/chat/completions` request — prompt, response, token counts, and finish reason are all set for you.

            ```go theme={null}
            import (
                "github.com/openai/openai-go"
                "github.com/openai/openai-go/shared"
            )

            resp, err := client.Chat.Completions.New(ctx, openai.ChatCompletionNewParams{
                Model: shared.ChatModel("gpt-5"),
                Messages: []openai.ChatCompletionMessageParamUnion{
                    openai.UserMessage("What is observability?"),
                },
            })
            ```
          </Tab>
        </Tabs>
      </Step>
    </Steps>

    This example uses OpenAI, but the same pattern works for any provider — install the instrumentor and attach it (`.instrument()` in Python, `registerInstrumentations({...})` in JS/TS, or `option.WithMiddleware(...)` in Go).

    <Info>
      For some frameworks (CrewAI, LangChain, AutoGen, LlamaIndex), `.instrument()` must run **before** importing the library — they patch methods at runtime, so objects created earlier will not emit spans. See each integration page for specifics.
    </Info>
  </Tab>
</Tabs>

# Supported Integrations

Arize has 30+ native integrations across LLM providers, Python and TypeScript agent frameworks, and Java. The most common ones:

<CardGroup cols={4}>
  <Card title="OpenAI" href="/ax/integrations/llm-providers/openai/openai-tracing" img="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/eae48fc7-image.avif" />

  <Card title="Anthropic" href="/ax/integrations/llm-providers/anthropic/anthropic-tracing" img="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/e507a114-image.avif" />

  <Card title="LangChain" href="/ax/integrations/python-agent-frameworks/langchain/langchain-tracing" img="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/01ab0d97-image.avif" />

  <Card title="LangGraph" href="/ax/integrations/python-agent-frameworks/langgraph/langgraph-tracing" img="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/01ab0d97-image.avif" />

  <Card title="LlamaIndex" href="/ax/integrations/python-agent-frameworks/llamaindex/llamaindex-tracing" img="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/f367d753-image.avif" />

  <Card title="CrewAI" href="/ax/integrations/python-agent-frameworks/crewai/crewai-tracing" img="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/000a0e60-image.avif" />

  <Card title="Mastra" href="/ax/integrations/ts-js-agent-frameworks/mastra/mastra-tracing" img="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/43c919a1-image.jpeg" />

  <Card title="Vercel AI SDK" href="/ax/integrations/ts-js-agent-frameworks/vercel/vercel-ai-sdk-tracing" img="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/a05fd5cb-image.avif" />
</CardGroup>

<Card title="See all 30+ integrations (LLM providers, agent frameworks, Python, TypeScript, Java)" href="/ax/integrations" icon="arrow-right" />

For a primer on the underlying OpenTelemetry concepts these integrations build on, see [OTel primitives](https://opentelemetry.io/docs/concepts/signals/traces/).

# Learn More

* **What auto captures** — auto-instrumentors set [OpenInference semantic conventions](https://github.com/Arize-ai/openinference) automatically: model name, messages, token counts, inputs, outputs.
* **Group traces into conversations** — add `session.id` and `user.id` to follow multi-turn interactions. See [Set up sessions](/ax/instrument/set-up-sessions).
* **Enrich traces with custom data** — attach metadata, tags, and custom attributes to auto-instrumented spans. See [Customize your traces](/ax/instrument/customize-your-traces).
* **Control what's captured** — hide sensitive inputs, suppress tracing for specific calls, or truncate images with `TraceConfig`. See [Mask and redact data](/ax/instrument/mask-and-redact-data).
* **Augment what auto didn't capture** — add manual spans for anything auto-instrumentation missed. See [Manual instrumentation](/ax/instrument/manual-instrumentation) or [Combine auto + manual](/ax/instrument/combining-auto-and-manual).

***

## Next step

For custom logic that auto-instrumentors can't capture, add manual spans:

<Card title="Next: Manual Instrumentation" icon="arrow-right" href="/ax/instrument/manual-instrumentation" />
