Skip to main content

ddogctl

A modern CLI for the Datadog API. Like Dogshell, but better.

Features

  • Rich terminal output with tables, colors, and progress bars
  • APM trace search and service listing
  • Log querying with trace correlation
  • Database monitoring (DBM) for slow queries and execution plans
  • Investigation workflows that correlate across monitors, traces, logs, and hosts
  • Retry logic with exponential backoff
  • Region shortcuts (us, eu, us3, us5, ap1, gov)

ddogctl vs Dogshell

Feature ddogctl Dogshell
Rich terminal output Yes No
APM traces Yes No
Log search + correlation Yes No
Database monitoring Yes No
Investigation workflows Yes No
Retry with backoff Yes No
Active maintenance Yes Deprecated

Installation

pip install ddogctl

Or with pipx:

pipx install ddogctl

Or with uv:

uv pip install ddogctl

Configuration

Set the required environment variables:

export DD_API_KEY="your-api-key"
export DD_APP_KEY="your-app-key"
export DD_SITE="us"  # optional, defaults to datadoghq.com

Personal Access Tokens

ddogctl also accepts a Datadog Personal Access Token (PAT). A PAT is scoped to your user and expires, so you don't need an API key for most commands:

export DD_PAT="ddpat_..."
# or save it in a profile
ddogctl config init --auth pat
ddogctl config set-profile work --pat ddpat_... --site eu

A ddpat_ value in DD_APP_KEY is detected as a PAT too. Commands that send data to Datadog (event post, service-check post) still need DD_API_KEY alongside the PAT.

Region Shortcuts

Shortcut Site
us datadoghq.com
eu datadoghq.eu
us3 us3.datadoghq.com
us5 us5.datadoghq.com
ap1 ap1.datadoghq.com
gov ddog-gov.com

Quick Start

# Monitors
ddogctl monitor list --state Alert
ddogctl monitor get 12345

# Metrics
ddogctl metric query "avg:system.cpu.user{env:prod}" --from 1h
ddogctl metric search "cpu"

# Events
ddogctl event list --from 1d --priority normal
ddogctl event post "Deployment" "v2.1.0 deployed to prod"

# Hosts
ddogctl host list --filter "env:prod"
ddogctl host info web-prod-01

# APM
ddogctl apm services
ddogctl apm traces my-service --from 1h

# Logs
ddogctl logs search "status:error" --service my-api --from 30m
ddogctl logs tail "env:prod" --follow

# Database Monitoring
ddogctl dbm slow-queries --service postgres-prod --from 1h
ddogctl dbm explain "SELECT * FROM users WHERE id = 1"

# Investigation Workflows
ddogctl investigate service my-api --from 1h
ddogctl investigate host web-prod-01 --from 30m

Contributing

See CONTRIBUTING.md for setup instructions and development guidelines.

License

MIT

Metadata

Release files for ddogctl 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ddogctl 2.2.0
File Size Uploaded
ddogctl-2.2.0.tar.gz 207.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ddogctl 2.2.0
File Interpreter ABI Platform
ddogctl-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 276.9 kB

Release files / ddogctl-2.2.0.tar.gz

Download URL ddogctl-2.2.0.tar.gz
Size 207.9 kB
Tags Source
SHA-256 checksum
How to use checksums
28c186aa1f8805802cc92027e18d46daf0db418885440998e63bcd97378ee5e0
BLAKE2b-256 checksum
How to use checksums
933e522e0433b5fbb7eb65d06b8caba690d03bd010de4f781af4277cdd7fcafb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / ddogctl-2.2.0-py3-none-any.whl

Download URL ddogctl-2.2.0-py3-none-any.whl
Size 69.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
139dae301261a272061e073de2a0f89045f1de7cd98e370f1167231f1eae19af
BLAKE2b-256 checksum
How to use checksums
2a82f2301c0a53b68ab5eac6eddcb733f450a0df3cc94327f13981d9ce9a1182
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

2.4.1

2 release files

2.4.0

2 release files

2.3.0

2 release files

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page