monitor.from() function

The monitor.from() function retrieves check statuses stored in the statuses measurement in the _monitoring bucket.

*Function type: Input*

  1. import "influxdata/influxdb/monitor"
  2. monitor.from(
  3. start: -1h,
  4. stop: now(),
  5. fn: (r) => true
  6. )

Parameters

start

The earliest time to include in results. Use a relative duration, absolute time, or integer (Unix timestamp in seconds). For example, -1h, 2019-08-28T22:00:00Z, or 1567029600. Durations are relative to now().

*Data type: Duration | Time | Integer*

stop

The latest time to include in results. Use a relative duration, absolute time, or integer (Unix timestamp in seconds). For example, -1h, 2019-08-28T22:00:00Z, or 1567029600. Durations are relative to now(). Defaults to now().

*Data type: Duration | Time | Integer*

Time values in Flux must be in RFC3339 format.

fn

A single argument predicate function that evaluates true or false. Records or rows (r) that evaluate to true are included in output tables. Records that evaluate to null or false are not included in output tables.

*Data type: Function*

Examples

View critical check statuses from the last hour

  1. import "influxdata/influxdb/monitor"
  2. monitor.from(
  3. start: -1h,
  4. fn: (r) => r._level == "crit"
  5. )