Skip to main content

Send summary messages of your Luigi jobs to Slack.

Project description

Luigi Monitor

Pypi Latest Version License Python Versions Pypi Format Build Status

message

Send summary messages of your Luigi jobs to Slack.

Overview

Luigi is a great tool for making job pipelines, but it's hard to know the status of a run. Luigi has support for error emails, but this requires configuring your machine to send email, which is a hassle for short-lived EMR clusters. Further, it sends an email for every failure, which can quickly swamp your inbox.

By contrast, this tool gathers all your failures and missing dependencies and sends a summary Slack message when the job is finished.

Usage

With default app username:

import luigi
from luigi_monitor import monitor

...

if __name__ == "__main__":
    with monitor(slack_url=<your_slack_url>, max_print=10):
        luigi.run(main_task_cls=MainClass)

With dynamic app username:

import luigi
from luigi_monitor import monitor

...

if __name__ == "__main__":
    with monitor(slack_url=<your_slack_url>, max_print=10, username="FooBar Monitor"):
        luigi.run(main_task_cls=MainClass)

Monitoring and notifying on various events:

Currently supports: SUCCESS, DEPENDENCY_MISSING, and FAILURE

By default, all three of the above are monitored and notified on. If, SUCCESS event is monitored and all tasks succeed then the notification text is "Job ran successfully" instead of listing all successful tasks.

import luigi
from luigi_monitor import monitor

...

if __name__ == "__main__":
    with monitor(slack_url=<your_slack_url>, events=['DEPENDENCY_MISSING', 'FAILURE']):
        luigi.run(main_task_cls=MainClass)

Alternatively:

luigi-monitor --module path.to.module TaskName

NB: if you plan to use luigi-monitor from the command line, set options using luigi.cfg:

[luigi-monitor]
slack_url=<slack_hook>
max_print=<int>
username=<string>

This is a work in progress. Particularly, note that:

  • It only sends notifications via Slack

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fluigi-monitor, version 1.1.6
Filename, size File type Python version Upload date Hashes
Filename, size fluigi-monitor-1.1.6.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page