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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 3.489s · 132.3MB
glibcpy 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`.fixReplace `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.fixEnsure `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.fixVerify 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.
fixRun `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.
fixAdd `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.
fixProvide `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+.
fixUpdate 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.