dd-pup

CLI Datadog (pup). Xác thực OAuth2 với làm mới token.

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

pup (Datadog CLI)

Pup CLI for Datadog API operations. Supports OAuth2 and API key auth.

Quick Reference

TaskCommand
Search error logspup logs search --query "status:error" --from 1h
List monitorspup monitors list
Create downtimepup downtime create --file downtime.json
Find slow tracespup traces search --query="@duration:>500000000" --from="1h"
List incidentspup incidents list
Query metricspup metrics query --query "avg:system.cpu.user{*}"
List hostspup infrastructure hosts list
Check SLOspup slos list
On-call teamspup on-call teams list
Security signalspup security signals list --query "*" --from 24h
Inspect runtime valuespup debugger probes create --service my-svc --env prod --probe-location "com.example.MyClass:myMethod" or "com.example.MyClass:myMethod(String, int)"
Find probe-able methodspup symdb search --service my-svc --query MyController --view probe-locations
Check authpup auth status
Refresh tokenpup auth refresh

Prerequisites

# Install pup via Homebrew (recommended)
brew tap datadog-labs/pack
brew install pup

Auth

pup auth login          # OAuth2 browser flow (recommended)
pup auth status         # Check token validity
pup auth refresh        # Refresh expired token (no browser)
pup auth logout         # Clear credentials

⚠️ Tokens expire (~1 hour). If a command fails with 401/403 mid-conversation:

pup auth refresh        # Try refresh first
pup auth login          # If refresh fails, full re-auth

Headless/CI (no browser)

# Use env vars or:
export DD_API_KEY=your-api-key
export DD_APP_KEY=your-app-key
export DD_SITE=datadoghq.com    # or datadoghq.eu, etc.

Command Reference

Monitors

pup monitors list --limit 10
pup monitors list --tags "env:prod"
pup monitors get 12345
pup monitors search --query "High CPU"
pup monitors create --file monitor.json
pup monitors update 12345 --file monitor.json
pup monitors delete 12345

Logs

pup logs search --query "status:error" --from 1h
pup logs search --query "service:payment-api" --from 1h --limit 100
pup logs search --query "@http.status_code:5*" --from 24h
pup logs aggregate --query "service:api" --compute count --from 1h

Metrics

pup metrics query --query "avg:system.cpu.user{*}" --from 1h
pup metrics query --query "sum:trace.express.request.hits{service:api}" --from 1h
pup metrics list --filter "system.*"

APM / Services

pup apm services list --env production
pup apm services stats --env production
pup apm services operations --env production --service my-service
pup apm services resources --env production --service my-service --name http.request
pup apm dependencies list --env production

Traces

# Search traces (duration in nanoseconds: 1s = 1000000000)
pup traces search --query="service:api-gateway" --from="1h"
pup traces search --query="service:api @duration:>1000000000" --from="1h"
pup traces search --query="service:api status:error" --from="1h"
pup traces aggregate --query="service:api" --compute="avg(@duration)" --group-by="resource_name" --from="1h"

Incidents

pup incidents list
pup incidents list --limit 20
pup incidents get <incident-id>

Dashboards

pup dashboards list
pup dashboards get abc-123
pup dashboards create --file dashboard.json
pup dashboards update abc-123 --file dashboard.json
pup dashboards delete abc-123

SLOs

pup slos list
pup slos get slo-123
pup slos status slo-123 --from 30d --to now
pup slos create --file slo.json

Synthetics

pup synthetics tests list
pup synthetics tests get abc-123
pup synthetics tests search --text "login"
pup synthetics locations list

Downtimes

pup downtime list
pup downtime get abc-123-def
pup downtime create --file downtime.json
pup downtime cancel abc-123-def

Infrastructure / Hosts

pup infrastructure hosts list
pup infrastructure hosts list --filter "env:prod"
pup infrastructure hosts list --count 100
pup infrastructure hosts get <host-id>

Events

pup events list --from 24h
pup events list --tags "source:deploy" --from 24h
pup events search --query "deploy" --from 24h
pup events get <event-id>

Users / Teams

pup users list
pup users get <user-id>
pup on-call teams list
pup on-call teams get <team-id>

Security

pup security signals list --query "*" --from 24h
pup security signals list --query "severity:critical" --from 24h
pup security rules list

Live Debugger

# Check service context (verify env has active instances)
pup debugger context my-svc
pup debugger context my-svc --env prod

# Find probe-able methods in a service
pup symdb search --service my-svc --query MyController --view probe-locations

# Place a log probe with capture expressions
# --probe-location accepts TYPE:METHOD or TYPE:METHOD(arg1, arg2, ...) with optional signature
pup debugger probes create --service my-svc --env prod \
  --probe-location "com.example.MyController:handleRequest" \
  --capture "request.id" --capture "request.headers" \
  --ttl 1h

# With method signature (useful when the method is overloaded)
pup debugger probes create --service my-svc --env prod \
  --probe-location "com.example.MyController:handleRequest(String, HttpHeaders)" \
  --capture "request.id" --ttl 1h

# Watch probe events — compact output
pup debugger probes watch <PROBE_ID> --fields "message,captures,timestamp" --timeout 60 --limit 10 --wait 5

