influxdata / docs-v2

InfluxData Documentation that covers InfluxDB Cloud, InfluxDB OSS 2.x, InfluxDB OSS 1.x, InfluxDB Enterprise, Telegraf, Chronograf, Kapacitor, and Flux.
https://docs.influxdata.com
MIT License
73 stars 278 forks source link

How can I add an alert with CLI? #2067

Open mzp0514 opened 3 years ago

mzp0514 commented 3 years ago

Describe the issue here.

Relevant URLs
What products and version are you using?
sanderson commented 3 years ago

Thanks for the question @mzp0514. The UI for alerts is essentially a GUI for creating two tasks:

To add a check and alert using the CLI, you'll have to create a custom check: https://docs.influxdata.com/influxdb/cloud/monitor-alert/custom-checks/#example-monitor-failed-tasks

Then create a custom notification task. We don't have this documented yet, but there is an issue for it already: https://github.com/influxdata/docs-v2/issues/1969.

You can then add both as tasks with the CLI: https://docs.influxdata.com/influxdb/cloud/process-data/manage-tasks/create-task/#create-a-task-using-the-influx-cli

Many of the parts and pieces are in the documentation, but we can definitely tie them together better. I propose the following changes to resolve this issue: