docs-v2/content/v2.0/reference/flux/stdlib/monitor/notify.md

1.1 KiB

title description aliases menu weight
monitor.notify() function The `monitor.notify()` function sends a notification to an endpoint and logs it in the `notifications` measurement in the `_monitoring` bucket.
/v2.0/reference/flux/functions/monitor/notify/
v2_0_ref
name parent
monitor.notify InfluxDB Monitor
202

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: Object

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)