Datadog (dagster_datadog)

This library provides an integration with Datadog, to support publishing metrics to Datadog from within Dagster solids.

We use the Python datadogpy library. To use it, you’ll first need to create a DataDog account and get both API and Application keys.

The integration uses DogStatsD, so you’ll need to ensure the datadog agent is running on the host you’re sending metrics from.

dagster_datadog.datadog_resource ResourceDefinition[source]

This resource is a thin wrapper over the dogstatsd library.

As such, we directly mirror the public API methods of DogStatsd here; you can refer to the DataDog documentation for how to use this resource.


def datadog_solid(context):
    dd = context.resources.datadog

    dd.event('Man down!', 'This server needs assistance.')
    dd.gauge('', 1001, tags=["protocol:http"])
    dd.histogram('', 26, tags=["gender:female"])
    dd.distribution('', 26, tags=["color:blue"])
    dd.set('visitors.uniques', 999, tags=["browser:ie"])
    dd.service_check('svc.check_name', dd.WARNING)
    dd.timing("query.response.time", 1234)

    # Use timed decorator
    def run_fn():


@pipeline(mode_defs=[ModeDefinition(resource_defs={'datadog': datadog_resource})])
def dd_pipeline():

result = execute_pipeline(
    {'resources': {'datadog': {'config': {'api_key': 'YOUR_KEY', 'app_key': 'YOUR_KEY'}}}},