Datadog APM Test Agent
The Datadog APM Test Agent is a Python-based utility that simulates the Datadog Agent for local testing and development of APM client libraries. It allows developers to capture, inspect, and validate traces, snapshots, and other observability data without requiring a full Datadog Agent setup. The current version is 1.46.0, with a frequent release cadence, often multiple times a month, for new features and bug fixes.
Warnings
- gotcha Since v1.40.0, LLM Observability data forwarding to Datadog is enabled by default. If you are using the test agent for local development and do not wish to send LLM-related data to your Datadog account, you must explicitly disable this feature.
- deprecated The VCR dependency has been removed in v1.38.0. The test agent now produces and primarily uses JSON cassettes. Existing VCR cassettes are converted to JSON on first use and then removed. Support for legacy VCR cassettes will be fully removed in version 2.0.0.
- gotcha For Claude Code API calls, the recommended method changed from relying on `ANTHROPIC_BASE_URL` to using the `ddapm-test-agent-run claude` CLI launcher in v1.44.0. The new launcher also includes a Javascript fetch interceptor.
- gotcha An issue causing `TypeError` exceptions on Python 3.8 and 3.9 when running the test agent or `lapdog` was fixed in v1.45.1. Users on version 1.45.0 might encounter these errors.
Install
-
pip install ddapm-test-agent
Imports
- ddapm-test-agent
This library is primarily a command-line interface (CLI) tool and is not typically imported into Python code. Its functionality is accessed by running the `ddapm-test-agent` or `lapdog` commands in a terminal.
Quickstart
# Start the basic test agent ddapm-test-agent # Or, for LLM observability with Claude hooks lapdog start # Your APM client library (e.g., dd-trace-py) should be configured # to send traces to the agent's default port (e.g., localhost:8126). # Example for dd-trace-py (ensure DD_AGENT_HOST and DD_TRACE_AGENT_PORT are set appropriately) # export DD_AGENT_HOST=localhost # export DD_TRACE_AGENT_PORT=8126 # python your_instrumented_app.py