monitor.notify() function
The monitor.notify()
function sends a notification to an endpoint and logs it in the notifications
measurement in the _monitoring
bucket.
*Function type: Output*
import "influxdata/influxdb/monitor"
monitor.notify(
endpoint: endpoint,
data: {}
)
Parameters
endpoint
A function that constructs and sends the notification to an endpoint.
*Data type: Function*
data
Data to append to the output. InfluxDB populates notification data.
*Data type: Record*
Examples
Send a notification to Slack
import "influxdata/influxdb/monitor"
import "slack"
endpoint = slack.endpoint(name: "slack", channel: "#flux")
from(bucket: "system")
|> range(start: -5m)
|> monitor.notify(endpoint: endpoint)