Skip to content

/dd-apm

APM - traces, services, dependencies, performance analysis.

From plugin
pup
1k12 skills50 agents

Claude Code

$ npx -y skills add DataDog/pup --skill dd-apm --agent claude-code

SKILL.md

dd-apm.SKILL.md
name: dd-apm
description: APM - traces, services, dependencies, performance analysis.
metadata:
  version: "1.0.0"
  author: datadog-labs
  repository: https://github.com/datadog-labs/agent-skills
  tags: datadog,apm,tracing,performance,distributed-tracing,dd-apm
  globs: "**/ddtrace*,**/datadog*.yaml,**/*trace*"
  alwaysApply: "false"

Datadog APM

Distributed tracing, service maps, and performance analysis.

Requirements

Datadog Labs Pup should be installed via:

brew tap datadog-labs/pack
brew install pup

Quick Start

pup auth login
pup apm services list --env production
pup traces search --query="service:api-gateway" --from="1h"

Services

List Services

`--env` is **required** for all `apm services` commands.

pup apm services list --env production
pup apm services list --env staging

Service Statistics

pup apm services stats --env production
pup apm services stats --env production --from 4h

Service Operations and Resources

# List operations for a service
pup apm services operations --env production --service api-gateway

# List resources (endpoints) for an operation
pup apm services resources --env production --service api-gateway --name http.request

Service Dependencies

pup apm dependencies list --env production

Flow Map

# View service flow map (--query and --env required)
pup apm flow-map --query "service:api-gateway" --env production

Traces

Traces are searched via the top-level `traces` command (not under `apm`).

**Important:** APM durations are in **nanoseconds**: 1 second = 1,000,000,000 ns.

Search Traces

# 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 (>1 second = 1000000000 ns)
pup traces search --query="service:api-gateway @duration:>1000000000" --from="1h"

# With specific tag
pup traces search --query="service:api @http.url:/api/users" --from="1h"

Aggregate Traces

# Average duration by resource
pup traces aggregate \
  --query="service:api-gateway" \
  --compute="avg(@duration)" \
  --group-by="resource_name" \
  --from="1h"

# Error count by service
pup traces aggregate \
  --query="status:error" \
  --compute="count" \
  --group-by="service" \
  --from="1h"

# p99 latency
pup traces aggregate \
  --query="service:api-gateway" \
  --compute="percentile(@duration, 99)" \
  --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 |

⚠️ Trace Sampling

**Not all traces are kept.** Understand sampling:

| Mode | What's Kept | |------|-------------| | **Head-based** | Random % at start | | **Error/Slow** | All errors, slow traces | | **Retention** | What's indexed (billed) |

Trace Retention Costs

| Retention | Cost | |-----------|------| | Indexed spans | $$$ per million | | Ingested spans | $ per million |

**Best practice:** Only index what you need for search.

Service Level Objectives

Link APM to SLOs:

pup slos create --file slo.json

Common Queries

| Goal | Query | |------|-------| | Slowest endpoints | `pup traces aggregate --query="service:api" --compute="avg(@duration)" --group-by="resource_name" --from="1h"` | | Error rate by service | `pup traces aggregate --query="status:error" --compute="count" --group-by="service" --from="1h"` | | Throughput | `pup traces aggregate --query="service:api" --compute="count" --group-by="resource_name" --from="1h"` |

Service Config

Query service instance metadata — instance IDs, hostnames, and config IDs for all running instances of a service. Returns up to 100 instances.

# Get instance metadata for a service
pup apm service-config get --service-name my-service

# Filter by environment
pup apm service-config get --service-name my-service --env prod

# Filter by specific instance IDs
pup apm service-config get --service-name my-service --service-instance-ids "id-1,id-2"

> **Note on service identity:** `service_name` and `env` come from the SDK telemetry > pipeline and may differ from values in the Service Catalog.

Service Library Config

Query the APM tracer configuration deployed across all running instances of a service. Useful for auditing config drift — finding instances where tracing, profiling, or AppSec is misconfigured relative to the rest of the fleet.

# Get tracer config for a service
pup apm service-library-config get --service-name my-service

# Filter by environment
pup apm service-library-config get --service-name my-service --env prod

# Filter by language
pup apm service-library-config get --service-name my-service --env prod --language python

# Only show configs where instances disagree (config drift)
pup apm service-library-config get --service-name my-service --mixed

> **Note on service identity:** `service_name`, `env`, and `language_name` come from the > SDK telemetry pipeline and reflect what the tracer reports at runtime. These may differ > from values in the Service Catalog, which aggregates data from multiple sources (APM > spans, USM, infrastructure tags, manual definitions).

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 | | `--env` required error | Always pass `--env` to `apm services` commands |

References/Docs

  • [APM Setup](https://docs.datadoghq.com/tracing/)
  • [Trace Search](https://docs.datadoghq.com/tracing/trace_explorer/)
  • [Retention Filters](https://docs.datadoghq.com/tracing/trace_pipeline/
Read more
@datadog
Ships withpup

Every AI agent needs a loyal companion. Meet Pup — the CLI that gives your agents full access to Datadog's observability platform (because even autonomous agents need good tooling, not just tricks).

Stars on GitHub

Momentum

stars in total
1.0k
Star history of DataDog/pup on GitHub, a chart by star-history.com

Other skills on pup.

dd-code-generation
Auto-invoked

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications

@datadog@datadogInstall Skill
dd-debugger
Auto-invoked

dd-debugger

Live Debugger - inspect runtime argument/variable values in production by placing log probes on methods. Use when asked what…

@datadog@datadogInstall Skill
dd-docs
Auto-invoked

dd-docs

Datadog docs lookup using docs.datadoghq.com/llms.txt and linked Markdown pages.

@datadog@datadogInstall Skill
dd-file-issue
Auto-invoked

dd-file-issue

File GitHub issues to the right repository (pup CLI or plugin)

@datadog@datadogInstall Skill
dd-idp
Auto-invoked

dd-idp

Find, filter, count, and connect software, teams, engineering work and delivery, infrastructure, and operational or security…

@datadog@datadogInstall Skill
dd-logs
Auto-invoked

dd-logs

Log management - search, pipelines, archives, and cost control.

@datadog@datadogInstall Skill

More skills from other plugins.

agentdb-advanced

agentdb-advanced

Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid…

ruview10d102k
@ruvnet@ruvnetInstall Skill
install

install

Kubeshark installation and deployment skill. Use this skill whenever the user wants to install Kubeshark, deploy Kubeshark to a…

@kubeshark@kubesharkInstall Skill
scan

scan

Scan a project with sentrux to get structural health grades (A-F) across 14 dimensions including coupling, cycles, cohesion, dead…

sentrux7mo3.3k
@sentrux@sentruxInstall Skill
phone-input

phone-input

Call the user on the phone for real-time voice conversations. Use this when you need input, want to report on completed work, or…

callme7mo2.7k
@zeframlou@zeframlouInstall Skill

Questions about dd-apm.

Which coding agents can use dd-apm?
dd-apm installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.