Skip to content

Instantly share code, notes, and snippets.

@rootcss
Last active April 30, 2020 06:17
Show Gist options
  • Select an option

  • Save rootcss/c0737888b48a554504c2da9cef5eabd9 to your computer and use it in GitHub Desktop.

Select an option

Save rootcss/c0737888b48a554504c2da9cef5eabd9 to your computer and use it in GitHub Desktop.
// alert if scheduler is down.
stream
|from()
.measurement('prefix_scheduler_heartbeat')
|deadman(0.0, 5m)
.id('AirflowSchedulerDown')
.message('Airflow Scheduler is down')
.log('/tmp/alert_logs.txt')
.trigger_alert_method()
// alert if worker count does not match the required value
stream
|from()
.measurement('prefix_celery_workers')
|window()
.period(5m)
.every(5m)
|alert()
.id('Celery Workers Count')
.crit(lambda: "value" <= 2)
.warn(lambda: "value" <= 3)
.log('/tmp/alert_2.txt')
.trigger_alert_method()
// reference: https://docs.influxdata.com/kapacitor/v1.5/tick/introduction/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment