---
title: Quickstart
description: >-
  Get started with Datadog LLM Observability by instrumenting a Python, Node.js,
  or Java LLM application using the LLM Observability SDK.
breadcrumbs: Docs > LLM Observability > Quickstart
---

# Quickstart

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ().
{% /alert %}

{% /callout %}

This page demonstrates using Datadog's LLM Observability SDK to instrument a Python, Node.js, or Java LLM application.

### Prerequisites{% #prerequisites %}

LLM Observability requires a Datadog API key if you don't have a Datadog Agent running. Find your API key [in Datadog](https://app.datadoghq.com/organization-settings/api-keys).

### Setup{% #setup %}

Follow the setup instructions in Datadog's [in-app onboarding flow](https://app.datadoghq.com/llm/applications?setupMethod=manual&showOnboarding=true) for an interactive quickstart experience.

{% tab title="Python" %}

1. Install the SDK:

   ```shell
   pip install ddtrace
   ```

1. Prefix your Python start command with `ddtrace-run`:

   ```shell
   DD_LLMOBS_ENABLED=1 \
   DD_LLMOBS_ML_APP=quickstart-app \
   DD_SITE=<YOUR_DD_SITE> \
   DD_API_KEY=<YOUR_DATADOG_API_KEY> \
   ddtrace-run <your application command>
   ```

After enabling, the SDK automatically traces calls to [supported Python frameworks](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md?tab=python) such as OpenAI, LangChain, LangGraph, Bedrock, Anthropic, and more. If your framework is not listed, add [manual instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/sdk.md?tab=python) to trace your LLM calls directly.
{% /tab %}

{% tab title="Node.js" %}

1. Install the SDK:

   ```shell
   npm install dd-trace
   ```

1. Import and initialize `dd-trace` with LLM Observability as the first dependency in your application entrypoint:

   ```shell
   DD_LLMOBS_ENABLED=1 \
   DD_LLMOBS_ML_APP=quickstart-app \
   DD_SITE=<YOUR_DD_SITE> \
   DD_API_KEY=<YOUR_DATADOG_API_KEY> \
   NODE_OPTIONS="--import dd-trace/initialize.mjs" <your application command>
   ```

After enabling, the SDK automatically traces calls to [supported Node.js frameworks](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md?tab=nodejs) such as OpenAI, LangChain, Vercel AI SDK, Bedrock, Anthropic, and more. If your framework is not listed, add [manual instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/sdk.md?tab=nodejs) to trace your LLM calls directly.

**Note**: Next.js and bundled applications (esbuild, Webpack) require additional configuration. See [Supported Node.js frameworks](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md?tab=nodejs) for setup details.
{% /tab %}

{% tab title="Java" %}

1. Install the SDK:

   ```shell
   wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'
   ```

1. Add the `-javaagent` JVM argument to your Java start command:

   ```shell
   java -javaagent:/path/to/dd-java-agent.jar \
   -Ddd.llmobs.enabled=true \
   -Ddd.llmobs.ml.app=quickstart-app \
   -Ddd.site=<YOUR_DD_SITE> \
   -Ddd.api.key=<YOUR_DATADOG_API_KEY> \
   -jar path/to/your/app.jar
   ```

After enabling, the SDK automatically traces calls to [supported Java frameworks](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md?tab=java). Java auto-instrumentation supports OpenAI and Azure OpenAI. For other libraries such as Bedrock or LangChain4j, use [manual instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/sdk.md?tab=java) instead.
{% /tab %}

