Index of every page on this site: llms.txt
All skills
datadog-labs avatar

/dd-instrument-llmo

@618fae3 official
Run it yourself

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".

Use this Skill: https://skilld.dev/gh/datadog-labs/agent-skills/dd-instrument-llmo

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescommon-credentials.md

≈517 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Credentials and API keys

Used by the LLM Observability reference files (llmobs-python.md / llmobs-nodejs.md). Use only the local tool named below — do not invent tool names.

API key (CreateApiKey)

DD_API_KEY is required for LLM Observability (dd-trace / ddtrace in agentless mode — see llmobs-python.md / llmobs-nodejs.md).

CreateApiKey(
  name: string  REQUIRED  — display name for the API key (e.g. "<project-folder-name> - LLM Observability")
)

On success it returns { apiKey, name }.

Ask the user to confirm before creating a new org-level API key on their behalf. If the call fails (e.g. insufficient scope), ask the user to create a key manually at https://app.datadoghq.com/organization-settings/api-keys and paste it in. Do not proceed until they confirm.

Never log or print the key value in your final report.

Provisioning DD_API_KEY into a local env file

Identify the env file

Scan the project root for env files in this order and use the first one found:

.env.local → .env.development.local → .env.development → .env

If none exist, choose which file to create based on framework:

  • Next.js or Create React App → create .env.local
  • All other projects → create .env

Check for an existing key

Use the first non-empty DD_API_KEY (or DATADOG_API_KEY) found, in this order:

  1. The chosen env file (if it exists): reuse it as is.
  2. The task environment: write it and its DD_SITE to the env file with printf 'DD_SITE=%s\nDD_API_KEY=%s\n' "${DD_SITE:-datadoghq.com}" "$DD_API_KEY" >> <env file>, so the value never appears in your output.
  3. Otherwise, create a key with CreateApiKey.

Write the key

Upsert DD_API_KEY=<key> into the file identified above (create it if needed). Preserve all existing lines — only add or replace the DD_API_KEY line.

If a .gitignore/global-ignore rule blocks you from writing directly to an env file, use shell redirection (echo "VAR=value" >> .env.local) instead of a file-write tool that respects ignore rules.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts13d3 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    This skill instruments projects with Datadog LLM Observability by installing official SDKs and configuring environment variables. It follows standard development practices for observability setup and credential management.

  • Socket14d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

Signed by skilld at 618fae3. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 2 months ago
Other metadata
metadata
{
  "version": "0.1.0",
  "author": "datadog-labs",
  "repository": "https://github.com/datadog-labs/agent-skills",
  "tags": "datadog,llm-observability,llmobs,instrumentation,python,nodejs,nextjs,ddtrace,dd-trace,agents",
  "alwaysApply": "false"
}

README badge

README badge for datadog-labs/agent-skills/dd-instrument-llmo