# Watch — template message only
pup debugger probes watch <PROBE_ID> --fields "message" --limit 10

# List and delete probes
pup debugger probes list --service my-svc
pup debugger probes delete <PROBE_ID>

Service Catalog

pup service-catalog list
pup service-catalog get <service-name>

Notebooks

pup notebooks list
pup notebooks get 12345
pup notebooks create --file notebook.json

Observability Pipelines

pup obs-pipelines list
pup obs-pipelines get <pipeline-id>
pup obs-pipelines create --file pipeline.json
pup obs-pipelines update <pipeline-id> --file pipeline.json
pup obs-pipelines delete <pipeline-id>
pup obs-pipelines validate --file pipeline.json

LLM Observability

pup llm-obs projects list
pup llm-obs projects create --file project.json
pup llm-obs experiments list
pup llm-obs experiments list --filter-project-id <project-id>
pup llm-obs experiments list --filter-dataset-id <dataset-id>
pup llm-obs experiments create --file experiment.json
pup llm-obs experiments update <experiment-id> --file experiment.json
pup llm-obs experiments delete --file delete-request.json
pup llm-obs datasets list --project-id <project-id>
pup llm-obs datasets create --project-id <project-id> --file dataset.json

Reference Tables

pup reference-tables list
pup reference-tables get <table-id>
pup reference-tables create --file table.json
pup reference-tables batch-query --file query.json

Cost Cloud Configs

# AWS CUR configs
pup costs datadog aws-config list
pup costs datadog aws-config get <account-id>
pup costs datadog aws-config create --file config.json
pup costs datadog aws-config delete <account-id>

# Azure UC configs
pup costs datadog azure-config list
pup costs datadog azure-config get <account-id>
pup costs datadog azure-config create --file config.json
pup costs datadog azure-config delete <account-id>

# GCP usage cost configs
pup costs datadog gcp-config list
pup costs datadog gcp-config get <account-id>
pup costs datadog gcp-config create --file config.json
pup costs datadog gcp-config delete <account-id>

Subcommand Discovery

pup --help              # List all commands
pup <command> --help    # Command-specific help

Error Handling

ErrorCauseFix
401 UnauthorizedToken expiredpup auth refresh
403 ForbiddenMissing scopeCheck app key permissions
404 Not FoundWrong ID/resourceVerify resource exists
Rate limitedToo many requestsAdd delays between calls

Install

# Homebrew (recommended)
brew tap datadog-labs/pack
brew install pup

# Or build from source
cargo install --git https://github.com/DataDog/pup

Verify Installation

pup --version
pup auth status

Sites

SiteDD_SITE value
US1 (default)datadoghq.com
US3us3.datadoghq.com
US5us5.datadoghq.com
EU1datadoghq.eu
AP1ap1.datadoghq.com
US1-FEDddog-gov.com

Thêm skills từ datadog-labs

agent-install
datadog-labs
agent-install — một kỹ năng có thể cài đặt cho các tác nhân AI, được phát hành bởi datadog-labs/agent-skills.
official
agent-skills
datadog-labs
Kỹ năng Datadog cho các tác nhân AI. Giám sát, ghi nhật ký, theo dõi và quan sát thiết yếu.
official
dd-apm
datadog-labs
APM - cài đặt, triển khai, tích hợp, kích hoạt, thiết lập, cấu hình, traces, services, dependencies, phân tích hiệu suất. Sử dụng cho bất kỳ yêu cầu nào liên quan đến Datadog APM…
official
dd-audit
datadog-labs
Điều tra dấu vết kiểm toán - ai đã thay đổi cái gì, xâm phạm khóa, nguyên nhân gốc rễ của sự tăng vọt chi phí, bằng chứng tuân thủ (SOC 2/PCI) và kiểm toán hoạt động AI.
official
dd-audit-ai-activity
datadog-labs
Kiểm tra những gì trợ lý Bits AI (máy chủ MCP) đã thực hiện trong tổ chức Datadog của bạn — các lệnh gọi công cụ theo người dùng, tài nguyên đã truy cập và cờ bất thường cho quản trị AI.
official
dd-audit-compliance-report
datadog-labs
Tạo bằng chứng tuân thủ sẵn sàng cho kiểm toán viên từ Datadog Audit Trail cho SOC 2 và PCI DSS. Ánh xạ các kiểm soát khung đến các mẫu truy vấn cụ thể và tạo ra…
official
dd-audit-cost-spike-investigation
datadog-labs
Điều tra sự gia tăng đột biến về mức sử dụng hoặc chi phí sản phẩm Datadog bằng cách đối chiếu dữ liệu Đo lường Mức sử dụng (khi nào/cái gì tăng đột biến) với Nhật ký Kiểm toán các thay đổi cấu hình (ai đã thay đổi cái gì trong…
official
dd-audit-key-compromise
datadog-labs
Điều tra một khóa API Datadog có khả năng bị xâm phạm — dòng thời gian các hành động, phân tích địa lý/IP, các điểm cuối được gọi, cờ bất thường và các bước khắc phục.
official