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
ddogctl apm spans search "service:worker @job.name:SyncJob" --field @messaging.destination
ddogctl apm spans search "service:mysql @duration:>1s" --format json   # full span: parent_id, tags, custom attrs
ddogctl apm trace 5501770330737245996                                  # span tree + root span

# 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.3.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.3.0
File Size Uploaded
ddogctl-2.3.0.tar.gz 213.3 kB Details

Built distribution (wheel)

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

Total release size: 285.2 kB

Release files / ddogctl-2.3.0.tar.gz

Download URL ddogctl-2.3.0.tar.gz
Size 213.3 kB
Tags Source
SHA-256 checksum
How to use checksums
92a7986f60ee2199f56f84cf58c6fa370168b96f49ac1dbf49f809cc8441524f
BLAKE2b-256 checksum
How to use checksums
4611579bec1b488de94ad28d846d35215ec318b899a501e6567257a8d79d5d42
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.3.0-py3-none-any.whl

Download URL ddogctl-2.3.0-py3-none-any.whl
Size 71.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
729dedbd8fcf2c9c168835ded27896a52c32a9051ac10cef089da191a4678d6e
BLAKE2b-256 checksum
How to use checksums
d258feed193793a15efeed8d41effaba0cc11a5bf3e8dfcd1949cf1b3586865a
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

This release

2.3.0 This release

2 release files

2.2.0

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