Agent Skill
Datadog APM (Datadog)
Routes Datadog APM requests to sub-skills for Kubernetes and Linux single-step instrumentation, service remapping and Data Streams Monitoring.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkInstall
Commands are pinned to commit c9195f8, the version we read, wherever the install method supports it.
npx skills
npx skills add datadog-labs/agent-skills@c9195f827f3aecf0dd18dc383f2572e278ad46b9 --skill dd-apm -a claude-codeCopies the skill into .claude/skills/ in this project, pinned to the reviewed commit.
Plugin marketplace
/plugin marketplace add datadog-labs/agent-skills
/plugin install agent-skills@datadog-labsRun inside Claude Code. Installs the whole agent-skills plugin from its default branch, not the pinned commit.
npx skills
npx skills add datadog-labs/agent-skills@c9195f827f3aecf0dd18dc383f2572e278ad46b9 --skill dd-apm -a codexInstalls to .agents/skills/, which Codex scans from the working directory up to the repo root.
npx skills
npx skills add datadog-labs/agent-skills@c9195f827f3aecf0dd18dc383f2572e278ad46b9 --skill dd-apm -a cursorInstalls to .agents/skills/, one of the folders Cursor reads skills from.
gh skill
gh skill install datadog-labs/agent-skills dd-apm --pin c9195f827f3aecf0dd18dc383f2572e278ad46b9 --agent github-copilotNeeds GitHub CLI 2.90.0 or later. Use --scope user to install for every repository.
npx skills
npx skills add datadog-labs/agent-skills@c9195f827f3aecf0dd18dc383f2572e278ad46b9 --skill dd-apmPinned to the commit we reviewed. The CLI asks which agents to install for; add -g to install for your user instead of this project.
What it does
Datadog’s entry point for APM work. The top of the SKILL.md is a router: Kubernetes installs, Linux single-host installs, service renaming and Data Streams Monitoring each send the agent to a sub-skill in a nested folder, with a warning about the wrong approach that looks right (for example, adding ddtrace imports when single-step instrumentation injects tracing without code changes, or renaming a service by changing DD_SERVICE instead of adding a remapping rule). Below the router is a reference for querying APM through Datadog’s pup CLI: listing services, service stats and maps, searching traces by service, errors or latency, and SLOs.
When to use it
Setting up APM on a cluster or VM for the first time, cleaning up messy service names, turning on queue monitoring, or asking an agent to find the slowest endpoints in a service you already trace.
When to skip it
If you do not use Datadog. Also be ready for some friction outside Claude Code: the router tells the agent to read sub-skills at hard-coded paths such as .claude/skills/dd-apm/k8s-ssi/agent-install/SKILL.md. In Codex, Cursor or Copilot the skill is installed under .agents/skills/, so the agent has to work out the right folder itself.
Try it
We run three services on an EKS cluster with no tracing yet. Set up Datadog
APM with single-step instrumentation for the "checkout" namespace only, using
env tag "staging". Show me each command before you run it.
Naming the environment matters: the skill tells the agent to confirm the env tag with you rather than assume production.
What it can touch
- Bundles scripts
- No
- Pre-approved tools
- None declared
- Needs
- Datadog account; Datadog's pup CLI; kubectl and Helm for Kubernetes installs
- Client-specific fields
- alwaysApply
claude.ai and the Claude API reject uploads that use fields outside the open spec or names containing "claude" or "anthropic", so this skill needs editing before you upload it there.
Its instructions steer what your agent does, and it may have changed since the commit we read. How to check a skill.
A lot, by design. Install sub-skills run the Datadog Agent install script or Helm and kubectl against your cluster, and pup queries your Datadog account with your credentials. Keep it on a staging environment until you trust it. The frontmatter sets alwaysApply: true, a Cursor rules habit outside the open spec, and the description is a list of keywords, so it may trigger on unrelated tracing questions.
At commit c9195f8 the SKILL.md is 187 lines long. Alongside it:
enable-dsm/(1 entry)k8s-ssi/(5 entries)linux-ssi/(5 entries)service-remapping/(1 entry)
Alternatives
LLM Observability instrumentation from the same repository covers LLM and agent apps specifically. For open-source tracing of LLM apps, see our add tracing to an LLM app workflow.
SKILL.md
The file exactly as published at the reviewed commit, reproduced under its MIT licence.
---
name: dd-apm
description: APM - install, onboard, instrument, enable, set up, configure, traces, services, dependencies, performance analysis, Data Streams Monitoring (DSM), queue lag, pipeline latency. Use for any request involving Datadog APM setup, instrumentation (SSI, ddtrace, agent install), or analysis.
alwaysApply: true
metadata:
version: "1.2.0"
author: datadog-labs
repository: https://github.com/datadog-labs/agent-skills
tags: datadog,apm,tracing,dsm,data-streams,performance,distributed-tracing,dd-apm,install,onboarding,instrumentation,ssi,agent
globs: "**/ddtrace*,**/datadog*.yaml,**/*trace*"
---
# Datadog APM
Distributed tracing, service maps, and performance analysis.
## Routing — Read This First
Match the user's request to one of the entries below. Each entry has the same shape: **triggers** → which sub-skill to load → the anti-pattern to avoid. If a request seems to fit more than one entry, see "Overlap disambiguation". If nothing matches, see "None of the above" at the end.
---
**Kubernetes APM install / instrument / onboard** — trigger when the user mentions Kubernetes, K8s, EKS, GKE, AKS, kind, minikube, K3s, helm, DatadogAgent CR, kubectl, SSI on a cluster, pod injection, or init containers.
**Immediately read** `.claude/skills/dd-apm/k8s-ssi/agent-install/SKILL.md` now, then `.claude/skills/dd-apm/k8s-ssi/enable-ssi/SKILL.md`, then `.claude/skills/dd-apm/k8s-ssi/verify-ssi/SKILL.md` — do not proceed from memory.
> **Common wrong approaches that LOOK like they work but silently fail:**
> - `helm install datadog datadog/datadog` — the standard chart does NOT support SSI via DatadogAgent CR.
> - Adding `ddtrace` imports or `ddtrace-run` to the app — SSI auto-instruments WITHOUT any code changes.
> - `admission.datadoghq.com/enabled` annotations — that's admission controller config injection, not SSI init container injection.
---
**Linux APM install / instrument / onboard** — trigger when the user mentions a single host, VM, EC2 instance, bare-metal, RHEL/Ubuntu/Debian, systemd, or no orchestrator.
**Immediately read** `.claude/skills/dd-apm/linux-ssi/agent-install/SKILL.md` now, then `.claude/skills/dd-apm/linux-ssi/enable-ssi/SKILL.md`, then `.claude/skills/dd-apm/linux-ssi/verify-ssi/SKILL.md` — do not proceed from memory.
> **Do NOT** install the agent via plain `apt-get install datadog-agent` (or yum equivalent) and assume SSI follows — host auto-instrumentation requires the install script with the SSI flags, which the sub-skill walks through.
---
**Service rename / service remapping** — trigger when the user mentions renaming a service, collapsing multiple service names, stripping suffixes/prefixes, or cleaning up inferred services.
**Immediately read** `.claude/skills/dd-apm/service-remapping/SKILL.md` now — do not proceed from memory.
> **Do NOT** change `tags.datadoghq.com/service` labels or `DD_SERVICE` env vars to rename a service in Datadog. That requires a rollout and only affects new data. Use a service remapping rule — it rewrites the name at ingestion time with no deployment change.
---
**Data Streams Monitoring (DSM) / queue and pipeline monitoring**: trigger when the user mentions data streams, DSM, consumer or queue lag, pipeline latency, end-to-end latency across queues, or monitoring Kafka / RabbitMQ / SQS / SNS / Kinesis / Pub/Sub flows between services.
**Immediately read** `.claude/skills/dd-apm/enable-dsm/SKILL.md` now. Do not proceed from memory.
> **Do NOT** install a separate DSM agent, package, or library. DSM runs in the Datadog SDK that APM already injected and is enabled with one setting per service. **Do NOT** enable it without first telling the user it is included with APM Pro and Enterprise and billed separately on base APM.
---
### Overlap disambiguation
When a request could plausibly fit more than one entry above, use these tiebreakers:
| Hint | Route to |
|---|---|
| Cluster orchestrator mentioned (EKS/GKE/AKS/kind/K3s/minikube) — even if "just one node" | k8s-ssi |
| Single host, VM, or EC2 with no orchestrator | linux-ssi |
| "Several services that should be one" | service-remapping — the sub-skill picks the rule type based on whether the duplicates are real instrumented services or inferred entities (DBs, queues, external APIs) |
| "My service shows under the wrong name" | First check `DD_SERVICE` on the deploy. If correct and the name is still wrong → service-remapping. |
| "Monitor Kafka" / "monitor my queues" | Ask whether they mean broker/cluster health (Kafka Console, an Agent check: https://docs.datadoghq.com/data_streams/kafka/setup/) or message flow between their services (enable-dsm) |
| "Reduce APM volume / cost / noise" | No sub-skill yet. Ask whether the user means sampling (fewer ingested traces) or retention filters (less indexed data) before suggesting commands. |
---
### None of the above
If the request doesn't match any entry above, continue reading the trace-search, service analysis, and metrics content below. If even that doesn't fit, **ask the user to clarify** — do not invent a workflow.
---
## Requirements
Datadog Labs Pup should be installed. See [Setup Pup](https://github.com/datadog-labs/agent-skills/tree/main?tab=readme-ov-file#setup-pup) if not.
## Command Execution Order (Token-Efficient)
For scoped commands, use this order:
1. Check context first (prior outputs, conversation, saved values).
2. If a required value is missing, run a discovery command first.
3. If still ambiguous, ask the user to confirm.
4. Then run the target command.
5. Avoid speculative commands likely to fail.
## Quick Start
```bash
pup auth login
# Confirm env tag with the user first (do not assume production/prod/prd).
pup apm services list --env <env> --from 1h --to now
pup traces search --query "service:api-gateway" --from 1h
```
## Services
### List Services
```bash
pup apm services list --env <env> --from 1h --to now
pup apm services stats --env <env> --from 1h --to now
```
### Service Stats
```bash
pup apm services stats --env <env> --from 1h --to now
```
### Service Map
```bash
# View dependencies
pup apm flow-map --query "service:api-gateway&from=$(($(date +%s)-3600))000&to=$(date +%s)000" --env <env> --limit 10
```
## Traces
### Search Traces
```bash
# By service
pup traces search --query "service:api-gateway" --from 1h
# Errors only
pup traces search --query "service:api-gateway status:error" --from 1h
# Slow traces (>1s)
pup traces search --query "service:api-gateway @duration:>1000ms" --from 1h
# With specific tag
pup traces search --query "service:api-gateway @http.url:/api/users" --from 1h
```
### Trace Detail
```bash
# No direct get command for a single trace ID.
# Use traces search with a narrow query and time window.
pup traces search --query "trace_id:<trace_id>" --from 1h
```
## Key Metrics
| Metric | What It Measures |
|--------|------------------|
| `trace.http.request.hits` | Request count |
| `trace.http.request.duration` | Latency |
| `trace.http.request.errors` | Error count |
| `trace.http.request.apdex` | User satisfaction |
## Service Level Objectives
Link APM to SLOs:
```bash
pup slos create --file slo.json
```
## Common Queries
| Goal | Query |
|------|-------|
| Slowest endpoints | `avg:trace.http.request.duration{*} by {resource_name}` |
| Error rate | `sum:trace.http.request.errors{*} / sum:trace.http.request.hits{*}` |
| Throughput | `sum:trace.http.request.hits{*}.as_rate()` |
## Troubleshooting
| Problem | Fix |
|---------|-----|
| No traces | Check ddtrace installed, DD_TRACE_ENABLED=true |
| Missing service | Verify DD_SERVICE env var |
| Traces not linked | Check trace headers propagated |
| High cardinality | Don't tag with user_id/request_id |
## References/Docs
- [APM Setup](https://docs.datadoghq.com/tracing/)
- [Trace Search](https://docs.datadoghq.com/tracing/trace_explorer/)Related skills
LLM Observability instrumentation (Datadog)
Adds Datadog LLM Observability to a Python or Node.js app that calls LLMs: detects the stack, adds SDK setup and checks session IDs flow through.
Deploy to Vercel (Vercel)
Works out whether a project is linked to Vercel and has a Git remote, then deploys by git push, vercel deploy or a temporary no-account deploy.
Devcontainer setup (Trail of Bits)
Writes a .devcontainer/ for your project with Claude Code, Python, Node, Rust or Go tooling and persistent volumes, so an agent can work inside a container.
Guides and recipes that use Datadog APM (Datadog)
- Skill description best practices: write descriptions that trigger
The description decides when a skill loads. Fix skills that fire too often or never trigger, with before and after examples and a prompt set to test them.
- LLM observability
Tracing requests, tokens, latency and cost in AI applications running in production.
- Trace
A record of every step in one AI request or agent run: prompts, model responses, tool calls, retrieved context, tokens, timing and cost.