Registry / observability / dagster-datadog

dagster-datadog

JSON →
library0.29.9pypypi✓ verified 89d ago

The `dagster-datadog` library provides components to integrate Dagster with Datadog for monitoring and observability. This includes resources for sending metrics and events, and loggers for forwarding Dagster logs to Datadog. It is currently at version 0.29.0 and is released as part of the Dagster ecosystem's approximately monthly release cycle, with library versions tracking core Dagster releases.

pip install dagster-datadog
INSTALL
IMPORT
SIG · DAGSTER-DATADOG
D
dagster-datadog
observabilitypythonv0.29.9
Install
12.8s avg
Import
3371ms
Disk
134MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.29.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 3.489s · 132.3MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 12.8s · import 3.254s · 128MB
134MB installed
● package 134MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DatadogResource
✓ from dagster_datadog import DatadogResource
✗ from dagster_datadog import datadog_resource
The function-based `datadog_resource` was deprecated in Dagster 1.0+ in favor of the class-based `DatadogResource`.
DatadogLogger
✓ from dagster_datadog import DatadogLogger
For sending Dagster system logs to Datadog.

This quickstart demonstrates defining a Dagster asset that interacts with `DatadogResource` to send a custom metric. It shows how to configure the `DatadogResource` and `DatadogLogger` within your Dagster definitions, requiring Datadog API and APP keys typically provided via environment variables.

from dagster import AssetExecutionContext, Definitions, asset, job from dagster_datadog import DatadogResource, DatadogLogger import os @asset def my_datadog_asset(context: AssetExecutionContext, datadog: DatadogResource): context.log.info("Asset started, sending metric to Datadog...") # Use the DatadogResource client to send a custom metric datadog.send_metric( metric_name="my_asset.completion", value=1, tags=["asset:my_datadog_asset", f"run_id:{context.run_id}"], ) context.log.info("Metric sent. Asset completed.") @job def my_datadog_job(): my_datadog_asset() defs = Definitions( assets=[my_datadog_asset], resources={ "datadog": DatadogResource( api_key=os.environ.get("DATADOG_API_KEY", ""), app_key=os.environ.get("DATADOG_APP_KEY", ""), # Optional: configure host/port if Datadog Agent is not on localhost # host="localhost", # port=8125, ) }, # Optional: configure a Datadog logger for system events loggers={ "datadog": DatadogLogger( api_key=os.environ.get("DATADOG_API_KEY", ""), app_key=os.environ.get("DATADOG_APP_KEY", "") ) } ) # To run this example: # 1. Ensure DATADOG_API_KEY and DATADOG_APP_KEY environment variables are set. # 2. Save as `repo.py` and run `dagster dev -f repo.py`. # 3. Launch `my_datadog_job` from the UI.
Debug
Known issues
breakingDagster 1.0+ introduced a new resource API. The function-based `datadog_resource` is now deprecated and should be replaced with the class-based `DatadogResource`.
fix
Replace `datadog_resource()` with `DatadogResource()` when defining your resources, and provide configuration parameters directly to the class constructor.
affects: Dagster versions 1.0.0 and above. dagster-datadog versions 0.16.0 and above.
gotchaThe `DatadogResource` and `DatadogLogger` require Datadog `api_key` and `app_key` for successful authentication and data submission. Misconfiguration or omission of these keys will lead to failed Datadog interactions.
fix
Ensure `api_key` and `app_key` are provided to `DatadogResource` and `DatadogLogger` constructors, preferably using environment variables (e.g., `os.environ.get("DATADOG_API_KEY")`).
affects: All versions
gotchaWhen sending metrics directly to the Datadog Agent (default behavior if `host`/`port` point to an agent), ensure the agent is running and accessible from the Dagster execution environment. Otherwise, configure the resource to use the HTTP API directly.
fix
Verify Datadog Agent status or explicitly configure `host` and `port` in `DatadogResource` if using a non-default agent location, or ensure `api_key`/`app_key` are provided for direct HTTP API usage.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dagster_datadog'
The `dagster-datadog` library has not been installed in your Python environment.
fix
Run `pip install dagster-datadog`.
dagster._core.errors.DagsterInvalidDefinitionError: Resource with key 'datadog' expected but not provided.
Your job or asset tries to access a resource named 'datadog', but it hasn't been defined in your `Definitions` or provided to the job/graph.
fix
Add `DatadogResource` to your `Definitions` resources, e.g., `resources={'datadog': DatadogResource(...)}}`.
dagster._core.errors.DagsterInvalidConfigError: Missing required config entry 'api_key'.
The `DatadogResource` or `DatadogLogger` was initialized without providing the necessary `api_key` configuration.
fix
Provide `api_key` in the resource or logger configuration, e.g., `DatadogResource(api_key="YOUR_API_KEY", app_key="YOUR_APP_KEY")`.
AttributeError: module 'dagster_datadog' has no attribute 'datadog_resource'
You are trying to import or use the old function-based `datadog_resource` which was removed or deprecated in Dagster 1.0+.
fix
Update your code to use the class-based `DatadogResource` instead: `from dagster_datadog import DatadogResource`.
Upgrade
Version history
0.29.9latest on PyPI · released Jun 11, 2026
Audit
Dependencies
dagsterrequiredCore Dagster framework is required to use the integration components.
datadogrequiredThe official Datadog client library is required for communication with Datadog APIs.
Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
dagster-datadog — pip install dagster-datadog · libregistry