Agent skill

Dd Instrument Llmo

by datadog-labs in datadog-labs/agent-skills

Instrument the current project with Datadog LLM Observability for Python or Node.js/Next.js backends that call LLMs or run AI agents.

MITAuto-check passedAI & LLM Engineering

Install Dd Instrument Llmo

skills CLI
$ npx skills add datadog-labs/agent-skills --skill dd-instrument-llmo -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install datadog-labs/agent-skills dd-instrument-llmo --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/datadog-labs/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/dd-instrument-llmo .claude/skills/dd-instrument-llmo && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dd-instrument-llmo
GitHub stars
177
Token cost
~2.9k tokens
SKILL.md length
1,460 words
Files
5 (incl. references)
Skills in repo
39
Repo updated
First seen
Licence
MIT

At a glance

Instrument the current project with Datadog LLM Observability for Python or Node.js/Next.js backends that call LLMs or run AI agents.

  • Works in 3 steps: Analysis → Instrumentation — routing table → Verification and Reporting
  • The user says instrument this project with LLM Observability
  • SKILL.md covers Ground rules while instrumenting, Phase 1: Analysis, Phase 2: Instrumentation —… and Phase 3: Verification and…
  • Calls uv, pip and poetry; needs DD_API_KEY

What it does

Dd Instrument Llmo is an agent skill from datadog-labs/agent-skills. Instrument the current project with Datadog LLM Observability for Python or Node.js/Next.js backends that call LLMs or run AI agents. Detects the runtime and LLM framework, provisions credentials, adds SDK init (ddtrace/dd-trace) with the correct kwargs, persists the dependency into the deploy manifest, and audits session-ID plumbing for gaps — fixing them when found. Use when the user says "instrument this project with LLM Observability", "add LLM Observability", "monitor my AI app in Datadog", "add LLM spans"…

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/common-credentials.md`, `references/common-verify-report.md` and `references/llmobs-nodejs.md`).

It sits in AI & LLM Engineering, covering LLM observability. It works with Datadog, Next.js, Python and Node.js. The repository describes itself as: Public repository for Datadog Agent Skills. The licence is MIT.

When your agent uses it

  • The user says instrument this project with LLM Observability
  • Add LLM Observability
  • Monitor my AI app in Datadog
  • Add agent session tracking

Example prompts

  • “instrument this project with LLM Observability”
  • “add LLM Observability”
  • “monitor my AI app in Datadog”
  • “/dd-instrument-llmo”

Requirements

  • Python 3
  • Node.js
  • A credential in DD_API_KEY

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Analysis
  2. Instrumentation — routing table
  3. Verification and Reporting

What it can do on your machine

Read from SKILL.md and the folder at commit d2411cc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • pip
    • poetry
    • eslint
    • prettier
    • npm
    • yarn
    • pnpm
    • bun
    • conda

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, pip, npm, yarn and pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • DD_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dd Instrument Llmo loads about 2.9k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 153 tokens; SKILL.md has 1,460 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~153
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from datadog-labs/agent-skills at commit d2411cc, republished under its MIT licence (© datadog-labs). 1,460 words, ~2,922 tokens.

Download SKILL.mdSave it as .claude/skills/dd-instrument-llmo/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
dd-instrument-llmo
description
Instrument the current project with Datadog LLM Observability for Python or Node.js/Next.js backends that call LLMs or run AI agents. Detects the runtime and LLM framework, provisions credentials, adds SDK init (ddtrace/dd-trace) with the correct kwargs, persists the dependency into the deploy manifest, and audits session-ID plumbing for gaps — fixing them when found. Use when the user says "instrument this project with LLM Observability", "add LLM Observability", "monitor my AI app in Datadog", "add LLM spans", "add agent session tracking", or "verify/repair my LLM Observability setup".
metadata.version
0.1.0
metadata.author
datadog-labs
metadata.repository
https://github.com/datadog-labs/agent-skills
metadata.tags
datadog,llm-observability,llmobs,instrumentation,python,nodejs,nextjs,ddtrace,dd-trace,agents
metadata.alwaysApply
false

Datadog LLM Observability Instrumentation

This skill assesses the current project (backend runtime, LLM/agent framework, existing instrumentation) and routes you to the right reference file under references/ for the actual setup steps. It is fully self-contained — it does not call any Datadog MCP server. Credential provisioning uses the local CreateApiKey tool, and all code changes are made by you, directly, using your own file-editing tools.

Stay within LLM Observability scope. Do not add RUM, APM application instrumentation, or unrelated Datadog products. RUM and a Datadog Agent are relevant only because they change what session/trace linking is achievable (see the "Beyond SDK init" section in the reference files).

Do NOT invent tool names. Use only CreateApiKey as described in references/common-credentials.md; every other step is done with your normal file-editing/search tools.

Do NOT write anything to memory during or after this skill. Project paths, frameworks, credentials, and ML app names are project-specific and must not be stored in persistent memory.

Ground rules while instrumenting

  • Verify before you assert. If you're not sure about file content or codebase structure, read the files — do not guess.
  • Check for existing instrumentation first. Before touching the backend, check whether ddtrace/dd-trace is already initialized with LLM Observability enabled. If it is, do not add a second, competing init/enable call. This only means skip re-init — it does not mean skip the work. SDK presence is not the same as a well-formed trace or a session ID that actually flows; run the session-ID plumbing audit in Phase 1d and close any gap it finds, even when the SDK is already present.
  • Only use packages/features you've explicitly been told to add. Don't decide on your own to enable an additional Datadog product or SDK feature beyond what this skill specifies.
  • Persist added dependencies into the deploy's manifest. Any Datadog package you add (ddtrace, dd-trace) must be written into the dependency manifest the build/deploy installs from — the one identified in Phase 1e — not just installed into the local environment. A clean deploy install reads only the manifest and will crash with a missing-module error (e.g. ModuleNotFoundError: No module named 'ddtrace') if the package isn't declared there.
  • Don't make stylistic changes to code you're not otherwise touching.
  • No package aliases when importing Datadog packages.
  • Copy Datadog SDK package names, import paths, and init keyword arguments verbatim from the applicable reference section — do not paraphrase them from memory. The Python LLM Observability import is exactly from ddtrace.llmobs import LLMObs — the module is ddtrace.llmobs, not ddtrace.llm_observability (that module does not exist and produces a deploy-time ModuleNotFoundError). The Node package is dd-trace, initialized with the form that matches the project: CommonJS require('dd-trace').init(...), an ESM import-based form for "type": "module"/.mjs projects, or Next.js's dd-trace/initialize.mjs in instrumentation.ts — all shown in references/llmobs-nodejs.md; never force require(...) into an ESM project. Use the exact LLMObs.enable(...) / .init({...}) keyword arguments shown; do not add, drop, or rename kwargs based on general Datadog knowledge.
  • Use a real edit tool for existing files (Edit/Write, not sed -i, awk, or scripted find/replace via Bash). If an edit-by-text-match fails, re-read the file first rather than retrying the identical edit.
  • Checklist discipline. Before starting the instrumentation steps, post a short checklist of the steps you're about to take. Check items off as you go, and review the checklist at the end of the run.
  • After any code change, check package.json for a lint:fix, fix, or format script (or eslint --fix / prettier --write config) and run it automatically — no need to ask permission.
  • Verify the app still builds/runs before declaring success (see references/common-verify-report.md).
  • LLM Observability session IDs propagate from the root span only. Never pass a session ID to a child span/decorator — see the "Adding spans" section in references/llmobs-python.md / references/llmobs-nodejs.md.
  • Don't promise what the environment doesn't support. If no RUM SDK is detected, don't claim RUM session linking; if no dd-agent is detected, don't claim navigable APM trace linking. State the gap and the upgrade path instead (see the "Beyond SDK init" section in the reference files).

Phase 1: Analysis

Inspect the relevant application directory before asking questions or editing files.

1a. Detecting the backend LLM/agent runtime
  • Python signals: requirements.txt, pyproject.toml, Pipfile, or *.py files → runtime python
  • Node.js signals: a backend entry point (server.js, index.js, an Express/Next.js/Fastify app) → runtime nodejs
  • If both exist (e.g. a Next.js app with a Python worker), instrument each backend runtime independently.
  • If neither is present, there is nothing to instrument — stop and tell the user.
1b. Detecting the LLM framework/SDK (optional, informational)

Check dependency files for signals of: openai, @anthropic-ai/sdk / anthropic, langchain, langgraph, ai (Vercel AI SDK), boto3 + Bedrock usage, google-generativeai / google-genai, crewai, litellm, pydantic-ai, an MCP SDK, google-adk. This doesn't change the init code (ddtrace/dd-trace auto-instruments these SDKs once the tracer is initialized) — it's only used for confirming the setup with the user and for special-cased frameworks noted in the reference files (Next.js, Vercel AI SDK).

1c. Detecting the backend application framework
  • Python: fastapi, flask, or django dependency
  • Node.js: express dependency, or next (Next.js API routes / server actions)
Show full SKILL.md (635 more words)Show less
1d. Detecting existing instrumentation, and auditing session-ID plumbing
  • Grep for ddtrace init (LLMObs.enable(, ddtrace-run) in Python, or dd-trace init (require('dd-trace').init(, dd-trace/initialize) in Node.js.
  • Also grep for a frontend RUM SDK (datadogRum.init(, @datadog/browser-rum) — not to set it up, but because its presence determines whether the opt-in RUM↔LLMObs pivot is available (that pivot reuses the RUM session ID as the LLMObs session ID).
  • If LLMObs init is already present, do not add a second enable/init call — but do not stop there. SDK presence only means "don't re-init"; it says nothing about whether a session ID actually flows. Run this audit whenever its prerequisite surfaces are present:
    • Session-ID plumbing — applicable whenever Phase 1a found an LLM/agent backend. Check whether a stable, conversation/operation-scoped session ID flows from the appropriate source: for web apps, the frontend sends a per-conversation ID and the backend request model/route reads it; for CLI/background jobs, the backend reuses an existing job/request/task ID or mints one UUID per invocation. A root agent/workflow span must then set it as session_id/sessionId (see "Beyond SDK init" and "Session ID intake by environment" in references/llmobs-python.md / references/llmobs-nodejs.md). LLMObs.enable()/dd-trace().init() alone does not establish this. If a RUM SDK is also present, the RUM↔LLMObs pivot is available as an opt-in — reusing the RUM session ID as the session_id — but that is a deliberate trade-off (the LLMObs session then spans the whole browser session), not the default; don't flag its absence as a gap.
    • If the check finds a gap, tell the user what's missing and fix it (same reference files, same ground rules) even though the SDK itself doesn't need re-initializing. If it passes, say so explicitly. Note the RUM pivot as not applicable rather than a gap when there's no RUM SDK.
1e. Detecting the dependency manifest to persist into

For each backend runtime found in 1a, identify the dependency manifest the build/deploy actually installs from. This is where any Datadog package you add (ddtrace/dd-trace) must be persisted so a clean deploy install includes it. It is not necessarily "whichever manifest file happens to exist": a repo can have several (e.g. an empty requirements.txt alongside a pyproject.toml, or multiple package.json files where only one is the deployed workspace), and editing a non-authoritative one is a silent no-op at deploy time.

Resolve it in this order:

  1. Deploy/build install command first (authoritative). Read the project's build/deploy configuration and use the install source it names: render.yaml (buildCommand), Procfile, Dockerfile (RUN … install …), Makefile, CI workflows, package.json scripts. Examples: pip install -r <file> → that requirements file; poetry install / uv sync / pdm install → pyproject.toml (+ its lockfile); pipenv install → Pipfile; npm ci / yarn install / pnpm i → package.json.
  2. Else, the highest-priority manifest present. Python: a lockfile-backed manager (uv.lock or poetry.lock → pyproject.toml) > pyproject.toml [project.dependencies]/[tool.poetry.dependencies] > requirements*.txt > Pipfile > setup.py/setup.cfg. Node.js: package.json (always).

Record the manifest path and the manager that owns it. Persisting commands (poetry add, uv add, pdm add, pipenv install, npm/yarn/pnpm/bun add) write the manifest. Non-persisting commands (pip install, uv pip install, conda install) touch only the current environment — with those you must also hand-edit the manifest. If requirements.txt is generated from a requirements.in (pip-tools), edit the .in and recompile. After hand-editing a manifest that has a lockfile, regenerate the lock so a frozen deploy install picks up the new package.


Phase 2: Instrumentation — routing table

Provision DD_API_KEY via references/common-credentials.md, then follow the reference for each backend runtime found in Phase 1a:

NeedRead
LLM Observability — Python (SDK init, spans, session ID, RUM/APM linking)references/llmobs-python.md
LLM Observability — Node.js / Next.js (SDK init, spans, session ID, RUM/APM linking)references/llmobs-nodejs.md

If Phase 1d found existing LLMObs instrumentation on a runtime, skip only that runtime's init/enable call and credential provisioning — still act on any gap the Phase 1d session-ID plumbing audit found, using the same reference files.


Phase 3: Verification and Reporting

See references/common-verify-report.md for the verify step and the JSON report shape.

© datadog-labs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in dd-instrument-llmo of datadog-labs/agent-skills.

  • SKILL.md
  • references/common-credentials.md
  • references/common-verify-report.md
  • references/llmobs-nodejs.md
  • references/llmobs-python.md

Open the folder on GitHubat commit d2411cc

Compare with similar skills

Dd Instrument Llmo next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dd Instrument Llmo compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dd Instrument Llmo this skilldatadog-labs/agent-skills177—~2.9kAutomated safety check: PassMIT
Databuddydatabuddy-analytics/Databuddy1.2k—~2.1kAutomated safety check: PassAGPL-3.0
Fullstack DevHHU3637kr/skills1453 repos~8.6kAutomated safety check: NotesMIT
Deploy To Tempsgotempsh/temps831—~1.3kAutomated safety check: NotesApache-2.0
Tech Stack Recommenderalirezarezvani/claude-cto-team117—~4.3kAutomated safety check: PassMIT
Env Managerbobmatnyc/claude-mpm156—~3.9kAutomated safety check: NotesCustom licence

Similar skills

  • Databuddy

    databuddy-analytics/Databuddy

    Integrate Databuddy analytics using the SDK, REST API, or MCP.

    1.2k GitHub stars~2.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Fullstack Dev

    HHU3637kr/skills

    Full-stack backend architecture and frontend-backend integration guide.

    145 GitHub starsUsed in 3 repos~8.6k tokens
    Backend & APIsAuto-check: notes
  • Deploy To Temps

    gotempsh/temps

    Deploy applications to the Temps platform with automatic framework detection, Dockerfile generation, and container orchestration.

    831 GitHub stars~1.3k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Tech Stack Recommender

    alirezarezvani/claude-cto-team

    Recommend technology stacks based on project requirements, team expertise, and constraints.

    117 GitHub stars~4.3k tokensUpdated 9 mo ago
    Backend & APIsAuto-check passed
  • Env Manager

    bobmatnyc/claude-mpm

    Environment variable validation, security scanning, and management for Next.js, Vite, React, and Node.js applications

    156 GitHub stars~3.9k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check: notes
  • Vercel Functions

    vercel/vercel-plugin

    Official

    Vercel Functions expert guidance — Node.js/Bun/Python runtimes, Fluid Compute, long-duration (30 min) functions, large functions (5 GB bundles), Docker/OCI container images, plan limits, streaming…

    301 GitHub stars~12k tokensUpdated today
    Backend & APIsAuto-check: notes

More from datadog-labs/agent-skills

All 39 skills in this repo
  • Bootstrap a reproducible LLM Observability experiment through the Python ddtrace SDK or the Node dd-trace SDK.

    177 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Dd Account Setup

    datadog-labs/agent-skills

    Ensure the user has an authenticated Datadog account with a valid DDAPIKEY on the right region before any Datadog setup or instrumentation.

    177 GitHub stars~4.5k tokensUpdated yesterday
    Auto-check: notes
  • Dd Orchestrator

    datadog-labs/agent-skills

    Entry point for Datadog onboarding. An agent skill from datadog-labs/agent-skills.

    177 GitHub stars~6.7k tokensUpdated yesterday
    Auto-check passed
  • Dd Apm

    datadog-labs/agent-skills

    APM - install, onboard, instrument, enable, set up, configure, traces, services, dependencies, performance analysis, Data Streams Monitoring (DSM), queue lag, pipeline latency.

    177 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Agent Install

    datadog-labs/agent-skills

    Install the Datadog Agent on Kubernetes using the Datadog Operator — required before enabling Single Step Instrumentation (SSI), which automatically instruments applications for APM without code…

    177 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check: warnings
  • Dd AWS Integration

    datadog-labs/agent-skills

    Set up the Datadog AWS integration with Terraform - creates the cross-account IAM role Datadog assumes (external ID, no stored credentials), attaches the permission policies Datadog publishes, and…

    177 GitHub stars~6.8k tokensUpdated yesterday
    Auto-check: notes

Questions about Dd Instrument Llmo

What does Dd Instrument Llmo do?

Instrument the current project with Datadog LLM Observability for Python or Node.js/Next.js backends that call LLMs or run AI agents. Dd Instrument Llmo is an agent skill from datadog-labs/agent-skills.js backends that call LLMs or run AI agents.

When should I use Dd Instrument Llmo?

Dd Instrument Llmo fits situations like: the user says instrument this project with LLM Observability; add LLM Observability; monitor my AI app in Datadog; add agent session tracking.

How do I install Dd Instrument Llmo in Claude Code?

Run `npx skills add datadog-labs/agent-skills --skill dd-instrument-llmo -a claude-code`. Or copy the skill folder (dd-instrument-llmo in datadog-labs/agent-skills) into .claude/skills/dd-instrument-llmo in your project. Claude Code loads it when a task matches its description.

How do I install Dd Instrument Llmo in Codex?

Run `npx skills add datadog-labs/agent-skills --skill dd-instrument-llmo -a codex`. Or copy the skill folder (dd-instrument-llmo in datadog-labs/agent-skills) into .agents/skills/dd-instrument-llmo in your project. Codex loads it when a task matches its description.

Can I use Dd Instrument Llmo in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add datadog-labs/agent-skills --skill dd-instrument-llmo -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dd-instrument-llmo, .gemini/skills/dd-instrument-llmo, .github/skills/dd-instrument-llmo and .opencode/skills/dd-instrument-llmo in your project.

What does Dd Instrument Llmo need to run?

Going by SKILL.md and its folder, Dd Instrument Llmo needs the command-line tools its instructions call (uv, pip, poetry, eslint, prettier and npm) and credentials named DD_API_KEY. Our summary lists: Python 3; Node.js; A credential in DD_API_KEY.

Does Dd Instrument Llmo access the network?

SKILL.md contains no URLs. Its commands use uv, pip and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Dd Instrument Llmo safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dd Instrument Llmo use?

Dd Instrument Llmo is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dd Instrument Llmo use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 10k tokens, read only when the agent opens those files.

What are the alternatives to Dd Instrument Llmo?

Skills that share tags, products or a category with Dd Instrument Llmo: Databuddy (databuddy-analytics/Databuddy, 1.2k stars), Fullstack Dev (HHU3637kr/skills, 145 stars), Deploy To Temps (gotempsh/temps, 831 stars) and Tech Stack Recommender (alirezarezvani/claude-cto-team, 117 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dd Instrument Llmo?

datadog-labs (a GitHub organization) maintains it in datadog-labs/agent-skills, which has 177 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on October 8, 2026.

Source: datadog-labs/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.