dd-apm

작성자: datadog-labs

APM - 트레이스, 서비스, 종속성, 성능 분석.

npx skills add https://github.com/datadog-labs/pup --skill dd-apm

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

MetricWhat It Measures
trace.http.request.hitsRequest count
trace.http.request.durationLatency
trace.http.request.errorsError count
trace.http.request.apdexUser satisfaction

⚠️ Trace Sampling

Not all traces are kept. Understand sampling:

ModeWhat's Kept
Head-basedRandom % at start
Error/SlowAll errors, slow traces
RetentionWhat's indexed (billed)

Trace Retention Costs

RetentionCost
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

GoalQuery
Slowest endpointspup traces aggregate --query="service:api" --compute="avg(@duration)" --group-by="resource_name" --from="1h"
Error rate by servicepup traces aggregate --query="status:error" --compute="count" --group-by="service" --from="1h"
Throughputpup 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

ProblemFix
No tracesCheck ddtrace installed, DD_TRACE_ENABLED=true
Missing serviceVerify DD_SERVICE env var
Traces not linkedCheck trace headers propagated
High cardinalityDon't tag with user_id/request_id
--env required errorAlways pass --env to apm services commands

References/Docs

datadog-labs의 다른 스킬

dd-audit
datadog-labs
감사 추적 조사 - 누가 무엇을 변경했는지, 키 손상, 비용 급증 근본 원인, 규정 준수 증거(SOC 2/PCI), AI 활동 감사.
official
agent-install
datadog-labs
Datadog Operator를 사용하여 Kubernetes에 Datadog Agent를 설치합니다 — Single Step Instrumentation(SSI)을 활성화하기 전에 필요하며, 이는 자동으로…
official
agent-observability-auto-experiment
datadog-labs
실제 Datadog LLM-Obs 데이터를 대상으로 반복적 코드 개선 힐클라임을 로컬에서 Claude Code를 에이전트로 사용하여 실행합니다. 기준 평가를 설정하고, 하나의…
official
agent-observability-eval-bootstrap
datadog-labs
프로덕션 트레이스에서 평가자를 부트스트랩합니다 — 기본적으로 온라인 LLM-판정 평가자를 제안하고, 확인 후 Datadog에 비활성화된 초안으로 생성합니다…
official
agent-observability-eval-pipeline
datadog-labs
계측된 ml_app을 위한 엔드투엔드 에이전트 관측성 파이프라인 — 프로덕션 트레이스를 분류하고, 실패의 근본 원인을 분석하며, 평가기를 부트스트랩한 다음, (선택적으로)…
official
agent-observability-experiment-analyzer
datadog-labs
LLM 실험 결과를 분석합니다. 단일 또는 비교 실험, 탐색적 또는 Q&A 모드를 처리합니다. 사용자가 "실험 분석", "비교…"라고 말할 때 사용하세요.
official
agent-observability-replay-trace
datadog-labs
개발자가 마음에 들지 않는 출력을 생성한 특정 Agent Observability / LLM Obs 트레이스 하나를 반복 작업하고자 할 때 사용합니다 — 해당 트레이스를 다시 실행하여…
official
agent-observability-trace-rca
datadog-labs
프로덕션 LLM 트레이스에 대한 근본 원인 분석. LLM 애플리케이션이 실패하는 이유를 진단하며, 평가 판정, 런타임 오류 또는 구조적 문제를 기반으로 작동합니다…
official