Llm Observability banner
DataDog DataDog

Llm Observability

AI community

Description

Learn by example how to instrument Datadog's LLM Observability product

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

LLM Observability Jupyter Notebooks

These notebooks introduce you to Datadog's [LLM Observability Python SDK](https://docs.datadoghq.com/llm_observability/setup/sdk/python/) using hands-on examples.

For a detailed instrumentation guide, see [Trace an LLM Application](https://docs.datadoghq.com/tracing/llm_observability/trace_an_llm_application/).

Prerequisites

Setup

1. Activate your virtualenv:

python -m venv myenv
source myenv/bin/activate

2. Create a .env file and add the following:

DD_API_KEY=
DD_SITE=
DD_LLMOBS_AGENTLESS_ENABLED=1
DD_LLMOBS_ML_APP="onboarding-quickstart"
  • Note: if your Datadog site (DD_SITE) is not provided, the value defaults to "datadoghq.com"
  • Feel free to update the DD_LLMOBS_ML_APP variable to any custom app name.
  • DD_LLMOBS_AGENTLESS_ENABLED=1 is only required if the Datadog Agent is not running. If the agent is running in your production environment, make sure this environment variable is unset.

3. If you don't already have a system-wide OPENAI_API_KEY variable, add one to the .env file:

OPENAI_API_KEY=

3. Install shared dependencies from the requirements.txt file:

pip install -r requirements.txt

4. Launch Jupyter notebooks

You can either start Jupyter on the command line (`jupyter notebook`) to use the web interface, or open your notebook from your preferred code editor (for example, VS Code) and run it there.

Notebooks

1. Tracing a simple LLM call

**[This notebook](./1-llm-span.ipynb)** shows you how to create and trace a simple LLM call.

2. Tracing an LLM Workflow

**[Th