{% tab title="Other languages / HTTP API" %}
For languages other than Python, Node.js, or Java, use the [LLM Observability HTTP API](https://docs.datadoghq.com/llm_observability/instrumentation/api.md) to send spans directly to Datadog without an SDK.

If your application emits [OpenTelemetry GenAI semantic convention](https://docs.datadoghq.com/llm_observability/instrumentation/otel_instrumentation.md)-compliant spans, see [OpenTelemetry Instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/otel_instrumentation.md) instead.
{% /tab %}

Your Datadog site is . Replace `<YOUR_DATADOG_API_KEY>` with your Datadog API key.

### View traces{% #view-traces %}

Make requests to your application triggering LLM calls and then view traces in the Traces tab [of the LLM Observability page](https://app.datadoghq.com/llm/traces) in Datadog.

If you don't see any traces:

- **Check that your library is auto-instrumented**: Auto-instrumentation only captures calls to [supported frameworks and libraries](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md). Check the supported list for [Python](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md?tab=python), [Node.js](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md?tab=nodejs), or [Java](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md?tab=java). If your library is not listed, you need to add instrumentation manually.
- **Add manual instrumentation**: Use the [LLM Observability SDK](https://docs.datadoghq.com/llm_observability/instrumentation/sdk.md#manual-instrumentation) to wrap your LLM calls with spans directly in code. This works for any library or model provider.
- **Use the HTTP API**: The [LLM Observability HTTP API](https://docs.datadoghq.com/llm_observability/instrumentation/api.md) accepts spans from any language or framework and does not require an SDK.
- **Use OpenTelemetry**: If your framework emits [OpenTelemetry GenAI semantic convention](https://docs.datadoghq.com/llm_observability/instrumentation/otel_instrumentation.md)-compliant spans, see [OpenTelemetry Instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/otel_instrumentation.md) for setup details.

### Next steps{% #next-steps %}

After traces are being submitted from your application, you can:

- [Configure evaluations](https://docs.datadoghq.com/llm_observability/evaluations.md) that you can use to assess the effectiveness of your LLM application.
- Add [manual instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/sdk.md#manual-instrumentation) to your application and extract data that automatic instrumentation cannot.

## Example "Hello World" application{% #example-hello-world-application %}

See below for a simple application that can be used to begin exploring the LLM Observability product.

{% tab title="Python" %}

1. Install OpenAI with `pip install openai`.

1. Save example script `app.py`:

   ```python
   import os
   from openai import OpenAI
   
   oai_client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
   completion = oai_client.chat.completions.create(
       model="gpt-4o-mini",
       messages=[
        {"role": "system", "content": "You are a helpful customer assistant for a furniture store."},
        {"role": "user", "content": "I'd like to buy a chair for my living room."},
    ],
   )
   ```

1. Run the application:

   ```shell
   DD_LLMOBS_ENABLED=1 \
   DD_LLMOBS_ML_APP=quickstart-app \
   DD_API_KEY=<YOUR_DATADOG_API_KEY> \
   ddtrace-run app.py
   ```

{% /tab %}

{% tab title="Node.js" %}

1. Install OpenAI with `npm install openai`.

1. Save example script `app.js`:

   ```js
   const { OpenAI } = require('openai');
   const oaiClient = new OpenAI(process.env.OPENAI_API_KEY);
   
   async function main () {
       const completion = await oaiClient.chat.completions.create({
          model: 'gpt-4o-mini',
          messages: [
             { role: 'system', content: 'You are a helpful customer assistant for a furniture store.' },
             { role: 'user', content: 'I\'d like to buy a chair for my living room.' },
          ]
       });
       return completion;
   }
   
   main().then(console.log)
   ```

1. Run the application:

   ```shell
   DD_LLMOBS_ENABLED=1 \
   DD_LLMOBS_ML_APP=quickstart-app \
   DD_API_KEY=<YOUR_DATADOG_API_KEY> \
   NODE_OPTIONS="--import dd-trace/initialize.mjs" node app.js
   ```

{% /tab %}

## Further Reading{% #further-reading %}

- [Supported auto-instrumentation frameworks and libraries](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md)
- [LLM Observability SDK Reference for manual instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/sdk.md)
- [LLM Observability HTTP API for language-agnostic instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/api.md)
- [Instrument with OpenTelemetry](https://docs.datadoghq.com/llm_observability/instrumentation/otel_instrumentation.md)
- [Configure Evaluations on your application](https://docs.datadoghq.com/llm_observability/evaluations.md)
