Quick Start

Get up and running with dtctl in under five minutes.

1. Authenticate

Uses your Dynatrace SSO credentials – no token management needed:

dtctl auth login --context my-env --environment "https://abc12345.apps.dynatrace.com"

This opens your browser for login. Tokens are stored securely and refreshed automatically.

Token-Based Auth (CI/CD)

For headless environments, use a platform API token:

dtctl config set-context my-env \
  --environment "https://abc12345.apps.dynatrace.com" \
  --token-ref my-token

dtctl config set-credentials my-token \
  --token "dt0s16.XXXXXXXX.YYYYYYYY"

See Configuration for details on creating tokens and managing multiple environments.

2. Verify Setup

dtctl doctor

This checks connectivity, authentication, and API permissions.

3. Common Commands

List resources

dtctl get workflows
dtctl get dashboards
dtctl get slos

Query with DQL

dtctl query "fetch logs | limit 10"

Apply configuration from YAML

dtctl apply -f workflow.yaml

Output as JSON

dtctl get dashboards -o json

Execute a workflow and wait for results

dtctl exec workflow "Daily Health Check" --wait --show-results

Ask Davis CoPilot

dtctl exec copilot nl2dql "error logs from last hour"

What’s Next?

  • Configuration – multiple environments, safety levels, aliases
  • Individual resource guides for workflows, dashboards, DQL, SLOs, and more