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

# Overview

> Trace calls made through model provider SDKs without wrapping each request.

Use SDK auto-instrumentation when your application code creates and calls a supported model provider's native client. PromptLayer registers the provider-specific instrumentor and trace exporter, so supported calls become OpenTelemetry spans and linked request logs without replacing the provider client or logging each request manually.

For the resulting hierarchy and dashboard view, see [Traces](/features/observability/traces).

## Provider Guides

<CardGroup cols={3}>
  <Card title="OpenAI" icon="https://mintcdn.com/promptlayer/BPkPs9tNNRAlUg3k/images/provider-logos/openai.svg?fit=max&auto=format&n=BPkPs9tNNRAlUg3k&q=85&s=555b2b55d79f64fd24da74a12855f570" href="/features/observability/traces/auto-instrumentation/openai" width="120" height="120" data-path="images/provider-logos/openai.svg">
    Python and JavaScript
  </Card>

  <Card title="Anthropic" icon="https://mintcdn.com/promptlayer/BPkPs9tNNRAlUg3k/images/provider-logos/anthropic.svg?fit=max&auto=format&n=BPkPs9tNNRAlUg3k&q=85&s=d6b9c1f3e4bf891af7b50bad9359139a" href="/features/observability/traces/auto-instrumentation/anthropic" width="92" height="64" data-path="images/provider-logos/anthropic.svg">
    Python and JavaScript
  </Card>

  <Card title="Google" icon="https://mintcdn.com/promptlayer/BPkPs9tNNRAlUg3k/images/provider-logos/google.svg?fit=max&auto=format&n=BPkPs9tNNRAlUg3k&q=85&s=ad56cf4abb898da915adabc2eda2b57f" href="/features/observability/traces/auto-instrumentation/google" width="118" height="120" data-path="images/provider-logos/google.svg">
    Python and JavaScript
  </Card>

  <Card title="AWS Bedrock" icon="aws" href="/features/observability/traces/auto-instrumentation/bedrock">
    Python and JavaScript
  </Card>
</CardGroup>

The provider guide is the source of truth for supported API surfaces, installation, initialization order, content capture, exporter settings, flushing, and verification. Coverage and configuration can differ between languages.

## Enable All Installed Providers

Python requires the optional instrumentation extra. Install only the provider SDKs your application uses:

```bash theme={null}
pip install "promptlayer[otel-genai-instrumentation]" openai anthropic google-genai boto3
```

Then enable tracing on the PromptLayer client. By default, the client instruments every supported provider SDK that is installed:

```python theme={null}
from promptlayer import PromptLayer

pl = PromptLayer(enable_tracing=True)

# Make direct OpenAI, Anthropic, Google GenAI, or AWS Bedrock calls.

# Flush pending spans before a short-lived process exits.
pl.tracer_provider.force_flush()
```

The Python instrumentation extra requires Python 3.10 or later. The core PromptLayer package continues to support Python 3.9.

For JavaScript, install PromptLayer and the provider SDKs your application uses:

```bash theme={null}
npm install promptlayer openai @anthropic-ai/sdk @google/genai @aws-sdk/client-bedrock-runtime
```

Provider SDK modules must load after tracing is configured. In an ESM application, preload PromptLayer before the application module:

```bash theme={null}
node --import promptlayer/register app.mjs
```

The preload reads `PROMPTLAYER_API_KEY` and instruments every supported provider. Call `shutdownTracing()` before a short-lived process exits:

```javascript theme={null}
import { shutdownTracing } from "promptlayer";

try {
  await runApplication();
} finally {
  await shutdownTracing();
}
```

Do not shut down tracing after every request in a long-running server.

## Select Providers

Omit the provider selection to instrument every supported provider. Pass an empty list or tuple to export PromptLayer spans without provider SDK auto-instrumentation.

<CodeGroup>
  ```python Python theme={null}
  from promptlayer import PromptLayer

  pl = PromptLayer(
      enable_tracing=True,
      tracing_providers=("anthropic", "google"),
  )
  ```

  ```javascript JavaScript theme={null}
  import { configureTracing } from "promptlayer";

  const tracing = configureTracing({
    providers: ["anthropic", "google"],
  });

  try {
    // Dynamic import ensures provider SDKs load after instrumentation.
    await import("./app.mjs");
  } finally {
    await tracing.shutdown();
  }
  ```
</CodeGroup>

Supported selectors are `openai`, `anthropic`, `google`, and `bedrock`. Python accepts `amazon.bedrock` and `aws.bedrock` as aliases for the Botocore instrumentor, and `openai.azure` as an alias for the OpenAI instrumentor. Anthropic Vertex uses `anthropic`; Google clients created with `vertexai=True` use `google`.

Python applications that do not create a PromptLayer client can call `configure_tracing(providers=(...))`. The function returns the configured tracer provider so short-lived processes can call `force_flush()`.

## Capture Prompts and Responses

PromptLayer captures supported provider prompt and response content by default. This provides the prompt, response, and tool data used by request inspection, content search, analytics, and debugging.

To export metadata-only telemetry, opt out before tracing is configured:

<CodeGroup>
  ```bash Python theme={null}
  export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="NO_CONTENT"
  ```

  ```bash JavaScript theme={null}
  export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="false"
  ```
</CodeGroup>

JavaScript can instead pass `captureContent: false` to `configureTracing()`. Python defaults the official OpenTelemetry capture mode to `SPAN_ONLY` when PromptLayer enables provider instrumentation and preserves an explicitly configured `NO_CONTENT`, `SPAN_ONLY`, `EVENT_ONLY`, or `SPAN_AND_EVENT` value.

Without content capture, traces still include model names, timing, token usage when available, and other non-content telemetry. PromptLayer cannot search or analyze prompt, response, and tool content that was not exported.

<Warning>
  Content capture can send user prompts, model responses, tool arguments, and other application data to PromptLayer. Because it is enabled by default, review your privacy, retention, and compliance requirements and opt out before the first provider request when necessary.
</Warning>

If a framework or agent SDK creates the provider client for you, use [Telemetry Integrations](/features/observability/traces/integrations). If no provider guide applies or you already own the telemetry pipeline, use [OpenTelemetry](/features/observability/traces/opentelemetry). See the [Tracing overview](/features/observability/traces) for the complete routing guide.
