Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
dagster_datadog
dagster_datadog_tests
.coveragerc
README.md
dev-requirements.txt
requirements.txt
setup.py
tox.ini

README.md

dagster-datadog

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

Getting Started

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

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

Posting to DataDog

You can easily publish metrics from Dagster with the datadog resource:

@solid(resources={'datadog'})
def datadog_solid(context):
    context.resources.datadog.event('Man down!', 'This server needs assistance.')
    context.resources.datadog.gauge('users.online', 1001, tags=["protocol:http"])
    context.resources.datadog.increment('page.views')
    context.resources.datadog.decrement('page.views')
    context.resources.datadog.histogram('album.photo.count', 26, tags=["gender:female"])
    context.resources.datadog.distribution('album.photo.count', 26, tags=["color:blue"])
    context.resources.datadog.set('visitors.uniques', 999, tags=["browser:ie"])
    context.resources.datadog.service_check('svc.check_name', context.resources.datadog.WARNING)
    context.resources.datadog.timing("query.response.time", 1234)

    # Use timed decorator
    @context.resources.datadog.timed('run_fn')
    def run_fn():
        pass

    run_fn()

pipeline = PipelineDefinition(
    name='test_datadog_resource',
    solids=[datadog_solid],
    mode_definitions=[ModeDefinition(resources={'datadog': datadog_resource})],
)

result = execute_pipeline(
    pipeline,
    {'resources': {'datadog': {'config': {'api_key': 'YOUR_KEY', 'app_key': 'YOUR_KEY'}}}},
)
You can’t perform that action at this time.