updated monitor package docs to address PR feedback

pull/422/head
Scott Anderson 2019-08-30 09:09:33 -06:00
parent 302b9b0171
commit cb74dbffe3
7 changed files with 43 additions and 51 deletions

View File

@ -26,26 +26,24 @@ range(start: -15m, stop: now())
## Parameters ## Parameters
### start ### start
Specifies the oldest time to be included in the results. The earliest time to include in results.
Use a relative duration or absolute time.
For example, `-1h` or `2019-08-28T22:00:00Z`.
Durations are relative to `now()`.
Relative start times are defined using negative durations. _**Data type:** Duration | Time_
Negative durations are relative to now.
Absolute start times are defined using timestamps.
_**Data type:** Duration or Timestamp_
### stop ### stop
Specifies the newest time to be included in the results. Defaults to `now`. The latest time to include in results.
Use a relative duration or absolute time.
For example, `-1h` or `2019-08-28T22:00:00Z`.
Durations are relative to `now()`.
Defaults to `now()`.
Relative stop times are defined using negative durations. _**Data type:** Duration | Time_
Negative durations are relative to now.
Absolute stop times are defined using timestamps.
_**Data type:** Duration or Timestamp_
{{% note %}} {{% note %}}
Flux only honors [RFC3339 timestamps](/v2.0/reference/flux/language/types#timestamp-format) Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
and ignores dates and times provided in other formats.
{{% /note %}} {{% /note %}}
## Examples ## Examples

View File

@ -12,7 +12,7 @@ weight: 202
v2.0/tags: [functions, monitor, alerts, package] v2.0/tags: [functions, monitor, alerts, package]
--- ---
Monitor Flux functions provide tools for monitoring and alerting with InfluxDB. The Flux monitor package provides tools for monitoring and alerting with InfluxDB.
Import the `influxdata/influxdb/monitor` package: Import the `influxdata/influxdb/monitor` package:
```js ```js

View File

@ -1,8 +1,8 @@
--- ---
title: monitor.check() function title: monitor.check() function
description: > description: >
The `monitor.check()` function performs a check against input data and assigns an `ok`, The `monitor.check()` function function checks input data and assigns a level
`info`, `warn` or `crit`level to each row based on user-specified predicate functions. (`ok`, `info`, `warn`, or `crit`) to each row based on predicate functions.
menu: menu:
v2_0_ref: v2_0_ref:
name: monitor.check name: monitor.check
@ -10,10 +10,8 @@ menu:
weight: 202 weight: 202
--- ---
The `monitor.check()` function performs a check against input data and assigns an `ok`, The `monitor.check()` function function checks input data and assigns a level
`info`, `warn` or `crit` level to each row based on user-specified predicate functions. (`ok`, `info`, `warn`, or `crit`) to each row based on predicate functions.
The function stores statuses in the `_level` column and writes all check results to the
`statuses` measurement in the `_monitoring` bucket.
_**Function type:** Transformation_ _**Function type:** Transformation_
@ -30,6 +28,9 @@ monitor.check(
) )
``` ```
`monitor.check()` stores statuses in the `_level` column and writes results
to the `statuses` measurement in the `_monitoring` bucket.
## Parameters ## Parameters
### crit ### crit
@ -63,7 +64,7 @@ The message is stored in the `_message` column.
_**Data type:** Function_ _**Data type:** Function_
### data ### data
Data to append to the to output data. Data to append to the output.
**InfluxDB populates check data.** **InfluxDB populates check data.**
_**Data type:** Object_ _**Data type:** Object_

View File

@ -11,8 +11,7 @@ cloud_all: true
--- ---
The `monitor.deadman()` function detects when a group stops reporting data. The `monitor.deadman()` function detects when a group stops reporting data.
It takes a stream of tables and reports which groups or series are It takes a stream of tables and reports if groups have been observed since time `t`.
observed before time `t`, but not after.
_**Function type:** Transformation_ _**Function type:** Transformation_
@ -23,8 +22,8 @@ monitor.deadman(t: -3m)
``` ```
`monitor.deadman()` retains the most recent row from each input table and adds a `dead` column. `monitor.deadman()` retains the most recent row from each input table and adds a `dead` column.
It sets `dead` to `true` if the record appears before time `t`. If a record appears **after** time `t`, `monitor.deadman()` sets `dead` to `false`.
It sets `dead` to `false` if the group appears after time `t`. Otherwise, `dead` is set to `true`.
## Parameters ## Parameters

View File

@ -27,27 +27,24 @@ monitor.from(
## Parameters ## Parameters
### start ### start
The oldest time to include in results. The earliest time to include in results.
Use a relative duration or absolute time.
Relative start times are defined using negative durations. For example, `-1h` or `2019-08-28T22:00:00Z`.
Negative durations are relative to now. Durations are relative to `now()`.
Absolute start times are defined using timestamps.
_**Data type:** Duration | Time_ _**Data type:** Duration | Time_
### stop ### stop
The newest time to include in the results. The latest time to include in results.
Use a relative duration or absolute time.
For example, `-1h` or `2019-08-28T22:00:00Z`.
Durations are relative to `now()`.
Defaults to `now()`. Defaults to `now()`.
Relative stop times are defined using negative durations.
Negative durations are relative to now.
Absolute stop times are defined using timestamps.
_**Data type:** Duration | Time_ _**Data type:** Duration | Time_
{{% note %}} {{% note %}}
Flux only honors [RFC3339 timestamps](/v2.0/reference/flux/language/types#timestamp-format) Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
and ignores dates and times provided in other formats.
{{% /note %}} {{% /note %}}
### fn ### fn

View File

@ -26,27 +26,24 @@ monitor.logs(
## Parameters ## Parameters
### start ### start
The oldest time to include in results. The earliest time to include in results.
Use a relative duration or absolute time.
Relative start times are defined using negative durations. For example, `-1h` or `2019-08-28T22:00:00Z`.
Negative durations are relative to now. Durations are relative to `now()`.
Absolute start times are defined using timestamps.
_**Data type:** Duration | Time_ _**Data type:** Duration | Time_
### stop ### stop
The newest time to include in the results. The latest time to include in results.
Use a relative duration or absolute time.
For example, `-1h` or `2019-08-28T22:00:00Z`.
Durations are relative to `now()`.
Defaults to `now()`. Defaults to `now()`.
Relative stop times are defined using negative durations.
Negative durations are relative to now.
Absolute stop times are defined using timestamps.
_**Data type:** Duration | Time_ _**Data type:** Duration | Time_
{{% note %}} {{% note %}}
Flux only honors [RFC3339 timestamps](/v2.0/reference/flux/language/types#timestamp-format) Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
and ignores dates and times provided in other formats.
{{% /note %}} {{% /note %}}
### fn ### fn

View File

@ -32,7 +32,7 @@ A function that constructs and sends the notification to an endpoint.
_**Data type:** Function_ _**Data type:** Function_
### data ### data
Data to append to output data. Data to append to the output.
**InfluxDB populates notification data.** **InfluxDB populates notification data.**
_**Data type:** Object_ _**Data type:** Object_