Search code examples
sentrydagster

Dagster failure notification systems


Is there a way in dagster to receive notifications when certain events occur, such as failures? For example, is there an integration with a tool like sentry available?


Solution

  • There is a datadog integration that lets users send events to datadog. From the docs:

    @solid(required_resource_keys={'datadog'})
    def datadog_solid(context):
        dd = context.resources.datadog
    
        dd.event('Man down!', 'This server needs assistance.')
        dd.gauge('users.online', 1001, tags=["protocol:http"])
        dd.increment('page.views')
        dd.decrement('page.views')
        dd.histogram('album.photo.count', 26, tags=["gender:female"])
        dd.distribution('album.photo.count', 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
        @dd.timed('run_fn')
        def run_fn():
            pass
    
        run_fn()
    
    @pipeline(mode_defs=[ModeDefinition(resource_defs={'datadog': datadog_resource})])
    def dd_pipeline():
        datadog_solid()
    
    result = execute_pipeline(
        dd_pipeline,
        {'resources': {'datadog': {'config': {'api_key': 'YOUR_KEY', 'app_key': 'YOUR_KEY'}}}},
    )
    

    Adding first class user-configurable hooks for certain events (ie failure) is currently work in progress.