Loading...
Loading...
APM - traces, services, dependencies, performance analysis.
npx skill4agent add datadog-labs/agent-skills dd-apmgo install github.com/datadog-labs/pup@latestpup auth login
pup apm services list
pup apm traces list --service api-gateway --duration 1hpup apm services list
pup apm services list --env productionpup apm services get api-gateway --json# View dependencies
pup apm service-map --service api-gateway --json# By service
pup apm traces list --service api-gateway --duration 1h
# Errors only
pup apm traces list --service api-gateway --status error
# Slow traces (>1s)
pup apm traces list --service api-gateway --min-duration 1000ms
# With specific tag
pup apm traces list --query "@http.url:/api/users"pup apm traces get <trace_id> --json| Metric | What It Measures |
|---|---|
| Request count |
| Latency |
| Error count |
| User satisfaction |
| Mode | What's Kept |
|---|---|
| Head-based | Random % at start |
| Error/Slow | All errors, slow traces |
| Retention | What's indexed (billed) |
# Check retention filters
pup apm retention-filters list| Retention | Cost |
|---|---|
| Indexed spans | $$$ per million |
| Ingested spans | $ per million |
pup slos create \
--name "API Latency p99 < 200ms" \
--type metric \
--numerator "sum:trace.http.request.hits{service:api,@duration:<200000000}" \
--denominator "sum:trace.http.request.hits{service:api}" \
--target 99.0| Goal | Query |
|---|---|
| Slowest endpoints | |
| Error rate | |
| Throughput | |
| 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 |