Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e1d9ab8
Add DynamicD ddev tool
mahipdeora25 Dec 18, 2025
bbf7c9e
Remove all emojis from DynamicD output messages
mahipdeora25 Jan 12, 2026
d061e8d
Update DynamicD implementation
mahipdeora25 Jan 12, 2026
8b69120
Add org validation and env:dynamicd tag requirements
mahipdeora25 Jan 14, 2026
1de397e
Fix org validation to handle multi-org accounts and add debug output
mahipdeora25 Jan 14, 2026
e23e897
Add ANTHROPIC_API_KEY env var fallback for LLM key
mahipdeora25 Jan 14, 2026
f1701e4
Update DynamicD executor, generator, and prompts
mahipdeora25 Jan 14, 2026
f34398e
Update DynamicD cli, constants, and executor
mahipdeora25 Jan 14, 2026
7e2ab0e
Update DynamicD
mahipdeora25 Jan 14, 2026
e48aa7a
Update DynamicD prompts
mahipdeora25 Jan 14, 2026
5134f80
Add changelog for DynamicD
mahipdeora25 Jan 14, 2026
d64ad07
Fix formatting
mahipdeora25 Jan 14, 2026
68e648b
Fix mypy type errors in DynamicD
mahipdeora25 Jan 14, 2026
a73a7eb
Fix filter tag extraction for non-grouped metrics
mahipdeora25 Jan 14, 2026
1ce3ac6
Extract specific tag VALUES from dashboard queries for bulletproof da…
mahipdeora25 Jan 15, 2026
a03098f
Add --all-metrics flag and log generation support
mahipdeora25 Jan 15, 2026
0388427
Extract log source/service from dashboard queries for correct log fil…
mahipdeora25 Jan 15, 2026
3e54cc7
Address README feedback from docs and engineer review
mahipdeora25 Jan 15, 2026
2f65a35
Fix mypy type errors and add context_builder unit tests
mahipdeora25 Jan 15, 2026
99bc92e
Add cassandra and celery integration tests for context_builder
mahipdeora25 Jan 15, 2026
f4119b4
Update ddev/src/ddev/cli/meta/scripts/dynamicd/README.md
mahipdeora25 Jan 15, 2026
d3241d2
Add Docker sandbox mode for script execution
mahipdeora25 Jan 16, 2026
a3a0a25
Add note about starting Docker Desktop for sandbox mode
mahipdeora25 Jan 16, 2026
826074f
Fix mypy type errors for dashboard_log_config return type
mahipdeora25 Jan 16, 2026
6359a3f
Fix celery test - use correct metric prefix (celery.flower.)
mahipdeora25 Jan 16, 2026
9fbc2df
Refactor tests to use pytest parametrization
mahipdeora25 Jan 16, 2026
112a848
Install dependencies via shell in container sandbox
mahipdeora25 Jan 20, 2026
5bb8c6c
Make sandbox mode default, require explicit --no-sandbox to disable
mahipdeora25 Jan 20, 2026
938424c
Update ddev/src/ddev/cli/meta/scripts/dynamicd/README.md
mahipdeora25 Jan 20, 2026
5bc14c6
Remove textual dependency (TUI deferred)
mahipdeora25 Jan 21, 2026
1ac2a9a
Address PR review feedback for DynamicD
mahipdeora25 Jan 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ddev/changelog.d/22328.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add DynamicD tool for generating realistic fake telemetry data using AI
1 change: 1 addition & 0 deletions ddev/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ classifiers = [
"Programming Language :: Python :: 3.13",
]
dependencies = [
"anthropic>=0.18.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: can we have this dependency on a separate feature, i.e. optional-dependencies under ai or something like that? Not sure how bit it is but most of the users might not actually need this and if it is a client it might be a lot of boiler plate we can avoid.

You can then load the command only if the library exist. That way if ddev is installed without the ai feature, the command would not even be visible.

I am marking this as a suggestion though, I am not sure the impact of this but maybe worth considering.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a follow up on this comment (as requested offline). The issue I am trying to address with the comment is not startup time when importing it, is installation overhead for people that won't use this command (one of the reasons why we mentioned we could have this being a ddev plugin).

We install ddev every time we open a PR in the repo and that pulls all its dependencies. For a dependency that exist to serve a single command, having it being a global dependency when we are never going to use that command in CI seems a bit too much. If this dependency was an option dependency declared as

[project.optional-dependencies]
ai = [
    "anthropic>=0.18.0"
]

If you want ddev to have that command you just install it as pipx install ddev[ai] and it will pull that dependency as well. We can avoid installing it in CI. You can even deefine the command to only exist if the dependency is there, since we won't be able to run without it. Instead of failing without this dependency the commadn would not even show.

When loading the command one could do

if importlib.util.find_spec("anthropic"):
    from ddev.cli.meta.scripts.monitor import monitor
    scripts.add_command(monitor)

The importlib import is free, it is part of the bootstrap and the find_spec is a lookup on table so this has negligible impact on the end user but running ddev meta scripts --help won't even show the monitor command if the dependency is not installed.

Again, this is not a hard requirement because I checked and the anthropic dependency is less than half a megabyte

curl -s https://pypi.org/pypi/anthropic/json | jq '.urls[] | {filename, size, type: .packagetype}'
{
  "filename": "anthropic-0.76.0-py3-none-any.whl",
  "size": 390309,
  "type": "bdist_wheel"
}
{
  "filename": "anthropic-0.76.0.tar.gz",
  "size": 495483,
  "type": "sdist"
}

But worth considering.

"click~=8.1.6",
"coverage",
"datadog-api-client==2.20.0",
Expand Down
2 changes: 2 additions & 0 deletions ddev/src/ddev/cli/meta/scripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from datadog_checks.dev.tooling.commands.meta.scripts.metrics2md import metrics2md
from datadog_checks.dev.tooling.commands.meta.scripts.remove_labels import remove_labels

from ddev.cli.meta.scripts.dynamicd import dynamicd
from ddev.cli.meta.scripts.generate_metrics import generate_metrics
from ddev.cli.meta.scripts.monitor import monitor
from ddev.cli.meta.scripts.saved_views import sv
Expand All @@ -21,6 +22,7 @@ def scripts():
"""


scripts.add_command(dynamicd)
scripts.add_command(email2ghuser)
scripts.add_command(generate_metrics)
scripts.add_command(metrics2md)
Expand Down
102 changes: 102 additions & 0 deletions ddev/src/ddev/cli/meta/scripts/_dynamicd/README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request: this will be completely invisible for anyone using this command. If you want full visibility add it to the docs here. If you think this is more an internal tool, which I guess it is because it is part of meta/scripts. Add a link to the long command help to allow people that want to know more about this and redirect them to this README file in master.

Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# DynamicD

Generate realistic fake telemetry data for Datadog integrations using AI.

DynamicD uses Claude to analyze an integration's metrics, service checks, and dashboards, then generates a Python script that simulates realistic, scenario-aware data.

## Setup

### Required: Anthropic API Key (for script generation)

```bash
# Option 1: Environment variable
export ANTHROPIC_API_KEY="your-anthropic-key"

# Option 2: ddev config
ddev config set dynamicd.llm_api_key "your-anthropic-key"
```

### Required: Datadog API Key (for sending data)

```bash
ddev config set orgs.<your-org>.api_key "your-dd-api-key"
```

### Optional: Datadog App Key (for org name validation)

```bash
ddev config set orgs.<your-org>.app_key "your-dd-app-key"
```

### Optional: Datadog Site (for non-US users)

```bash
# Default is datadoghq.com (US1)
ddev config set orgs.<your-org>.site datadoghq.eu # EU
ddev config set orgs.<your-org>.site us3.datadoghq.com # US3
ddev config set orgs.<your-org>.site us5.datadoghq.com # US5
ddev config set orgs.<your-org>.site ap1.datadoghq.com # AP1
```

## Usage

```bash
# Interactive scenario selection
ddev meta scripts dynamicd <integration>

# Specific scenario
ddev meta scripts dynamicd celery --scenario incident

# Save script for later use
ddev meta scripts dynamicd redis --scenario healthy --save

# Preview without executing
ddev meta scripts dynamicd postgres --show-only

# Custom duration (default: run forever)
ddev meta scripts dynamicd kafka --duration 300
```

## Scenarios

| Scenario | Description |
|----------|-------------|
| `healthy` | Normal operation with baseline metrics. |
| `degraded` | Performance issues, increased latency, some errors. |
| `incident` | Active incident with failures and alerts. |
| `recovery` | System recovering, metrics returning to normal. |
| `peak_load` | High traffic, elevated but healthy metrics. |
| `maintenance` | Scheduled maintenance, reduced capacity. |

## What Gets Generated

DynamicD creates scripts that send:

- **Metrics**: All dashboard metrics with realistic, correlated values
- **Logs**: Scenario-appropriate log messages (INFO/WARN/ERROR)
- **Service Checks**: Health status matching the scenario (if integration defines them)
- **Events**: Significant state changes (incidents, recoveries)

All telemetry is tagged with `env:dynamicd` for easy filtering in Datadog.

## How It Works

1. **Context Building**: Reads integration metadata, metrics, dashboards, and service checks
2. **Stage 1 (Analysis)**: LLM analyzes the service type and operational patterns
3. **Stage 2 (Generation)**: LLM generates a self-contained Python simulator
4. **Execution**: Runs the script, auto-fixes errors if needed (up to 3 retries)

## Options

| Option | Description |
|--------|-------------|
| `--scenario`, `-s` | Scenario to simulate (healthy, degraded, incident, etc.) |
| `--duration, -d` | Duration in seconds (0 = run forever, default) |
| `--rate, -r` | Target metrics per batch (default: 100) |
| `--save` | Save script to integration's fake_data/ directory |
| `--show-only` | Display generated script without executing |
| `--timeout` | Execution timeout in seconds (for testing) |
| `--all-metrics` | Generate ALL metrics, not just dashboard metrics |
| `--sandbox/--no-sandbox` | Run in Docker container for isolation (default: enabled) |

**Note**: Sandbox mode is enabled by default and requires Docker Desktop to be running. Start Docker with `open -a Docker` on macOS. Use `--no-sandbox` to run directly on host.
4 changes: 4 additions & 0 deletions ddev/src/ddev/cli/meta/scripts/_dynamicd/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# (C) Datadog, Inc. 2024-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
"""DynamicD utilities - Smart fake data generator for Datadog integrations."""
Loading
Loading