commit
d8a0b8ade8
|
@ -18,7 +18,8 @@
|
|||
}
|
||||
}
|
||||
h2,h3,h4,h5,h6 {
|
||||
& + .highlight pre { margin-top: .5rem; }
|
||||
& + .highlight pre { margin-top: .5rem }
|
||||
& + pre { margin-top: .5rem }
|
||||
& + .code-tabs-wrapper { margin-top: 0; }
|
||||
}
|
||||
h1 {
|
||||
|
|
|
@ -26,22 +26,22 @@
|
|||
&.ui-toggle {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 34px;
|
||||
height: 22px;
|
||||
background: #1C1C21;
|
||||
border: 2px solid #383846;
|
||||
width: 28px;
|
||||
height: 16px;
|
||||
background: $b-pool;
|
||||
border-radius: .7rem;
|
||||
vertical-align: text-bottom;
|
||||
vertical-align: text-top;
|
||||
margin-top: 2px;
|
||||
|
||||
.circle {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
background: #22ADF6;
|
||||
top: 3px;
|
||||
right: 3px;
|
||||
height: 8px;
|
||||
width: 8px;
|
||||
background: $g20-white;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ $article-note-table-row-alt: #3B2862;
|
|||
$article-note-table-scrollbar: $np-deepnight;
|
||||
$article-note-shadow: $np-deepnight;
|
||||
$article-note-code: $cp-comet;
|
||||
$article-note-code-bg: $wp-telopea;
|
||||
$article-note-code-bg: $wp-jaguar;
|
||||
$article-note-code-accent1: #567375;
|
||||
$article-note-code-accent2: $b-pool;
|
||||
$article-note-code-accent3: $gr-viridian;
|
||||
|
|
|
@ -24,6 +24,7 @@ $g19-ghost: #FAFAFC;
|
|||
$g20-white: #FFFFFF; // Brand color
|
||||
|
||||
// Warm Purples - Magentas
|
||||
$wp-jaguar: #1d0135;
|
||||
$wp-telopea: #23043E;
|
||||
$wp-violentdark: #2d0749;
|
||||
$wp-violet: #32094E;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
@font-face {
|
||||
font-family: 'icomoon';
|
||||
src: url('fonts/icomoon.eot?e8u66e');
|
||||
src: url('fonts/icomoon.eot?e8u66e#iefix') format('embedded-opentype'),
|
||||
url('fonts/icomoon.ttf?e8u66e') format('truetype'),
|
||||
url('fonts/icomoon.woff?e8u66e') format('woff'),
|
||||
url('fonts/icomoon.svg?e8u66e#icomoon') format('svg');
|
||||
src: url('fonts/icomoon.eot?9r9zke');
|
||||
src: url('fonts/icomoon.eot?9r9zke#iefix') format('embedded-opentype'),
|
||||
url('fonts/icomoon.ttf?9r9zke') format('truetype'),
|
||||
url('fonts/icomoon.woff?9r9zke') format('woff'),
|
||||
url('fonts/icomoon.svg?9r9zke#icomoon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
@ -24,9 +24,24 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-ui-disks-nav:before {
|
||||
content: "\e93c";
|
||||
}
|
||||
.icon-ui-wrench-nav:before {
|
||||
content: "\e93d";
|
||||
}
|
||||
.icon-ui-eye-closed:before {
|
||||
content: "\e956";
|
||||
}
|
||||
.icon-ui-eye-open:before {
|
||||
content: "\e957";
|
||||
}
|
||||
.icon-ui-chat:before {
|
||||
content: "\e93a";
|
||||
}
|
||||
.icon-ui-bell:before {
|
||||
content: "\e93b";
|
||||
}
|
||||
.icon-ui-cloud:before {
|
||||
content: "\e93f";
|
||||
}
|
||||
|
|
|
@ -36,9 +36,9 @@ For details, see [Export a dashboard](v2.0/visualize-data/dashboards/export-dash
|
|||
|
||||
**To save a Telegraf configuration:**
|
||||
|
||||
1. Click in the **Organizations** icon in the navigation bar.
|
||||
1. Click in the **Settings** icon in the navigation bar.
|
||||
|
||||
{{< nav-icon "orgs" >}}
|
||||
{{< nav-icon "settings" >}}
|
||||
|
||||
2. Select the **Telegraf** tab. A list of existing Telegraf configurations appears.
|
||||
3. Click on the name of a Telegraf configuration.
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: Monitor data and send alerts
|
||||
seotitle: Monitor data and send alerts
|
||||
description: >
|
||||
Monitor your time series data and send alerts by creating checks, notification
|
||||
rules, and notification endpoints.
|
||||
menu:
|
||||
v2_0:
|
||||
name: Monitor & alert
|
||||
weight: 6
|
||||
v2.0/tags: [monitor, alert, checks, notification, endpoints]
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
Monitor your time series data and send alerts by creating checks, notification
|
||||
rules, and notification endpoints.
|
||||
|
||||
## The monitoring workflow
|
||||
1. InfluxDB uses a [check](/v2.0/reference/glossary/#check) to query data and
|
||||
assigns a status or `_level` based on specific conditions.
|
||||
2. InfluxDB stores the output the check in the `statuses` measurement in the `_monitoring` system bucket.
|
||||
3. [Notification rules](/v2.0/reference/glossary/#notification-rule) check data in the `statuses`
|
||||
measurement and, based conditions set in the notification rule, send a message
|
||||
to a [notification endpoint](/v2.0/reference/glossary/#notification-endpoint).
|
||||
4. InfluxDB stores notifications in the `notifications` measurement in the `_monitoring` system bucket.
|
||||
|
||||
## Monitor your data
|
||||
To get started, do the following:
|
||||
|
||||
1. [Create checks](/v2.0/monitor-alert/checks/create/) to monitor data and assign a status.
|
||||
2. [Add notification endpoints](/v2.0/monitor-alert/notification-endpoints/create/)
|
||||
to send notifications to third parties.
|
||||
3. [Create notification rules](/v2.0/monitor-alert/notification-rules/create) to check
|
||||
statuses and send notifications to your notifications endpoints.
|
||||
|
||||
|
||||
## Manage your monitoring and alerting pipeline
|
||||
|
||||
{{< children >}}
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
title: Manage checks
|
||||
seotitle: Manage monitoring checks in InfluxDB
|
||||
description: >
|
||||
Checks in InfluxDB query data and apply a status or level to each data point based on specified conditions.
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Monitor & alert
|
||||
weight: 101
|
||||
v2.0/tags: [monitor, checks, notifications, alert]
|
||||
related:
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
Checks in InfluxDB query data and apply a status or level to each data point based on specified conditions.
|
||||
Learn how to create and manage checks:
|
||||
|
||||
{{< children >}}
|
|
@ -0,0 +1,149 @@
|
|||
---
|
||||
title: Create checks
|
||||
seotitle: Create monitoring checks in InfluxDB
|
||||
description: >
|
||||
Create a check in the InfluxDB UI.
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Manage checks
|
||||
weight: 201
|
||||
related:
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
Create a check in the InfluxDB user interface (UI).
|
||||
A check consists of two parts – a query and check configuration.
|
||||
|
||||
##### Check query
|
||||
- Specifies the dataset to monitor.
|
||||
- Requires a bucket, measurement, field, and an aggregate function.
|
||||
|
||||
{{% note %}}The aggregate function aggregates data points between the specified check intervals
|
||||
and returns a single value for the check to process.
|
||||
{{% /note %}}
|
||||
- May include tags to narrow results.
|
||||
|
||||
##### Check configuration
|
||||
- Defines check properties, including the check interval and status message.
|
||||
- Evaluates specified conditions and applies a status (if applicable) to each data point:
|
||||
- `crit`
|
||||
- `warn`
|
||||
- `info`
|
||||
- `note`
|
||||
- Stores status in the `_level` column.
|
||||
|
||||
## Create a check in the InfluxDB UI
|
||||
1. Click **Monitoring & Alerting** in the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. In the top right corner of the **Checks** column, click **{{< icon "plus" >}} Create**.
|
||||
|
||||
3. Click **Name this check** in the top left corner and provide a unique name for the check.
|
||||
|
||||
### Configure the query
|
||||
1. In the **Query view**, select the bucket, measurement, field and tag sets to query.
|
||||
2. In the **Aggregate functions** column, select an interval from the interval drop-down list
|
||||
(for example, "Every 5 minutes") and an aggregate function from the list of functions.
|
||||
3. Click **Submit** to run the query and preview the results.
|
||||
To see the raw query results, click the the **{{< icon "toggle" >}} View Raw Data** toggle.
|
||||
|
||||
### Configure the check
|
||||
1. Click **2. Check** near the top of the window to display the **Check view**.
|
||||
2. In the **Properties** column, configure the following:
|
||||
|
||||
##### Schedule Every
|
||||
Select the interval to run the check (for example, "Every 5 minutes").
|
||||
This interval matches the aggregate function interval for the check query.
|
||||
_Changing the interval here will update the aggregate function interval._
|
||||
|
||||
##### Offset
|
||||
Delay the execution of a task to account for any late data.
|
||||
Offset queries do not change the queried time range.
|
||||
|
||||
{{% note %}}Your offset must be shorter than your [check interval](#schedule-every).
|
||||
{{% /note %}}
|
||||
|
||||
##### Tags
|
||||
Add custom tags to the query output.
|
||||
Each custom tag appends a new column to each row in the query output.
|
||||
The column label is the tag key and the column value is the tag value.
|
||||
|
||||
Use custom tags to associate additional metadata with the check.
|
||||
Common metadata tags across different checks lets you easily group and organize checks.
|
||||
You can also use custom tags in [notification rules](/v2.0/monitor-alert/notification-rules/create/).
|
||||
|
||||
3. In the **Status Message Template** column, enter the status message template for the check.
|
||||
Use [Flux string interpolation](/v2.0/reference/flux/language/string-interpolation/)
|
||||
to populate the message with data from the query.
|
||||
|
||||
{{% note %}}
|
||||
#### Flux only interpolates string values
|
||||
Flux currently interpolates only string values.
|
||||
Use the [string() function](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/string/)
|
||||
to convert non-string values to strings.
|
||||
|
||||
```js
|
||||
count = 12
|
||||
"I currently have ${string(v: count)} cats."
|
||||
```
|
||||
{{% /note %}}
|
||||
|
||||
Check data is represented as an object, `r`.
|
||||
Access specific column values using dot notation: `r.columnName`.
|
||||
|
||||
Use data from the following columns:
|
||||
|
||||
- columns included in the query output
|
||||
- [custom tags](#tags) added to the query output
|
||||
- `_check_id`
|
||||
- `_check_name`
|
||||
- `_level`
|
||||
- `_source_measurement`
|
||||
- `_type`
|
||||
|
||||
###### Example status message template
|
||||
```
|
||||
From ${r._check_name}:
|
||||
${r._field} is ${r._level}.
|
||||
Its value is ${string(v: r._value)}.
|
||||
```
|
||||
|
||||
When a check generates a status, it stores the message in the `_message` column.
|
||||
|
||||
4. In the **Conditions** column, define the logic that assigns a status or level to data.
|
||||
Select the type of check to configure:
|
||||
|
||||
##### Threshold
|
||||
A threshold check assigns a status based on a value being above, below,
|
||||
inside, or outside of defined thresholds.
|
||||
[Configure a threshold check](#configure-a-threshold-check).
|
||||
|
||||
##### Deadman
|
||||
A deadman check assigns a status to data when a series or group has not
|
||||
reported in a specified amount of time.
|
||||
[Configure a deadman check](#configure-a-deadman-check).
|
||||
|
||||
##### Configure a threshold check
|
||||
1. For each status you want to configure, click the status name (CRIT, WARN, INFO, or OK).
|
||||
2. From the **When value** drop-down list, select a threshold: is above, is below,
|
||||
is inside of, is outside of.
|
||||
3. Enter a value or values for the threshold.
|
||||
You can also use the threshold sliders in the data visualization to define threshold values.
|
||||
|
||||
##### Configure a deadman check
|
||||
1. In the **for** field, enter a duration for the deadman check.
|
||||
For example, `5m`, `1h`, or `2h30m`.
|
||||
2. Use the **set status to** drop-down list to select a status to set on a dead series.
|
||||
3. In the **And stop checking after** field, enter the time to stop monitoring the series.
|
||||
For example, `30m`, `2h`, `3h15m`.
|
||||
|
||||
5. Click the green **{{< icon "check" >}}** in the top right corner to save the check.
|
||||
|
||||
## Clone a check
|
||||
Create a new check by cloning an existing check.
|
||||
|
||||
1. In the **Checks** column, hover over the check you want to clone.
|
||||
2. Click the **{{< icon "clone" >}}** icon, then **Clone**.
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
title: Delete checks
|
||||
seotitle: Delete monitoring checks in InfluxDB
|
||||
description: >
|
||||
Delete checks in the InfluxDB UI.
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Manage checks
|
||||
weight: 204
|
||||
related:
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
If you no longer need a check, use the InfluxDB user interface (UI) to delete it.
|
||||
|
||||
{{% warn %}}
|
||||
Deleting a check cannot be undone.
|
||||
{{% /warn %}}
|
||||
|
||||
1. Click **Monitoring & Alerting** in the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. In the **Checks** column, hover over the check you want to delete, click the
|
||||
**{{< icon "delete" >}}** icon, then **Delete**.
|
||||
|
||||
After a check is deleted, all statuses generated by the check remain in the `_monitoring`
|
||||
bucket until the retention period for the bucket expires.
|
||||
|
||||
{{% note %}}
|
||||
You can also [disable a check](/v2.0/monitor-alert/checks/update/#enable-or-disable-a-check)
|
||||
without having to delete it.
|
||||
{{% /note %}}
|
|
@ -0,0 +1,63 @@
|
|||
---
|
||||
title: Update checks
|
||||
seotitle: Update monitoring checks in InfluxDB
|
||||
description: >
|
||||
Update, rename, enable or disable checks in the InfluxDB UI.
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Manage checks
|
||||
weight: 203
|
||||
related:
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
Update checks in the InfluxDB user interface (UI).
|
||||
Common updates include:
|
||||
|
||||
- [Update check queries and logic](#update-check-queries-and-logic)
|
||||
- [Enable or disable a check](#enable-or-disable-a-check)
|
||||
- [Rename a check](#rename-a-check)
|
||||
- [Add or update a check description](#add-or-update-a-check-description)
|
||||
- [Add a label to a check](#add-a-label-to-a-check)
|
||||
|
||||
To update checks, click **Monitoring & Alerting** in the InfluxDB UI sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
|
||||
## Update check queries and logic
|
||||
1. In the **Checks** column, click the name of the check you want to update.
|
||||
The check builder appears.
|
||||
2. To edit the check query, click **1. Query** at the top of the check builder window.
|
||||
3. To edit the check logic, click **2. Check** at the top of the check builder window.
|
||||
|
||||
_For details about using the check builder, see [Create checks](/v2.0/monitor-alert/checks/create/)._
|
||||
|
||||
## Enable or disable a check
|
||||
In the **Checks** column, click the {{< icon "toggle" >}} toggle next to a check
|
||||
to enable or disable it.
|
||||
|
||||
## Rename a check
|
||||
1. In the **Checks** column, hover over the name of the check you want to update.
|
||||
2. Click the **{{< icon "edit" >}}** icon that appears next to the check name.
|
||||
2. Enter a new name and click out of the name field or press enter to save.
|
||||
|
||||
_You can also rename a check in the [check builder](#update-check-queries-and-logic)._
|
||||
|
||||
## Add or update a check description
|
||||
1. In the **Checks** column, hover over the check description you want to update.
|
||||
2. Click the **{{< icon "edit" >}}** icon that appears next to the description.
|
||||
2. Enter a new description and click out of the name field or press enter to save.
|
||||
|
||||
## Add a label to a check
|
||||
1. In the **Checks** column, click **Add a label** next to the check you want to add a label to.
|
||||
The **Add Labels** box opens.
|
||||
2. To add an existing label, select the label from the list.
|
||||
3. To create and add a new label:
|
||||
- In the search field, enter the name of the new label. The **Create Label** box opens.
|
||||
- In the **Description** field, enter an optional description for the label.
|
||||
- Select a color for the label.
|
||||
- Click **Create Label**.
|
||||
4. To remove a label, hover over the label under to a rule and click **{{< icon "x" >}}**.
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
title: View checks
|
||||
seotitle: View monitoring checks in InfluxDB
|
||||
description: >
|
||||
View check details and statuses and notifications generated by checks in the InfluxDB UI.
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Manage checks
|
||||
weight: 202
|
||||
related:
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
View check details and statuses and notifications generated by checks in the InfluxDB user interface (UI).
|
||||
|
||||
- [View a list of all checks](#view-a-list-of-all-checks)
|
||||
- [View check details](#view-check-details)
|
||||
- [View statuses generated by a check](#view-statuses-generated-by-a-check)
|
||||
- [View notifications triggered by a check](#view-notifications-triggered-by-a-check)
|
||||
|
||||
To view checks, click **Monitoring & Alerting** in the InfluxDB UI sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
## View a list of all checks
|
||||
The **Checks** column on the Monitoring & Alerting landing page displays all existing checks.
|
||||
|
||||
## View check details
|
||||
In the **Checks** column, click the name of the check you want to view.
|
||||
The check builder appears.
|
||||
Here you can view the check query and logic.
|
||||
|
||||
## View statuses generated by a check
|
||||
1. In the **Checks** column, hover over the check, click the **{{< icon "view" >}}**
|
||||
icon, then **View History**.
|
||||
The Statuses History page displays statuses generated by the selected check.
|
||||
|
||||
## View notifications triggered by a check
|
||||
1. In the **Checks** column, hover over the check, click the **{{< icon "view" >}}**
|
||||
icon, then **View History**.
|
||||
2. In the top left corner, click **Notifications**.
|
||||
The Notifications History page displays notifications initiated by the selected check.
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
title: Manage notification endpoints
|
||||
list_title: Manage notification endpoints
|
||||
description: >
|
||||
Create, read, update, and delete endpoints in the InfluxDB UI.
|
||||
v2.0/tags: [monitor, endpoints, notifications, alert]
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Monitor & alert
|
||||
weight: 102
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
Notification endpoints store information to connect to a third party service.
|
||||
If you're using the Free plan, create a Slack endpoint.
|
||||
If you're using the Pay as You Go plan, create a connection to a HTTP, Slack, or PagerDuty endpoint.
|
||||
|
||||
{{< children >}}
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
title: Create notification endpoints
|
||||
description: >
|
||||
Create notification endpoints to send alerts on your time series data.
|
||||
menu:
|
||||
v2_0:
|
||||
name: Create endpoints
|
||||
parent: Manage notification endpoints
|
||||
weight: 201
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
To send notifications about changes in your data, start by creating a notification endpoint to a third party service. After creating notification endpoints, [create notification rules](/v2.0/monitor-alert/notification-rules/create) to send alerts to third party services on [check statuses](/v2.0/monitor-alert/checks/create).
|
||||
|
||||
## Create a notification endpoint in the UI
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. Next to **Notification Endpoints**, click **Create**.
|
||||
3. From the **Destination** drop-down list, select a destination endpoint to send notifications.
|
||||
The following endpoints are available for InfluxDB 2.0 OSS, the InfluxDB Cloud 2.0 Free Plan,
|
||||
and the InfluxDB Cloud 2.0 Pay As You Go (PAYG) Plan:
|
||||
|
||||
| Endpoint | OSS | Free Plan _(Cloud)_ | PAYG Plan _(Cloud)_ |
|
||||
|:-------- |:--------:|:-------------------: |:----------------------------:|
|
||||
| **Slack** | _Coming_ | **{{< icon "check" >}}** | **{{< icon "check" >}}** |
|
||||
| **PagerDuty** | _Coming_ | | **{{< icon "check" >}}** |
|
||||
| **HTTP** | _Coming_ | | **{{< icon "check" >}}** |
|
||||
|
||||
4. In the **Name** and **Description** fields, enter a name and description for the endpoint.
|
||||
5. Enter enter information to connect to the endpoint:
|
||||
|
||||
- For HTTP, enter the **URL** to send the notification. Select the **auth method** to use: **None** for no authentication. To authenticate with a username and password, select **Basic** and then enter credentials in the **Username** and **Password** fields. To authenticate with a token, select **Bearer**, and then enter the authentication token in the **Token** field.
|
||||
|
||||
- For Slack, create an [Incoming WebHook](https://api.slack.com/incoming-webhooks#posting_with_webhooks) in Slack, and then enter your webHook URL in the **Slack Incoming WebHook URL** field.
|
||||
|
||||
- For PagerDuty, [create a new service](https://support.pagerduty.com/docs/services-and-integrations#section-create-a-new-service), [add an integration for your service](https://support.pagerduty.com/docs/services-and-integrations#section-add-integrations-to-an-existing-service), and then enter the PagerDuty integration key for your new service in the **Routing Key** field. By default, the PagerDuty client URL is https://events.pagerduty.com/v2/enqueue. For details, see [PagerDuty documentation](https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2).
|
||||
|
||||
6. Click **Create Notification Endpoint**.
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
title: Delete notification endpoints
|
||||
description: >
|
||||
Delete a notification endpoint in the InfluxDB UI.
|
||||
menu:
|
||||
v2_0:
|
||||
name: Delete endpoints
|
||||
parent: Manage notification endpoints
|
||||
weight: 204
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
If notifications are no longer sent to an endpoint, complete the steps below to delete the endpoint, and then [update notification rules](/v2.0/monitor-alert/notification-rules/update) with a new notification endpoint as needed.
|
||||
|
||||
## Delete a notification endpoint in the UI
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. Under **Notification Rules**, find the rule you want to delete.
|
||||
3. Click the delete icon, then click **Delete** to confirm.
|
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
title: Update notification endpoints
|
||||
description: >
|
||||
Update notification endpoints in the InfluxDB UI.
|
||||
menu:
|
||||
v2_0:
|
||||
name: Update endpoints
|
||||
parent: Manage notification endpoints
|
||||
weight: 203
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
To update the notification endpoint details, complete the following procedures as needed.
|
||||
|
||||
> **Note:** To update the notification endpoint selected for a notification rule, see [update notification rules](/v2.0/cloud/monitor-alert/update-notification-rules/).
|
||||
|
||||
## Add a label to notification endpoint
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. Under **Notification Endpoints**, click **Add a label** next to the endpoint you want to add a label to. The **Add Labels** box opens.
|
||||
3. To add an existing label, select the label from the list.
|
||||
4. To create and add a new label:
|
||||
|
||||
- In the search field, enter the name of the new label. The **Create Label** box opens.
|
||||
- In the **Description** field, enter an optional description for the label.
|
||||
- Select a color for the label.
|
||||
- Click **Create Label**.
|
||||
|
||||
5. To remove a label, hover over the label under an endpoint and click X.
|
||||
|
||||
|
||||
## Disable notification endpoint
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
|
||||
2. Under **Notification Endpoints**, find the endpoint you want to disable.
|
||||
3. Click the blue toggle to disable the notification endpoint.
|
||||
|
||||
## Update the name or description for notification endpoint
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
|
||||
2. Under **Notification Endpoints**, hover over the name or description of the endpoint.
|
||||
3. Click the pencil icon to edit the field.
|
||||
4. Click outside of the field to save your changes.
|
||||
|
||||
## Change endpoint details
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. Under **Notification Endpoints**, click the endpoint to update.
|
||||
3. Update details as needed, and then click **Edit a Notification Endpoint**. For details about each field, see [Create notification endpoints](/v2.0/monitor-alert/notification-endpoints/create/).
|
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
title: View notification endpoint history
|
||||
seotitle: View notification endpoint details and history
|
||||
description: >
|
||||
View notification endpoint details and history in the InfluxDB UI.
|
||||
menu:
|
||||
v2_0:
|
||||
name: View endpoint history
|
||||
parent: Manage notification endpoints
|
||||
weight: 202
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-rules/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
View notification endpoint details and history in the InfluxDB user interface (UI).
|
||||
|
||||
- [View notification endpoints](#view-notification-endpoints)
|
||||
- [View notification endpoint details](#view-notification-endpoint-details)
|
||||
- [View history notification endpoint history](#view-notification-endpoint-history), including statues and notifications sent to the endpoint
|
||||
|
||||
## View notification endpoints
|
||||
|
||||
- Click **Monitoring & Alerting** in the InfluxDB UI sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
In the **Notification Endpoints** column, view existing notification endpoints.
|
||||
|
||||
## View notification endpoint details
|
||||
|
||||
1. Click **Monitoring & Alerting** in the InfluxDB UI sidebar.
|
||||
2. In the **Notification Endpoints** column, click the name of the notification endpoint you want to view.
|
||||
3. View the notification endpoint destination, name, and information to connect to the endpoint.
|
||||
|
||||
## View notification endpoint history
|
||||
|
||||
1. Click **Monitoring & Alerting** in the InfluxDB UI sidebar.
|
||||
2. In the **Notification Endpoints** column, hover over the notification endpoint, click the **{{< icon "view" >}}** icon, then **View History**.
|
||||
The Check Statuses History page displays:
|
||||
|
||||
- Statuses generated for the selected notification endpoint
|
||||
- Notifications sent to the selected notification endpoint
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
title: Manage notification rules
|
||||
description: >
|
||||
Manage notification rules in InfluxDB.
|
||||
weight: 103
|
||||
v2.0/tags: [monitor, notifications, alert]
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Monitor & alert
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
The following articles provide information on managing your notification rules:
|
||||
|
||||
{{< children >}}
|
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
title: Create notification rules
|
||||
description: >
|
||||
Create notification rules to send alerts on your time series data.
|
||||
weight: 201
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Manage notification rules
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
Once you've set up checks and notification endpoints, create notification rules to alert you.
|
||||
_For details, see [Manage checks](/v2.0/monitor-alert/checks/) and
|
||||
[Manage notification endpoints](/v2.0/monitor-alert/notification-endpoints/)._
|
||||
|
||||
## Create a new notification rule in the UI
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. Under **Notification Rules**, click **+Create**.
|
||||
3. Complete the **About** section:
|
||||
1. In the **Name** field, enter a name for the notification rule.
|
||||
2. In the **Schedule Every** field, enter how frequently the rule should run.
|
||||
3. In the **Offset** field, enter an offset time. For example,if a task runs on the hour, a 10m offset delays the task to 10 minutes after the hour. Time ranges defined in the task are relative to the specified execution time.
|
||||
4. In the **Conditions** section, build a condition using a combination of status and tag keys.
|
||||
- Next to **When status is equal to**, select a status from the drop-down field.
|
||||
- Next to **AND When**, enter one or more tag key-value pairs to filter by.
|
||||
5. In the **Message** section, select an endpoint to notify.
|
||||
6. Click **Create Notification Rule**.
|
||||
|
||||
## Clone an existing notification rule in the UI
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. Under **Notification Rules**, hover over the rule you want to clone.
|
||||
3. Click the clone icon and select **Clone**. The cloned rule appears.
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: Delete notification rules
|
||||
description: >
|
||||
If you no longer need to receive an alert, delete the associated notification rule.
|
||||
weight: 204
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Manage notification rules
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
## Delete a notification rule in the UI
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. Under **Notification Rules**, find the rule you want to delete.
|
||||
3. Click the delete icon, then click **Delete** to confirm.
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
title: Update notification rules
|
||||
description: >
|
||||
Update notification rules to update the notification message or change the schedule or conditions.
|
||||
weight: 203
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Manage notification rules
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
## Add a label to notification rules
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
2. Under **Notification Rules**, click **Add a label** next to the rule you want to add a label to. The **Add Labels** box opens.
|
||||
3. To add an existing label, select the label from the list.
|
||||
4. To create and add a new label:
|
||||
- In the search field, enter the name of the new label. The **Create Label** box opens.
|
||||
- In the **Description** field, enter an optional description for the label.
|
||||
- Select a color for the label.
|
||||
- Click **Create Label**.
|
||||
5. To remove a label, hover over the label under to a rule and click X.
|
||||
|
||||
|
||||
## Disable notification rules
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
|
||||
2. Under **Notification Rules**, find the rule you want to disable.
|
||||
3. Click the blue toggle to disable the notification rule.
|
||||
|
||||
## Update the name or description for notification rules
|
||||
|
||||
1. Select the **Monitoring and Alerting** icon from the sidebar.
|
||||
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
|
||||
2. Under **Notification Rules**, hover over the name or description of a rule.
|
||||
3. Click the pencil icon to edit the field.
|
||||
4. Click outside of the field to save your changes.
|
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
title: View notification rules
|
||||
description: >
|
||||
Update notification rules to update the notification message or change the schedule or conditions.
|
||||
weight: 202
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Manage notification rules
|
||||
related:
|
||||
- /v2.0/monitor-alert/checks/
|
||||
- /v2.0/monitor-alert/notification-endpoints/
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
View notification rule details and statuses and notifications generated by notification rules in the InfluxDB user interface (UI).
|
||||
|
||||
- [View a list of all notification rules](#view-a-list-of-all-notification-rules)
|
||||
- [View notification rule details](#view-notification-rule-details)
|
||||
- [View statuses generated by a check](#view-statuses-generated-by-a-notification-rule)
|
||||
- [View notifications triggered by a notification rule](#view-notifications-triggered-by-a-notification-rule)
|
||||
|
||||
To view notification rules, click **Monitoring & Alerting** in the InfluxDB UI sidebar.
|
||||
|
||||
{{< nav-icon "alerts" >}}
|
||||
|
||||
## View a list of all notification rules
|
||||
The **Notification Rules** column on the Monitoring & Alerting landing page displays all existing checks.
|
||||
|
||||
## View notification rule details
|
||||
In the **Notification Rules** column, click the name of the check you want to view.
|
||||
The check builder appears.
|
||||
Here you can view the check query and logic.
|
||||
|
||||
## View statuses generated by a notification rule
|
||||
1. In the **Notification Rules** column, hover over the check, click the **{{< icon "view" >}}**
|
||||
icon, then **View History**.
|
||||
The Statuses History page displays statuses generated by the selected check.
|
||||
|
||||
## View notifications triggered by a notification rule
|
||||
1. In the **Notification Rules** column, hover over the notification rule, click the **{{< icon "view" >}}**
|
||||
icon, then **View History**.
|
||||
2. In the top left corner, click **Notifications**.
|
||||
The Notifications History page displays notifications initiated by the selected notification rule.
|
|
@ -14,14 +14,14 @@ to create a bucket.
|
|||
|
||||
## Create a bucket in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Select the **Buckets** tab.
|
||||
2. Select **Buckets**.
|
||||
3. Click **{{< icon "plus" >}} Create Bucket** in the upper right.
|
||||
4. Enter a **Name** for the bucket.
|
||||
5. Select **How often to clear data?**:
|
||||
5. Select **Delete Data older than**:
|
||||
Select **Never** to retain data forever.
|
||||
Select **Periodically** to define a specific retention policy.
|
||||
5. Click **Create** to create the bucket.
|
||||
|
|
|
@ -14,13 +14,13 @@ to delete a bucket.
|
|||
|
||||
## Delete a bucket in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Select the **Buckets** tab.
|
||||
2. Select **Buckets**.
|
||||
3. Hover over the bucket you would like to delete.
|
||||
4. Click **Delete** and **Confirm** to delete the bucket.
|
||||
4. Click **{{< icon "delete" >}} Delete Bucket** and **Delete** to delete the bucket.
|
||||
|
||||
## Delete a bucket using the influx CLI
|
||||
|
||||
|
|
|
@ -23,23 +23,23 @@ If you change a bucket name, be sure to update the bucket in the above places as
|
|||
|
||||
## Update a bucket's name in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Select the **Buckets** tab.
|
||||
2. Select **Buckets**.
|
||||
3. Hover over the name of the bucket you want to rename in the list.
|
||||
4. Click **Rename**.
|
||||
5. Review the information in the window that appears and click **I understand, let's rename my bucket**.
|
||||
6. Update the bucket's name and click **Change Bucket Name**.
|
||||
6. Update the bucket's name and click **Change Bucket Name**.
|
||||
|
||||
## Update a bucket's retention policy in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Select the **Buckets** tab.
|
||||
2. Select **Buckets**.
|
||||
3. Click the name of the bucket you want to update from the list.
|
||||
4. In the window that appears, edit the bucket's retention policy.
|
||||
5. Click **Save Changes**.
|
||||
|
|
|
@ -11,11 +11,11 @@ weight: 202
|
|||
|
||||
## View buckets in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Select the **Buckets** tab.
|
||||
2. Select **Buckets**.
|
||||
3. Click on a bucket to view details.
|
||||
|
||||
## View buckets using the influx CLI
|
||||
|
|
|
@ -30,6 +30,10 @@ As data is windowed into separate tables and processed, the `_time` column is dr
|
|||
This function copies the timestamp from a remaining column into the `_time` column.
|
||||
View the [function definition](#function-definition).
|
||||
|
||||
`aggregateWindow()` restores the original `_start` and `_stop` values of input data
|
||||
and, by default, uses `_stop` to set the `_time` value for each aggregated window.
|
||||
Each row in the output of `aggregateWindow` represents an aggregated window ending at `_time`.
|
||||
|
||||
## Parameters
|
||||
|
||||
{{% note %}}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
title: kaufmansAMA() function
|
||||
description: >
|
||||
The `kaufmansAMA()` function calculates the Kaufman's Adaptive Moving Average (KAMA)
|
||||
using values in an input table.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: kaufmansAMA
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
related:
|
||||
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmanser/
|
||||
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#kaufmans-adaptive-moving-average, InfluxQL KAUFMANS_ADAPTIVE_MOVING_AVERAGE()
|
||||
---
|
||||
|
||||
The `kaufmansAMA()` function calculates the Kaufman's Adaptive Moving Average (KAMA)
|
||||
using values in an input table.
|
||||
|
||||
_**Function type:** Aggregate_
|
||||
|
||||
```js
|
||||
kaufmansAMA(
|
||||
n: 10,
|
||||
column: "_value"
|
||||
)
|
||||
```
|
||||
|
||||
Kaufman's Adaptive Moving Average is a trend-following indicator designed to account
|
||||
for market noise or volatility.
|
||||
|
||||
## Parameters
|
||||
|
||||
### n
|
||||
The period or number of points to use in the calculation.
|
||||
|
||||
_**Data type: Integer**_
|
||||
|
||||
### column
|
||||
The column to operate on.
|
||||
Defaults to `"_value"`.
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
## Examples
|
||||
```js
|
||||
from(bucket: "telegraf/autogen"):
|
||||
|> range(start: -7d)
|
||||
|> kaufmansAMA(
|
||||
n: 10,
|
||||
column: "_value"
|
||||
)
|
||||
```
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
title: kaufmansER() function
|
||||
description: >
|
||||
The `kaufmansER()` function calculates the Kaufman's Efficiency Ratio (KER) using
|
||||
values in an input table.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: kaufmansER
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
related:
|
||||
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmansama/
|
||||
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#kaufmans-efficiency-ratio, InfluxQL KAUFMANS_EFFICIENCY_RATIO()
|
||||
---
|
||||
|
||||
The `kaufmansER()` function calculates the Kaufman's Efficiency Ratio (KER) using
|
||||
values in an input table.
|
||||
The function operates on the `_value` column.
|
||||
|
||||
_**Function type:** Aggregate_
|
||||
|
||||
```js
|
||||
kaufmansER(n: 10)
|
||||
```
|
||||
|
||||
Kaufman's Efficiency Ratio indicator divides the absolute value of the
|
||||
Chande Momentum Oscillator by 100 to return a value between 0 and 1.
|
||||
Higher values represent a more efficient or trending market.
|
||||
|
||||
## Parameters
|
||||
|
||||
### n
|
||||
The period or number of points to use in the calculation.
|
||||
|
||||
_**Data type: Integer**_
|
||||
|
||||
## Examples
|
||||
```js
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -7d)
|
||||
|> kaufmansER(n: 10)
|
||||
```
|
|
@ -19,7 +19,8 @@ _**Function type:** Aggregate_
|
|||
mode(column: "_value")
|
||||
```
|
||||
|
||||
Multiple modes are returned in a sorted table.
|
||||
If there are multiple modes, it returns all of them in a sorted table.
|
||||
Mode only considers non-null values.
|
||||
If there is no mode, `mode()` returns `null`.
|
||||
|
||||
##### Supported data types
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
---
|
||||
title: tripleExponentialDerivative() function
|
||||
description: >
|
||||
The `tripleExponentialDerivative()` function calculates a triple exponential
|
||||
derivative (TRIX) of input tables using `n` points.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: tripleExponentialDerivative
|
||||
parent: built-in-aggregates
|
||||
weight: 501
|
||||
v2.0/tags: [technical analysis]
|
||||
related:
|
||||
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/movingaverage/
|
||||
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/doubleema/
|
||||
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/tripleema/
|
||||
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/timedmovingaverage/
|
||||
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/
|
||||
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#triple-exponential-derivative, InfluxQL TRIPLE_EXPONENTIAL_DERIVATIVE()
|
||||
---
|
||||
|
||||
The `tripleExponentialDerivative()` function calculates a triple exponential
|
||||
derivative ([TRIX](https://en.wikipedia.org/wiki/Trix_(technical_analysis))) of
|
||||
input tables using `n` points.
|
||||
|
||||
_**Function type:** Aggregate_
|
||||
|
||||
```js
|
||||
tripleExponentialDerivative(n: 5)
|
||||
```
|
||||
|
||||
Triple exponential derivative, commonly referred to as “TRIX,” is a momentum indicator and oscillator.
|
||||
A triple exponential derivative uses the natural logarithm (log) of input data to
|
||||
calculate a triple exponential moving average over the period of time.
|
||||
The calculation prevents cycles shorter than the defined period from being considered by the indicator.
|
||||
`tripleExponentialDerivative()` uses the time between `n` points to define the period.
|
||||
|
||||
Triple exponential derivative oscillates around a zero line.
|
||||
A positive momentum **oscillator** value indicates an overbought market;
|
||||
a negative value indicates an oversold market.
|
||||
A positive momentum **indicator** value indicates increasing momentum;
|
||||
a negative value indicates decreasing momentum.
|
||||
|
||||
##### Triple exponential moving average rules
|
||||
- A triple exponential derivative is defined as:
|
||||
- `TRIX[i] = ((EMA3[i] / EMA3[i - 1]) - 1) * 100`:
|
||||
- `EMA_3 = EMA(EMA(EMA(data)))`
|
||||
- If there are not enough values to calculate a triple exponential derivative,
|
||||
the output `_value` is `NaN`; all other columns are the same as the _last_ record of the input table.
|
||||
- The function behaves the same way as the [`exponentialMovingAverage()`](/v2.0/reference/flux/functions/built-in/transformations/aggregates/exponentialmovingaverage/) function:
|
||||
- The function does not include `null` values in the calculation.
|
||||
- The function acts only on the `_value` column.
|
||||
|
||||
## Parameters
|
||||
|
||||
### n
|
||||
The number of points to use in the calculation.
|
||||
|
||||
_**Data type:** Integer_
|
||||
|
||||
## Examples
|
||||
|
||||
#### Calculate a five point triple exponential derivative
|
||||
```js
|
||||
from(bucket: "example-bucket"):
|
||||
|> range(start: -12h)
|
||||
|> tripleExponentialDerivative(n: 5)
|
||||
```
|
|
@ -26,26 +26,24 @@ range(start: -15m, stop: now())
|
|||
## Parameters
|
||||
|
||||
### 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.
|
||||
Negative durations are relative to now.
|
||||
Absolute start times are defined using timestamps.
|
||||
|
||||
_**Data type:** Duration or Timestamp_
|
||||
_**Data type:** Duration | Time_
|
||||
|
||||
### 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.
|
||||
Negative durations are relative to now.
|
||||
Absolute stop times are defined using timestamps.
|
||||
|
||||
_**Data type:** Duration or Timestamp_
|
||||
_**Data type:** Duration | Time_
|
||||
|
||||
{{% note %}}
|
||||
Flux only honors [RFC3339 timestamps](/v2.0/reference/flux/language/types#timestamp-format)
|
||||
and ignores dates and times provided in other formats.
|
||||
Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
|
||||
{{% /note %}}
|
||||
|
||||
## Examples
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
title: truncateTimeColumn() function
|
||||
description: >
|
||||
The `truncateTimeColumn()` function truncates all input table `_time` values to a specified unit.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: truncateTimeColumn
|
||||
parent: built-in-transformations
|
||||
weight: 401
|
||||
related:
|
||||
- /v2.0/reference/flux/functions/date/truncate/
|
||||
---
|
||||
|
||||
The `truncateTimeColumn()` function truncates all input table `_time` values to a specified unit.
|
||||
|
||||
_**Function type:** Transformation_
|
||||
|
||||
```js
|
||||
truncateTimeColumn(unit: 1s)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### unit
|
||||
The unit of time to truncate to.
|
||||
|
||||
_**Data type:** Duration_
|
||||
|
||||
{{% note %}}
|
||||
Only use `1` and the unit of time to specify the `unit`.
|
||||
For example: `1s`, `1m`, `1h`.
|
||||
{{% /note %}}
|
||||
|
||||
## Examples
|
||||
|
||||
##### Truncate all time values to seconds
|
||||
```js
|
||||
from(bucket:"example-bucket")
|
||||
|> range(start:-1h)
|
||||
|> truncateTimeColumn(unit: 1s)
|
||||
```
|
||||
|
||||
## Function definition
|
||||
```js
|
||||
import "date"
|
||||
|
||||
truncateTimeColumn = (unit, tables=<-) =>
|
||||
tables
|
||||
|> map(fn: (r) => ({
|
||||
r with _time: date.truncate(t: r._time, unit:unit)
|
||||
})
|
||||
)
|
||||
```
|
|
@ -25,8 +25,7 @@ The value to convert.
|
|||
## Examples
|
||||
```js
|
||||
from(bucket: "sensor-data")
|
||||
|> filter(fn:(r) =>
|
||||
r._measurement == "system" and
|
||||
)
|
||||
|> range(start: -1m)
|
||||
|> filter(fn:(r) => r._measurement == "system" )
|
||||
|> map(fn:(r) => ({ r with responsive: bool(v: r.responsive) }))
|
||||
```
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
title: bytes() function
|
||||
description: The `bytes()` function converts a single value to bytes.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: bytes
|
||||
parent: built-in-type-conversions
|
||||
weight: 502
|
||||
---
|
||||
|
||||
The `bytes()` function converts a single value to bytes.
|
||||
|
||||
_**Function type:** Type conversion_
|
||||
_**Output data type:** Bytes_
|
||||
|
||||
```js
|
||||
bytes(v: "1m")
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### v
|
||||
The value to convert.
|
||||
|
||||
## Examples
|
||||
```js
|
||||
from(bucket: "sensor-data")
|
||||
|> range(start: -1m)
|
||||
|> map(fn:(r) => ({ r with _value: bytes(v: r._value) }))
|
||||
```
|
|
@ -25,8 +25,7 @@ The value to convert.
|
|||
## Examples
|
||||
```js
|
||||
from(bucket: "sensor-data")
|
||||
|> filter(fn:(r) =>
|
||||
r._measurement == "system" and
|
||||
)
|
||||
|> range(start: -1m)
|
||||
|> filter(fn:(r) => r._measurement == "system" )
|
||||
|> map(fn:(r) => ({ r with uptime: duration(v: r.uptime) }))
|
||||
```
|
||||
|
|
|
@ -25,8 +25,7 @@ The value to convert.
|
|||
## Examples
|
||||
```js
|
||||
from(bucket: "sensor-data")
|
||||
|> filter(fn:(r) =>
|
||||
r._measurement == "camera" and
|
||||
)
|
||||
|> range(start: -1m)
|
||||
|> filter(fn:(r) => r._measurement == "camera" )
|
||||
|> map(fn:(r) => ({ r with aperature: float(v: r.aperature) }))
|
||||
```
|
||||
|
|
|
@ -25,8 +25,7 @@ The value to convert.
|
|||
## Examples
|
||||
```js
|
||||
from(bucket: "sensor-data")
|
||||
|> filter(fn:(r) =>
|
||||
r._measurement == "camera" and
|
||||
)
|
||||
|> range(start: -1m)
|
||||
|> filter(fn:(r) => r._measurement == "camera" )
|
||||
|> map(fn:(r) => ({ r with exposures: int(v: r.exposures) }))
|
||||
```
|
||||
|
|
|
@ -25,8 +25,7 @@ The value to convert.
|
|||
## Examples
|
||||
```js
|
||||
from(bucket: "sensor-data")
|
||||
|> filter(fn:(r) =>
|
||||
r._measurement == "system" and
|
||||
)
|
||||
|> range(start: -1m)
|
||||
|> filter(fn:(r) => r._measurement == "system" )
|
||||
|> map(fn:(r) => ({ r with model_number string(v: r.model_number) }))
|
||||
```
|
||||
|
|
|
@ -25,8 +25,7 @@ The value to convert.
|
|||
## Examples
|
||||
```js
|
||||
from(bucket: "sensor-data")
|
||||
|> filter(fn:(r) =>
|
||||
r._measurement == "system" and
|
||||
)
|
||||
|> range(start: -1m)
|
||||
|> filter(fn:(r) => r._measurement == "system" )
|
||||
|> map(fn:(r) => ({ r with timestamp: time(v: r.timestamp) }))
|
||||
```
|
||||
|
|
|
@ -25,8 +25,7 @@ The value to convert.
|
|||
## Examples
|
||||
```js
|
||||
from(bucket: "sensor-data")
|
||||
|> filter(fn:(r) =>
|
||||
r._measurement == "camera" and
|
||||
)
|
||||
|> range(start: -1m)
|
||||
|> filter(fn:(r) => r._measurement == "camera" )
|
||||
|> map(fn:(r) => ({ r with exposures: uint(v: r.exposures) }))
|
||||
```
|
||||
|
|
|
@ -32,7 +32,7 @@ The time to operate on.
|
|||
_**Data type:** Time_
|
||||
|
||||
### unit
|
||||
The unit time to truncate to.
|
||||
The unit of time to truncate to.
|
||||
|
||||
_**Data type:** Duration_
|
||||
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: Flux HTTP package
|
||||
list_title: HTTP package
|
||||
description: >
|
||||
The Flux HTTP package provides functions for transferring data using the HTTP protocol.
|
||||
Import the `http` package.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: HTTP
|
||||
parent: Flux packages and functions
|
||||
weight: 202
|
||||
v2.0/tags: [functions, http, package]
|
||||
---
|
||||
|
||||
The Flux HTTP package provides functions for transferring data using the HTTP protocol.
|
||||
Import the `http` package:
|
||||
|
||||
```js
|
||||
import "http"
|
||||
```
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
title: http.basicAuth() function
|
||||
description: >
|
||||
The `http.basicAuth()` function returns a Base64-encoded basic authentication
|
||||
header using a specified username and password combination.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: http.basicAuth
|
||||
parent: HTTP
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `http.basicAuth()` function returns a Base64-encoded basic authentication
|
||||
header using a specified username and password combination.
|
||||
|
||||
_**Function type:** Miscellaneous_
|
||||
|
||||
```js
|
||||
import "http"
|
||||
|
||||
http.basicAuth(
|
||||
u: "username"
|
||||
p: "passw0rd"
|
||||
)
|
||||
|
||||
// Returns "Basic dXNlcm5hbWU6cGFzc3cwcmQ="
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### u
|
||||
The username to use in the basic authentication header.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### p
|
||||
The password to use in the basic authentication header.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
## Examples
|
||||
|
||||
##### Set a basic authentication header in an HTTP POST request
|
||||
```js
|
||||
import "monitor"
|
||||
import "http"
|
||||
|
||||
username = "myawesomeuser"
|
||||
password = "mySupErSecRetPasSW0rD"
|
||||
|
||||
http.post(
|
||||
url: "http://myawesomesite.com/api/",
|
||||
headers: {Authorization: http.basicAuth(u:username, p:password)},
|
||||
data: bytes(v: "something I want to send.")
|
||||
)
|
||||
```
|
|
@ -0,0 +1,64 @@
|
|||
---
|
||||
title: http.endpoint() function
|
||||
description: >
|
||||
The `http.endpoint()` function sends output data to an HTTP URL using the POST request method.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: http.endpoint
|
||||
parent: HTTP
|
||||
weight: 202
|
||||
v2.0/tags: [endpoints]
|
||||
---
|
||||
|
||||
The `http.endpoint()` function sends output data to an HTTP URL using the POST request method.
|
||||
|
||||
_**Function type:** Output_
|
||||
|
||||
```js
|
||||
import "http"
|
||||
|
||||
http.endpoint(
|
||||
url: "http://localhost:1234/"
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### url
|
||||
The URL to POST to.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### mapFn
|
||||
A function that builds the object used to generate the POST request.
|
||||
|
||||
{{% note %}}
|
||||
_You should rarely need to override the default `mapFn` parameter.
|
||||
To see the default `mapFn` value or for insight into possible overrides, view the
|
||||
[`http.endpoint()` source code](https://github.com/influxdata/flux/blob/master/stdlib/http/http.flux)._
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type:** Function_
|
||||
|
||||
The returned object must include the following fields:
|
||||
|
||||
- `headers`
|
||||
- `data`
|
||||
|
||||
_For more information, see [`http.post()`](/v2.0/reference/flux/functions/http/post/)_
|
||||
|
||||
## Examples
|
||||
|
||||
##### Send critical statuses to an HTTP endpoint
|
||||
```js
|
||||
import "monitor"
|
||||
import "http"
|
||||
|
||||
endpoint = http.endpoint(url: "http://myawsomeurl.com/api/notify")
|
||||
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -1m)
|
||||
|> filter(fn: (r) => r._measurement == "statuses" and status == "crit")
|
||||
|> map(fn: (r) => { return {status: r._status} })
|
||||
|> monitor.notify(endpoint: endpoint)
|
||||
```
|
|
@ -0,0 +1,64 @@
|
|||
---
|
||||
title: http.post() function
|
||||
description: >
|
||||
The `http.post()` function submits an HTTP POST request to the specified URL with headers and data.
|
||||
The HTTP status code is returned.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: http.post
|
||||
parent: HTTP
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `http.post()` function submits an HTTP POST request to the specified URL with
|
||||
headers and data and returns the HTTP status code.
|
||||
|
||||
_**Function type:** Output_
|
||||
|
||||
```js
|
||||
import "http"
|
||||
|
||||
http.post(
|
||||
url: "http://localhost:9999/",
|
||||
headers: {x:"a", y:"b", z:"c"},
|
||||
data: bytes(v: "body")
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### url
|
||||
The URL to POST to.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### headers
|
||||
Headers to include with the POST request.
|
||||
|
||||
_**Data type:** Object_
|
||||
|
||||
### data
|
||||
The data body to include with the POST request.
|
||||
|
||||
_**Data type:** Bytes_
|
||||
|
||||
## Examples
|
||||
|
||||
##### Send the last reported status to a URL
|
||||
```js
|
||||
import "json"
|
||||
import "http"
|
||||
|
||||
lastReported =
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -1m)
|
||||
|> filter(fn: (r) => r._measurement == "statuses")
|
||||
|> last()
|
||||
|> map(fn: (r) => { return {status: r._status} })
|
||||
|
||||
http.post(
|
||||
url: "http://myawsomeurl.com/api/notify",
|
||||
headers: {Authorization: "Bearer mySuPerSecRetTokEn"},
|
||||
data: bytes(v: lastReported)
|
||||
)
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: Flux JSON package
|
||||
list_title: JSON package
|
||||
description: >
|
||||
The Flux JSON package provides functions for working with JSON.
|
||||
Import the `json` package.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: JSON
|
||||
parent: Flux packages and functions
|
||||
weight: 202
|
||||
v2.0/tags: [functions, json, package]
|
||||
---
|
||||
|
||||
JSON Flux functions provide tools for working with JSON.
|
||||
Import the `json` package:
|
||||
|
||||
```js
|
||||
import "json"
|
||||
```
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
title: json.encode() function
|
||||
description: The `json.encode()` function converts a value into JSON bytes.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: json.encode
|
||||
parent: JSON
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `json.encode()` function converts a value into JSON bytes.
|
||||
|
||||
_**Function type:** Type conversion_
|
||||
|
||||
```js
|
||||
import "json"
|
||||
|
||||
json.encode(v: "some value")
|
||||
```
|
||||
|
||||
This function encodes [Flux types](/v2.0/reference/flux/language/types/) as follows:
|
||||
|
||||
- `time` values in [RFC3339](https://tools.ietf.org/html/rfc3339) format
|
||||
- `duration` values in number of milliseconds since the epoch
|
||||
- `regexp` values as their string representation
|
||||
- `bytes` values as base64-encoded strings
|
||||
- `function` values are not encoded and produce an error
|
||||
|
||||
## Parameters
|
||||
|
||||
### v
|
||||
The value to convert.
|
||||
|
||||
_**Data type:** Boolean | Duration | Float | Integer | String | Time | UInteger_
|
||||
|
||||
## Examples
|
||||
|
||||
### Encode all values in a column in JSON bytes
|
||||
```js
|
||||
import "json"
|
||||
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -1h)
|
||||
|> map(fn: (r) => ({
|
||||
r with _value: json.encode(v: r._value)
|
||||
}))
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: Flux InfluxDB Monitor package
|
||||
list_title: InfluxDB Monitor package
|
||||
description: >
|
||||
The Flux Monitor package provides tools for monitoring and alerting with InfluxDB.
|
||||
Import the `influxdata/influxdb/monitor` package.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: InfluxDB Monitor
|
||||
parent: Flux packages and functions
|
||||
weight: 202
|
||||
v2.0/tags: [functions, monitor, alerts, package]
|
||||
---
|
||||
|
||||
The Flux monitor package provides tools for monitoring and alerting with InfluxDB.
|
||||
Import the `influxdata/influxdb/monitor` package:
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
```
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,95 @@
|
|||
---
|
||||
title: monitor.check() function
|
||||
description: >
|
||||
The `monitor.check()` function function checks input data and assigns a level
|
||||
(`ok`, `info`, `warn`, or `crit`) to each row based on predicate functions.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: monitor.check
|
||||
parent: InfluxDB Monitor
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `monitor.check()` function function checks input data and assigns a level
|
||||
(`ok`, `info`, `warn`, or `crit`) to each row based on predicate functions.
|
||||
|
||||
_**Function type:** Transformation_
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
monitor.check(
|
||||
crit: (r) => r._value > 90.0,
|
||||
warn: (r) => r._value > 80.0,
|
||||
info: (r) => r._value > 60.0,
|
||||
ok: (r) => r._value <= 20.0,
|
||||
messageFn: (r) => "The current level is ${r._level}",
|
||||
data: {}
|
||||
)
|
||||
```
|
||||
|
||||
`monitor.check()` stores statuses in the `_level` column and writes results
|
||||
to the `statuses` measurement in the `_monitoring` bucket.
|
||||
|
||||
## Parameters
|
||||
|
||||
### crit
|
||||
Predicate function that determines `crit` status.
|
||||
Default is `(r) => false`.
|
||||
|
||||
_**Data type:** Function_
|
||||
|
||||
### warn
|
||||
Predicate function that determines `warn` status.
|
||||
Default is `(r) => false`.
|
||||
|
||||
_**Data type:** Function_
|
||||
|
||||
### info
|
||||
Predicate function that determines `info` status.
|
||||
Default is `(r) => false`.
|
||||
|
||||
_**Data type:** Function_
|
||||
|
||||
### ok
|
||||
Predicate function that determines `ok` status.
|
||||
Default is `(r) => true`.
|
||||
|
||||
_**Data type:** Function_
|
||||
|
||||
### messageFn
|
||||
A function that constructs a message to append to each row.
|
||||
The message is stored in the `_message` column.
|
||||
|
||||
_**Data type:** Function_
|
||||
|
||||
### data
|
||||
Data to append to the output.
|
||||
**InfluxDB populates check data.**
|
||||
|
||||
_**Data type:** Object_
|
||||
|
||||
## Examples
|
||||
|
||||
### Monitor disk usage
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
from(bucket: "telegraf")
|
||||
|> range(start: -1h)
|
||||
|> filter(fn: (r) =>
|
||||
r._measurement == "disk" and
|
||||
r._field = "used_percent"
|
||||
)
|
||||
|> monitor.check(
|
||||
crit: (r) => r._value > 90.0,
|
||||
warn: (r) => r._value > 80.0,
|
||||
info: (r) => r._value > 70.0,
|
||||
ok: (r) => r._value <= 60.0,
|
||||
messageFn: (r) =>
|
||||
if r._level == "crit" then "Critical alert!! Disk usage is at ${r._value}%!"
|
||||
else if r._level == "warn" then "Warning! Disk usage is at ${r._value}%."
|
||||
else if r._level == "info" then "Disk usage is at ${r._value}%."
|
||||
else "Things are looking good."
|
||||
)
|
||||
```
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
title: monitor.deadman() function
|
||||
description: >
|
||||
The `monitor.deadman()` function detects when a group stops reporting data.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: monitor.deadman
|
||||
parent: InfluxDB Monitor
|
||||
weight: 202
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
The `monitor.deadman()` function detects when a group stops reporting data.
|
||||
It takes a stream of tables and reports if groups have been observed since time `t`.
|
||||
|
||||
_**Function type:** Transformation_
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
monitor.deadman(t: 2019-08-30T12:30:00Z)
|
||||
```
|
||||
|
||||
`monitor.deadman()` retains the most recent row from each input table and adds a `dead` column.
|
||||
If a record appears **after** time `t`, `monitor.deadman()` sets `dead` to `false`.
|
||||
Otherwise, `dead` is set to `true`.
|
||||
|
||||
## Parameters
|
||||
|
||||
### t
|
||||
The time threshold for the deadman check.
|
||||
|
||||
_**Data type:** Time_
|
||||
|
||||
## Examples
|
||||
|
||||
### Detect if a host hasn't reported in the last five minutes
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
import "experimental"
|
||||
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -10m)
|
||||
|> group(columns: ["host"])
|
||||
|> monitor.deadman(t: experimental.subDuration(d: 5m, from: now() ))
|
||||
```
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
title: monitor.from() function
|
||||
description: >
|
||||
The `monitor.from()` function retrieves check statuses stored in the `statuses`
|
||||
measurement in the `_monitoring` bucket.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: monitor.from
|
||||
parent: InfluxDB Monitor
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `monitor.from()` function retrieves check statuses stored in the `statuses`
|
||||
measurement in the `_monitoring` bucket.
|
||||
|
||||
_**Function type:** Input_
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
monitor.from(
|
||||
start: -1h,
|
||||
stop: now(),
|
||||
fn: (r) => true
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
### start
|
||||
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()`.
|
||||
|
||||
_**Data type:** Duration | Time_
|
||||
|
||||
### stop
|
||||
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()`.
|
||||
|
||||
_**Data type:** Duration | Time_
|
||||
|
||||
{{% note %}}
|
||||
Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
|
||||
{{% /note %}}
|
||||
|
||||
### 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
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
monitor.from(
|
||||
start: -1h,
|
||||
fn: (r) => r._level == "crit"
|
||||
)
|
||||
```
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
title: monitor.logs() function
|
||||
description: >
|
||||
The `monitor.logs()` function retrieves notification events stored in the `notifications`
|
||||
measurement in the `_monitoring` bucket.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: monitor.logs
|
||||
parent: InfluxDB Monitor
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `monitor.logs()` function retrieves notification events stored in the `notifications`
|
||||
measurement in the `_monitoring` bucket.
|
||||
|
||||
_**Function type:** Input_
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
monitor.logs(
|
||||
start: -1h,
|
||||
stop: now(),
|
||||
fn: (r) => true
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### start
|
||||
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()`.
|
||||
|
||||
_**Data type:** Duration | Time_
|
||||
|
||||
### stop
|
||||
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()`.
|
||||
|
||||
_**Data type:** Duration | Time_
|
||||
|
||||
{{% note %}}
|
||||
Time values in Flux must be in [RFC3339 format](/v2.0/reference/flux/language/types#timestamp-format).
|
||||
{{% /note %}}
|
||||
|
||||
### 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
|
||||
|
||||
### Query notification events from the last hour
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
monitor.logs(start: -1h)
|
||||
```
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
title: monitor.notify() function
|
||||
description: >
|
||||
The `monitor.notify()` function sends a notification to an endpoint and logs it
|
||||
in the `notifications` measurement in the `_monitoring` bucket.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: monitor.notify
|
||||
parent: InfluxDB Monitor
|
||||
weight: 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_
|
||||
|
||||
```js
|
||||
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
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
import "slack"
|
||||
|
||||
endpoint = slack.endpoint(name: "slack", channel: "#flux")
|
||||
|
||||
from(bucket: "system")
|
||||
|> range(start: -5m)
|
||||
|> monitor.notify(endpoint: endpoint)
|
||||
```
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
title: monitor.stateChanges() function
|
||||
description: >
|
||||
The `monitor.stateChanges()` function detects state changes in a stream of data and
|
||||
outputs records that change from `fromLevel` to `toLevel`.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: monitor.stateChanges
|
||||
parent: InfluxDB Monitor
|
||||
weight: 202
|
||||
cloud_all: true
|
||||
---
|
||||
|
||||
The `monitor.stateChanges()` function detects state changes in a stream of data and
|
||||
outputs records that change from `fromLevel` to `toLevel`.
|
||||
|
||||
{{% note %}}
|
||||
`monitor.stateChanges` operates on data in the `statuses` measurement and requires a `_level` column .
|
||||
{{% /note %}}
|
||||
|
||||
_**Function type:** Transformation_
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
monitor.stateChanges(
|
||||
fromLevel: "any",
|
||||
toLevel: "crit"
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### fromLevel
|
||||
The level to detect a change from.
|
||||
Defaults to `"any"`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### toLevel
|
||||
The level to detect a change to.
|
||||
The function output records that change to this level.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
## Examples
|
||||
|
||||
### Detect when the state changes to critical
|
||||
```js
|
||||
import "influxdata/influxdb/monitor"
|
||||
|
||||
monitor.from(start: -1h)
|
||||
|> monitor.stateChanges(toLevel: "crit")
|
||||
```
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title: Flux MQTT package
|
||||
list_title: MQTT package
|
||||
description: >
|
||||
The Flux MQTT package provides functions for working with MQTT protocol.
|
||||
Import the `mqtt` package.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: MQTT
|
||||
parent: Flux packages and functions
|
||||
weight: 202
|
||||
v2.0/tags: [functions, mqtt, package]
|
||||
draft: true
|
||||
---
|
||||
|
||||
MQTT Flux functions provide tools for working with Message Queuing Telemetry Transport (MQTT) protocol.
|
||||
Import the `mqtt` package:
|
||||
|
||||
```js
|
||||
import "mqtt"
|
||||
```
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,130 @@
|
|||
---
|
||||
title: mqtt.to() function
|
||||
description: >
|
||||
The `mqtt.to()` function outputs data to an MQTT broker using MQTT protocol.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: mqtt.to
|
||||
parent: MQTT
|
||||
weight: 202
|
||||
draft: true
|
||||
---
|
||||
|
||||
The `mqtt.to()` function outputs data to an MQTT broker using MQTT protocol.
|
||||
|
||||
_**Function type:** Output_
|
||||
|
||||
```js
|
||||
import "mqtt"
|
||||
|
||||
mqtt.to(
|
||||
broker: "tcp://localhost:8883",
|
||||
topic: "example-topic",
|
||||
message: "Example message",
|
||||
qos: 0,
|
||||
clientid: "flux-mqtt",
|
||||
username: "username",
|
||||
password: "password",
|
||||
name: "name-example",
|
||||
timeout: 1s,
|
||||
timeColumn: "_time",
|
||||
tagColumns: ["tag1", "tag2"],
|
||||
valueColumns: ["_value"]
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### broker
|
||||
The MQTT broker connection string.
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
### topic
|
||||
The MQTT topic to send data to.
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
### message
|
||||
The message or payload to send to the MQTT broker.
|
||||
The default payload is an output table.
|
||||
If there are multiple output tables, it sends each table as a separate MQTT message.
|
||||
|
||||
{{% note %}}
|
||||
When you specify a message, the function sends the message string only (no output table).
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
### qos
|
||||
The [MQTT Quality of Service (QoS)](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901103) level.
|
||||
Values range from `[0-2]`.
|
||||
Default is `0`.
|
||||
|
||||
_**Data type: Integer**_
|
||||
|
||||
### clientid
|
||||
The MQTT client ID.
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
### username
|
||||
The username to send to the MQTT broker.
|
||||
Username is only required if the broker requires authentication.
|
||||
If you provide a username, you must provide a [password](#password).
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
### password
|
||||
The password to send to the MQTT broker.
|
||||
Password is only required if the broker requires authentication.
|
||||
If you provide a password, you must provide a [username](#username).
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
### name
|
||||
_(Optional)_ The name for the MQTT message.
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
### timeout
|
||||
The MQTT connection timeout.
|
||||
Default is `1s`.
|
||||
|
||||
_**Data type: Duration**_
|
||||
|
||||
### timeColumn
|
||||
The column to use as time values in the output line protocol.
|
||||
Default is `"_time"`.
|
||||
|
||||
_**Data type: String**_
|
||||
|
||||
### tagColumns
|
||||
The columns to use as tag sets in the output line protocol.
|
||||
Default is `[]`.
|
||||
|
||||
_**Data type: Array of strings**_
|
||||
|
||||
### valueColumns
|
||||
The columns to use as field values in the output line protocol.
|
||||
Default is `["_value"]`.
|
||||
|
||||
_**Data type: Array of strings**_
|
||||
|
||||
## Examples
|
||||
|
||||
### Send data to an MQTT endpoint
|
||||
```js
|
||||
import "mqtt"
|
||||
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -5m)
|
||||
|> filter(fn: (r) => r._measurement == "airSensor")
|
||||
|> mqtt.to(
|
||||
broker: "tcp://localhost:8883",
|
||||
topic: "air-sensors",
|
||||
clientid: "sensor-12a4",
|
||||
tagColumns: ["sensorID"],
|
||||
valueColumns: ["_value"]
|
||||
)
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: Flux PagerDuty package
|
||||
list_title: PagerDuty package
|
||||
description: >
|
||||
The Flux PagerDuty package provides functions for sending data to PagerDuty.
|
||||
Import the `pagerduty` package.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: PagerDuty
|
||||
parent: Flux packages and functions
|
||||
weight: 202
|
||||
v2.0/tags: [functions, pagerduty, package]
|
||||
---
|
||||
|
||||
The Flux PagerDuty package provides functions for sending data to PagerDuty.
|
||||
Import the `pagerduty` package:
|
||||
|
||||
```js
|
||||
import "pagerduty"
|
||||
```
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
title: pagerduty.actionFromSeverity() function
|
||||
description: >
|
||||
The `pagerduty.actionFromSeverity()` function converts a severity to a PagerDuty action.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: pagerduty.actionFromSeverity
|
||||
parent: PagerDuty
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `pagerduty.actionFromSeverity()` function converts a severity to a PagerDuty action.
|
||||
`ok` converts to `resolve`.
|
||||
All other severities convert to `trigger`.
|
||||
|
||||
_**Function type:** Transformation_
|
||||
|
||||
```js
|
||||
import "pagerduty"
|
||||
|
||||
pagerduty.actionFromSeverity(
|
||||
severity: "ok"
|
||||
)
|
||||
|
||||
// Returns "resolve"
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### severity
|
||||
The severity to convert to a PagerDuty action.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
## Function definition
|
||||
```js
|
||||
import "strings"
|
||||
|
||||
actionFromSeverity = (severity) =>
|
||||
if strings.toLower(v: severity) == "ok" then "resolve"
|
||||
else "trigger"
|
||||
```
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
title: pagerduty.dedupKey() function
|
||||
description: >
|
||||
The `pagerduty.dedupKey()` function uses the group key of an input table to
|
||||
generate and store a deduplication key in the `_pagerdutyDedupKey` column.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: pagerduty.dedupKey
|
||||
parent: PagerDuty
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `pagerduty.dedupKey()` function uses the group key of an input table to
|
||||
generate and store a deduplication key in the `_pagerdutyDedupKey` column.
|
||||
The function sorts, newline-concatenates, SHA256-hashes, and hex-encodes
|
||||
the group key to create a unique deduplication key for each input table.
|
||||
|
||||
_**Function type:** Transformation_
|
||||
|
||||
```js
|
||||
import "pagerduty"
|
||||
|
||||
pagerduty.dedupKey()
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
##### Add a PagerDuty deduplication key to output data
|
||||
```js
|
||||
import "pagerduty"
|
||||
|
||||
from(bucket: "default")
|
||||
|> range(start: -5m)
|
||||
|> filter(fn: (r) => r._measurement == "mem")
|
||||
|> pagerduty.dedupKey()
|
||||
```
|
|
@ -0,0 +1,73 @@
|
|||
---
|
||||
title: pagerduty.endpoint() function
|
||||
description: >
|
||||
The `pagerduty.endpoint()` function sends a message to PagerDuty that includes output data.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: pagerduty.endpoint
|
||||
parent: PagerDuty
|
||||
weight: 202
|
||||
v2.0/tags: [endpoints]
|
||||
---
|
||||
|
||||
The `pagerduty.endpoint()` function sends a message to PagerDuty that includes output data.
|
||||
|
||||
_**Function type:** Output_
|
||||
|
||||
```js
|
||||
import "pagerduty"
|
||||
|
||||
pagerduty.endpoint(
|
||||
url: "https://events.pagerduty.com/v2/enqueue"
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### pagerdutyURL
|
||||
The PagerDuty API URL.
|
||||
Defaults to `https://events.pagerduty.com/v2/enqueue`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### mapFn
|
||||
A function that builds the object used to generate the POST request.
|
||||
|
||||
{{% note %}}
|
||||
_You should rarely need to override the default `mapFn` parameter.
|
||||
To see the default `mapFn` value or for insight into possible overrides, view the
|
||||
[`pagerduty.endpoint()` source code](https://github.com/influxdata/flux/blob/master/stdlib/pagerduty/pagerduty.flux)._
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type:** Function_
|
||||
|
||||
The returned object must include the following fields:
|
||||
|
||||
- `routingKey`
|
||||
- `client`
|
||||
- `client_url`
|
||||
- `class`
|
||||
- `group`
|
||||
- `severity`
|
||||
- `component`
|
||||
- `source`
|
||||
- `summary`
|
||||
- `timestamp`
|
||||
|
||||
_For more information, see [`pagerduty.message()`](/v2.0/reference/flux/functions/pagerduty/message/)_
|
||||
|
||||
## Examples
|
||||
|
||||
##### Send critical statuses to a PagerDuty endpoint
|
||||
```js
|
||||
import "monitor"
|
||||
import "pagerduty"
|
||||
|
||||
endpoint = pagerduty.endpoint(token: "mySuPerSecRetTokEn")
|
||||
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -1m)
|
||||
|> filter(fn: (r) => r._measurement == "statuses" and status == "crit")
|
||||
|> map(fn: (r) => { return {r with status: r._status} })
|
||||
|> monitor.notify(endpoint: endpoint)
|
||||
```
|
|
@ -0,0 +1,129 @@
|
|||
---
|
||||
title: pagerduty.sendEvent() function
|
||||
description: >
|
||||
The `pagerduty.sendEvent()` function sends an event to PagerDuty.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: pagerduty.sendEvent
|
||||
parent: PagerDuty
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `pagerduty.sendEvent()` function sends an event to PagerDuty.
|
||||
|
||||
_**Function type:** Output_
|
||||
|
||||
```js
|
||||
import "pagerduty"
|
||||
|
||||
pagerduty.sendEvent(
|
||||
pagerdutyURL: "https://events.pagerduty.com/v2/enqueue",
|
||||
routingKey: "ExampleRoutingKey",
|
||||
client: "ExampleClient",
|
||||
clientURL: "http://examplepagerdutyclient.com",
|
||||
dedupkey: "ExampleDedupKey",
|
||||
class: "cpu usage",
|
||||
group: "app-stack",
|
||||
severity: "ok",
|
||||
component: "postgres",
|
||||
source: "monitoringtool:vendor:region",
|
||||
summary: "This is an example summary.",
|
||||
timestamp: "2016-07-17T08:42:58.315+0000"
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### pagerdutyURL
|
||||
The URL of the PagerDuty endpoint.
|
||||
Defaults to `https://events.pagerduty.com/v2/enqueue`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### routingKey
|
||||
The routing key generated from your PagerDuty integration.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### client
|
||||
The name of the client sending the alert.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### clientURL
|
||||
The URL of the client sending the alert.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### dedupkey
|
||||
A per-alert ID that acts as deduplication key and allows you to acknowledge or
|
||||
change the severity of previous messages.
|
||||
Supports a maximum of 255 characters.
|
||||
|
||||
{{% note %}}
|
||||
When using [`pagerduty.endpoint()`](/v2.0/reference/flux/functions/pagerduty/endpoint/)
|
||||
to send data to PagerDuty, the function uses the [`pagerduty.dedupKey()` function](/v2.0/reference/flux/functions/pagerduty/dedupkey/) to populate the `dedupkey` parameter.
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### class
|
||||
The class or type of the event.
|
||||
Classes are user-defined.
|
||||
For example, `ping failure` or `cpu load`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### group
|
||||
A logical grouping used by PagerDuty.
|
||||
Groups are user-defined.
|
||||
For example, `app-stack`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### severity
|
||||
The severity of the event.
|
||||
|
||||
**Valid values include:**
|
||||
|
||||
- `critical`
|
||||
- `error`
|
||||
- `warning`
|
||||
- `info`
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### eventAction
|
||||
The type of event to send to PagerDuty.
|
||||
|
||||
**Valid values include:**
|
||||
|
||||
- `trigger`
|
||||
- `resolve`
|
||||
- `acknowledge`
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### component
|
||||
The component of the source machine responsible for the event.
|
||||
Components are user-defined.
|
||||
For example, `mysql` or `eth0`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### source
|
||||
The unique location of the affected system.
|
||||
For example, the hostname or fully qualified domain name (FQDN).
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### summary
|
||||
A brief text summary of the event used as the summaries or titles of associated alerts.
|
||||
The maximum permitted length is 1024 characters.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### timestamp
|
||||
The time the detected event occurred in [RFC3339nano format](https://golang.org/pkg/time/#RFC3339Nano).
|
||||
|
||||
_**Data type:** String_
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
title: pagerduty.severityFromLevel() function
|
||||
description: >
|
||||
The `pagerduty.severityFromLevel()` function converts an InfluxDB status level to
|
||||
a PagerDuty severity.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: pagerduty.severityFromLevel
|
||||
parent: PagerDuty
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `pagerduty.severityFromLevel()` function converts an InfluxDB status level to
|
||||
a PagerDuty severity.
|
||||
|
||||
_**Function type:** Transformation_
|
||||
|
||||
```js
|
||||
import "pagerduty"
|
||||
|
||||
pagerduty.severityFromLevel(
|
||||
level: "crit"
|
||||
)
|
||||
|
||||
// Returns "critical"
|
||||
```
|
||||
|
||||
| Status level | PagerDuty severity |
|
||||
|:------------:|:------------------:|
|
||||
| `crit` | `critical` |
|
||||
| `warn` | `warning` |
|
||||
| `info` | `info` |
|
||||
| `ok` | `info` |
|
||||
|
||||
## Parameters
|
||||
|
||||
### level
|
||||
The InfluxDB status level to convert to a PagerDuty severity.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
## Function definition
|
||||
```js
|
||||
import "strings"
|
||||
|
||||
severityFromLevel = (level) => {
|
||||
lvl = strings.toLower(v:level)
|
||||
sev = if lvl == "warn" then "warning"
|
||||
else if lvl == "crit" then "critical"
|
||||
else if lvl == "info" then "info"
|
||||
else if lvl == "ok" then "info"
|
||||
else "error"
|
||||
return sev
|
||||
}
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: Flux InfluxDB Secrets package
|
||||
list_title: InfluxDB Secrets package
|
||||
description: >
|
||||
The Flux InfluxDB Secrets package provides functions for working with sensitive secrets managed by InfluxDB.
|
||||
Import the `influxdata/influxdb/secrets` package.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: InfluxDB Secrets
|
||||
parent: Flux packages and functions
|
||||
weight: 202
|
||||
v2.0/tags: [functions, secrets, package]
|
||||
---
|
||||
|
||||
InfluxDB Secrets Flux functions provide tools for working with sensitive secrets managed by InfluxDB.
|
||||
Import the `influxdata/influxdb/secrets` package:
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/secrets"
|
||||
```
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
title: secrets.get() function
|
||||
description: >
|
||||
The `secrets.get()` function retrieves a secret from the InfluxDB secret store.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: secrets.get
|
||||
parent: InfluxDB Secrets
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `secrets.get()` function retrieves a secret from the
|
||||
[InfluxDB secret store](/v2.0/security/secrets/).
|
||||
|
||||
_**Function type:** Miscellaneous_
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/secrets"
|
||||
|
||||
secrets.get(key: "KEY_NAME")
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### key
|
||||
The secret key to retrieve.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
## Examples
|
||||
|
||||
### Populate sensitive credentials with secrets
|
||||
```js
|
||||
import "sql"
|
||||
import "influxdata/influxdb/secrets"
|
||||
|
||||
username = secrets.get(key: "POSTGRES_USERNAME")
|
||||
password = secrets.get(key: "POSTGRES_PASSWORD")
|
||||
|
||||
sql.from(
|
||||
driverName: "postgres",
|
||||
dataSourceName: "postgresql://${username}:${password}@localhost",
|
||||
query:"SELECT * FROM example-table"
|
||||
)
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: Flux Slack package
|
||||
list_title: Slack package
|
||||
description: >
|
||||
The Flux Slack package provides functions for sending data to Slack.
|
||||
Import the `slack` package.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: Slack
|
||||
parent: Flux packages and functions
|
||||
weight: 202
|
||||
v2.0/tags: [functions, slack, package]
|
||||
---
|
||||
|
||||
The Flux Slack package provides functions for sending data to Slack.
|
||||
Import the `slack` package:
|
||||
|
||||
```js
|
||||
import "slack"
|
||||
```
|
||||
|
||||
{{< children type="functions" show="pages" >}}
|
|
@ -0,0 +1,86 @@
|
|||
---
|
||||
title: slack.endpoint() function
|
||||
description: >
|
||||
The `slack.endpoint()` function sends a message to Slack that includes output data.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: slack.endpoint
|
||||
parent: Slack
|
||||
weight: 202
|
||||
v2.0/tags: [endpoints]
|
||||
---
|
||||
|
||||
The `slack.endpoint()` function sends a message to Slack that includes output data.
|
||||
|
||||
_**Function type:** Output_
|
||||
|
||||
```js
|
||||
import "slack"
|
||||
|
||||
slack.endpoint(
|
||||
url: "https://slack.com/api/chat.postMessage",
|
||||
token: "mySuPerSecRetTokEn"
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### url
|
||||
The Slack API URL.
|
||||
Defaults to `https://slack.com/api/chat.postMessage`.
|
||||
|
||||
{{% note %}}
|
||||
If using a Slack webhook, you'll receive a Slack webhook URL when you
|
||||
[create an incoming webhook](https://api.slack.com/incoming-webhooks#create_a_webhook).
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### token
|
||||
The [Slack API token](https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens)
|
||||
used to interact with Slack.
|
||||
Defaults to `""`.
|
||||
|
||||
{{% note %}}
|
||||
A token is only required if using the Slack chat.postMessage API.
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### mapFn
|
||||
A function that builds the object used to generate the POST request.
|
||||
|
||||
{{% note %}}
|
||||
_You should rarely need to override the default `mapFn` parameter.
|
||||
To see the default `mapFn` value or for insight into possible overrides, view the
|
||||
[`slack.endpoint()` source code](https://github.com/influxdata/flux/blob/master/stdlib/slack/slack.flux)._
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type:** Function_
|
||||
|
||||
The returned object must include the following fields:
|
||||
|
||||
- `username`
|
||||
- `channel`
|
||||
- `workspace`
|
||||
- `text`
|
||||
- `iconEmoji`
|
||||
- `color`
|
||||
|
||||
_For more information, see [`slack.message()`](/v2.0/reference/flux/functions/slack/message/)_
|
||||
|
||||
## Examples
|
||||
|
||||
##### Send critical statuses to a Slack endpoint
|
||||
```js
|
||||
import "monitor"
|
||||
import "slack"
|
||||
|
||||
endpoint = slack.endpoint(token: "mySuPerSecRetTokEn")
|
||||
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -1m)
|
||||
|> filter(fn: (r) => r._measurement == "statuses" and status == "crit")
|
||||
|> map(fn: (r) => { return {r with status: r._status} })
|
||||
|> monitor.notify(endpoint: endpoint)
|
||||
```
|
|
@ -0,0 +1,124 @@
|
|||
---
|
||||
title: slack.message() function
|
||||
description: >
|
||||
The `slack.message()` function sends a single message to a Slack channel.
|
||||
The function works with either with the chat.postMessage API or with a Slack webhook.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
name: slack.message
|
||||
parent: Slack
|
||||
weight: 202
|
||||
---
|
||||
|
||||
The `slack.message()` function sends a single message to a Slack channel.
|
||||
The function works with either with the [chat.postMessage API](https://api.slack.com/methods/chat.postMessage)
|
||||
or with a [Slack webhook](https://api.slack.com/incoming-webhooks).
|
||||
|
||||
_**Function type:** Output_
|
||||
|
||||
```js
|
||||
import "slack"
|
||||
|
||||
slack.message(
|
||||
url: "https://slack.com/api/chat.postMessage",
|
||||
token: "mySuPerSecRetTokEn",
|
||||
username: "Fluxtastic",
|
||||
channel: "#flux",
|
||||
workspace: "",
|
||||
text: "This is a message from the Flux slack.message() function.",
|
||||
iconEmoji: "wave",
|
||||
color: "good"
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### url
|
||||
The Slack API URL.
|
||||
Defaults to `https://slack.com/api/chat.postMessage`.
|
||||
|
||||
{{% note %}}
|
||||
If using a Slack webhook, you'll receive a Slack webhook URL when you
|
||||
[create an incoming webhook](https://api.slack.com/incoming-webhooks#create_a_webhook).
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### token
|
||||
The [Slack API token](https://get.slack.help/hc/en-us/articles/215770388-Create-and-regenerate-API-tokens)
|
||||
used to interact with Slack.
|
||||
Defaults to `""`.
|
||||
|
||||
{{% note %}}
|
||||
A token is only required if using the Slack chat.postMessage API.
|
||||
{{% /note %}}
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### username
|
||||
The username to use when posting the message to a Slack channel. <span class="required">Required</span>
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### channel
|
||||
The name of channel to post the message to. <span class="required">Required</span>
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### workspace
|
||||
The name of the Slack workspace to use if there are multiple.
|
||||
Defaults to `""`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### text
|
||||
The text to display in the Slack message. <span class="required">Required</span>
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
### iconEmoji
|
||||
The name of emoji to use as the user avatar when posting the message to Slack.
|
||||
<span class="required">Required</span>
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
{{% note %}}
|
||||
#### Things to know about iconEmoji
|
||||
- **Do not** enclose the name in colons `:` as you do in the Slack client.
|
||||
- `iconEmoji` only appears as the user avatar when using the Slack chat.postMessage API.
|
||||
{{% /note %}}
|
||||
|
||||
### color
|
||||
The color to include with the message.
|
||||
<span class="required">Required</span>
|
||||
|
||||
**Valid values include:**
|
||||
|
||||
- `good`
|
||||
- `warning`
|
||||
- `danger`
|
||||
- Any valid RGB hex color code. For example, `#439FE0`.
|
||||
|
||||
_**Data type:** String_
|
||||
|
||||
## Examples
|
||||
|
||||
##### Send the last reported status to Slack
|
||||
```js
|
||||
import "slack"
|
||||
|
||||
lastReported =
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -1m)
|
||||
|> filter(fn: (r) => r._measurement == "statuses")
|
||||
|> last()
|
||||
|> map(fn: (r) => { return {status: r._status} })
|
||||
|
||||
slack.message(
|
||||
url: "https://slack.com/api/chat.postMessage",
|
||||
token: "mySuPerSecRetTokEn",
|
||||
username: "johndoe",
|
||||
channel: "#system-status",
|
||||
text: "The last reported status was \"${lastReported.status}\"."
|
||||
)
|
||||
```
|
|
@ -8,12 +8,6 @@ menu:
|
|||
weight: 202
|
||||
---
|
||||
|
||||
{{% note %}}
|
||||
This document is a living document and may not represent the current implementation of Flux.
|
||||
Any section that is not currently implemented is commented with a **[IMPL#XXX]** where
|
||||
**XXX** is an issue number tracking discussion and progress towards implementation.
|
||||
{{% /note %}}
|
||||
|
||||
An assignment binds an identifier to a variable, option, or function.
|
||||
Every identifier in a program must be assigned.
|
||||
|
||||
|
@ -32,10 +26,6 @@ Note that the package clause is not an assignment.
|
|||
The package name does not appear in any scope.
|
||||
Its purpose is to identify the files belonging to the same package and to specify the default package name for import declarations.
|
||||
|
||||
{{% note %}}
|
||||
[IMPL#247](https://github.com/influxdata/platform/issues/247) Add package/namespace support.
|
||||
{{% /note %}}
|
||||
|
||||
## Variable assignment
|
||||
A variable assignment creates a variable bound to an identifier and gives it a type and value.
|
||||
A variable keeps the same type and value for the remainder of its lifetime.
|
||||
|
|
|
@ -269,4 +269,8 @@ PostfixOperator = MemberExpression
|
|||
| IndexExpression .
|
||||
```
|
||||
|
||||
{{% warn %}}
|
||||
Dividing by 0 or using the mod operator with a divisor of 0 will result in an error.
|
||||
{{% /warn %}}
|
||||
|
||||
_Also see [Flux Operators](/v2.0/reference/flux/language/operators)._
|
||||
|
|
|
@ -269,8 +269,7 @@ String literals support several escape sequences.
|
|||
\t U+0009 horizontal tab
|
||||
\" U+0022 double quote
|
||||
\\ U+005C backslash
|
||||
\{ U+007B open curly bracket
|
||||
\} U+007D close curly bracket
|
||||
\${ U+0024 U+007B dollar sign and opening curly bracket
|
||||
```
|
||||
|
||||
Additionally, any byte value may be specified via a hex encoding using `\x` as the prefix.
|
||||
|
@ -281,15 +280,9 @@ byte_value = `\` "x" hex_digit hex_digit .
|
|||
hex_digit = "0" … "9" | "A" … "F" | "a" … "f" .
|
||||
unicode_value = unicode_char | escaped_char .
|
||||
escaped_char = `\` ( "n" | "r" | "t" | `\` | `"` ) .
|
||||
StringExpression = "{" Expression "}" .
|
||||
StringExpression = "${" Expression "}" .
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
To be added: TODO: With string interpolation `string_lit` is not longer a lexical token as part of a literal, but an entire expression in and of itself.
|
||||
|
||||
[IMPL#252](https://github.com/influxdata/platform/issues/252) Parse string literals.
|
||||
{{% /note %}}
|
||||
|
||||
##### Examples of string literals
|
||||
|
||||
```js
|
||||
|
@ -301,12 +294,12 @@ To be added: TODO: With string interpolation `string_lit` is not longer a lexica
|
|||
```
|
||||
|
||||
String literals are also interpolated for embedded expressions to be evaluated as strings.
|
||||
Embedded expressions are enclosed in curly brackets (`{}`).
|
||||
Embedded expressions are enclosed in a dollar sign and curly braces (`${}`).
|
||||
The expressions are evaluated in the scope containing the string literal.
|
||||
The result of an expression is formatted as a string and replaces the string content between the brackets.
|
||||
The result of an expression is formatted as a string and replaces the string content between the braces.
|
||||
All types are formatted as strings according to their literal representation.
|
||||
A function `printf` exists to allow more precise control over formatting of various types.
|
||||
To include the literal curly brackets within a string they must be escaped.
|
||||
To include the literal `${` within a string, it must be escaped.
|
||||
|
||||
{{% note %}}
|
||||
[IMPL#248](https://github.com/influxdata/platform/issues/248) Add printf function.
|
||||
|
@ -316,14 +309,13 @@ To include the literal curly brackets within a string they must be escaped.
|
|||
|
||||
```js
|
||||
n = 42
|
||||
"the answer is {n}" // the answer is 42
|
||||
"the answer is not {n+1}" // the answer is not 43
|
||||
"openinng curly bracket \{" // openinng curly bracket {
|
||||
"closing curly bracket \}" // closing curly bracket }
|
||||
"the answer is ${n}" // the answer is 42
|
||||
"the answer is not ${n+1}" // the answer is not 43
|
||||
"dollar sign opening curly bracket \${" // dollar sign opening curly bracket ${
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
[IMPL#251](https://github.com/influxdata/platform/issues/251) Add string interpolation support
|
||||
[IMPL#1775](https://github.com/influxdata/flux/issues/1775) Interpolate arbitrary expressions in string literals
|
||||
{{% /note %}}
|
||||
|
||||
### Regular expression literals
|
||||
|
|
|
@ -13,12 +13,6 @@ menu:
|
|||
weight: 207
|
||||
---
|
||||
|
||||
{{% note %}}
|
||||
This document is a living document and may not represent the current implementation of Flux.
|
||||
Any section that is not currently implemented is commented with a **[IMPL#XXX]** where
|
||||
**XXX** is an issue number tracking discussion and progress towards implementation.
|
||||
{{% /note %}}
|
||||
|
||||
Flux source is organized into packages.
|
||||
A package consists of one or more source files.
|
||||
Each source file is parsed individually and composed into a single package.
|
||||
|
@ -41,10 +35,6 @@ All files in the same package must declare the same package name.
|
|||
When a file does not declare a package clause, all identifiers in that
|
||||
file will belong to the special `main` package.
|
||||
|
||||
{{% note %}}
|
||||
[IMPL#247](https://github.com/influxdata/platform/issues/247) Add package/namespace support.
|
||||
{{% /note %}}
|
||||
|
||||
### Package main
|
||||
|
||||
The `main` package is special for a few reasons:
|
||||
|
|
|
@ -119,6 +119,7 @@ duration // duration of time
|
|||
time // time
|
||||
string // utf-8 encoded string
|
||||
regexp // regular expression
|
||||
bytes // sequence of byte values
|
||||
type // a type that itself describes a type
|
||||
```
|
||||
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
---
|
||||
title: String interpolation
|
||||
description: >
|
||||
Flux string interpolation evaluates string literals containing one or more placeholders
|
||||
and returns a result with placeholders replaced with their corresponding values.
|
||||
menu:
|
||||
v2_0_ref:
|
||||
parent: Flux specification
|
||||
name: String interpolation
|
||||
weight: 211
|
||||
---
|
||||
|
||||
Flux string interpolation evaluates string literals containing one or more placeholders
|
||||
and returns a result with placeholders replaced with their corresponding values.
|
||||
|
||||
## String interpolation syntax
|
||||
To use Flux string interpolation, enclose embedded [expressions](/v2.0/reference/flux/language/expressions/)
|
||||
in a dollar sign and curly braces `${}`.
|
||||
Flux replaces the content between the braces with the result of the expression and
|
||||
returns a string literal.
|
||||
|
||||
```js
|
||||
name = "John"
|
||||
|
||||
"My name is ${name}."
|
||||
|
||||
// My name is John.
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
#### Flux only interpolates string values
|
||||
Flux currently interpolates only string values ([IMP#1775](https://github.com/influxdata/flux/issues/1775)).
|
||||
Use the [string() function](/v2.0/reference/flux/functions/built-in/transformations/type-conversions/string/)
|
||||
to convert non-string values to strings.
|
||||
|
||||
```js
|
||||
count = 12
|
||||
|
||||
"I currently have ${string(v: count)} cats."
|
||||
```
|
||||
{{% /note %}}
|
||||
|
||||
|
||||
## Use dot notation to interpolate object values
|
||||
[Objects](/v2.0/reference/flux/language/expressions/#object-literals) consist of key-value pairs.
|
||||
Use [dot notation](/v2.0/reference/flux/language/expressions/#member-expressions)
|
||||
to interpolate values from an object.
|
||||
|
||||
```js
|
||||
person = {
|
||||
name: "John",
|
||||
age: 42
|
||||
}
|
||||
|
||||
"My name is ${person.name} and I'm ${string(v: person.age)} years old."
|
||||
|
||||
// My name is John and I'm 42 years old.
|
||||
```
|
||||
|
||||
Flux returns each record in query results as an object.
|
||||
In Flux row functions, each row object is represented by `r`.
|
||||
Use dot notation to interpolate specific column values from the `r` object.
|
||||
|
||||
##### Use string interpolation to add a human-readable message
|
||||
```js
|
||||
from(bucket: "example-bucket")
|
||||
|> range(start: -30m)
|
||||
|> map(fn: (r) => ({
|
||||
r with
|
||||
human-readable: "${r._field} is ${r._value} at ${string(v: r._time)}."
|
||||
}))
|
||||
```
|
||||
|
||||
## String interpolation versus concatenation
|
||||
Flux supports both string interpolation and string concatenation.
|
||||
String interpolation is a more concise method for achieving the same result.
|
||||
|
||||
```js
|
||||
person = {
|
||||
name: "John",
|
||||
age: 42
|
||||
}
|
||||
|
||||
// String interpolation
|
||||
"My name is ${person.name} and I'm ${string(v: person.age)} years old."
|
||||
|
||||
// String concatenation
|
||||
"My name is " + person.name + " and I'm " + string(v: person.age) + " years old."
|
||||
|
||||
// Both return: My name is John and I'm 42 years old.
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
Check and notification message templates configured in the InfluxDB user interface
|
||||
**do not** support string concatenation.
|
||||
{{% /note %}}
|
|
@ -105,7 +105,12 @@ The string type is nullable.
|
|||
An empty string is **not** a _null_ value.
|
||||
{{% /note %}}
|
||||
|
||||
The length of a string is its size in bytes, not the number of characters, since a single character may be multiple bytes.
|
||||
The length of a string is its size in bytes, not the number of characters,
|
||||
since a single character may be multiple bytes.
|
||||
|
||||
### Bytes types
|
||||
A _bytes type_ represents a sequence of byte values.
|
||||
The bytes type name is `bytes`.
|
||||
|
||||
## Regular expression types
|
||||
A _regular expression type_ represents the set of all patterns for regular expressions.
|
||||
|
|
|
@ -92,6 +92,32 @@ A bucket is a named location where time series data is stored. All buckets have
|
|||
|
||||
## C
|
||||
|
||||
### check
|
||||
|
||||
Checks are part of queries used in monitoring to read input data and assign a [status](#check-status) (`_level`) based on specified conditions. For example:
|
||||
|
||||
```
|
||||
monitor.check(
|
||||
crit: (r) => r._value > 90.0,
|
||||
warn: (r) => r._value > 80.0,
|
||||
info: (r) => r._value > 60.0,
|
||||
ok: (r) => r._value <= 20.0,
|
||||
messageFn: (r) => "The current level is ${r._level}",
|
||||
)
|
||||
```
|
||||
|
||||
This check gives rows with a `_value` greater than 90.0 a crit _level; rows greater than 80.0 get a warn _level, and so on.
|
||||
|
||||
Learn how to [create a check](/v2.0/cloud/monitor-alert/manage-checks/create-checks).
|
||||
|
||||
Related entries: [check status](#check-status), [notification rule](#notification-rule), [notification endpoint](#notification-endpoint)
|
||||
|
||||
### check status
|
||||
|
||||
A [check](#check) gets one of the following statuses (`_level`): CRIT, INFO, WARN, or OK. Check statuses are written to a status measurement in the _monitoring bucket.
|
||||
|
||||
Related entries: [check](#check), [notification rule](#notification-rule), [notification endpoint](#notification-endpoint)
|
||||
|
||||
### CSV
|
||||
|
||||
Comma-separated values (CSV) delimits text between commas to separate values. A CSV file stores tabular data (numbers and text) in plain text. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. CSV file format is not fully standardized.
|
||||
|
@ -523,6 +549,20 @@ An independent `influxd` process.
|
|||
|
||||
Related entries: [server](#server)
|
||||
|
||||
### notification endpoint
|
||||
|
||||
The notification endpoint specifies the Slack or PagerDuty endpoint to send a notification and contains configuration details for connecting to the endpoint. Learn how to [create a notification endpoint](/v2.0/monitor-alert/notification-endpoints/create).
|
||||
|
||||
Related entries: [check](#check), [notification rule](#notification-rule)
|
||||
|
||||
### notification rule
|
||||
|
||||
A notification rule specifies a status level (and tags) to alert on, the notification message to send for the specified status level (or change in status level), and the interval or schedule you want to check the status level (and tags). If conditions are met, the notification rule sends a message to the [notification endpoint](#notification-endpoint) and stores a receipt in a notification measurement in the _monitoring bucket. For example, a notification rule may specify a message to send to a Slack endpoint when a status level is critical (`crit`).
|
||||
|
||||
Learn how to [create a notification rule](/v2.0/monitor-alert/notification-rules/create).
|
||||
|
||||
Related entries: [check](#check), [notification endpoint](#notification-endpoint)
|
||||
|
||||
### now()
|
||||
|
||||
The local server's nanosecond timestamp.
|
||||
|
@ -617,7 +657,7 @@ Collect data from any accessible endpoint that provides data in the [Prometheus
|
|||
|
||||
### query
|
||||
|
||||
An operation that retrieves data from InfluxDB.
|
||||
A Flux script that returns time series data, including [tags](#tag) and [timestamps](#timestamp).
|
||||
|
||||
See [Query data in InfluxDB](/v2.0/query-data/).
|
||||
|
||||
|
|
|
@ -11,16 +11,137 @@ aliases:
|
|||
---
|
||||
|
||||
{{% note %}}
|
||||
_The latest release of InfluxDB v2.0 alpha includes **Flux v0.39.0**.
|
||||
_The latest release of InfluxDB v2.0 alpha includes **Flux v0.45.1**.
|
||||
Though newer versions of Flux may be available, they will not be included with
|
||||
InfluxDB until the next InfluxDB v2.0 release._
|
||||
{{% /note %}}
|
||||
|
||||
---
|
||||
|
||||
## v0.45.1 [2019-09-09]
|
||||
|
||||
### Bug fixes
|
||||
- Ensure `http.post` respects the context.
|
||||
|
||||
---
|
||||
|
||||
## v0.45.0 [2019-09-06]
|
||||
|
||||
### Features
|
||||
- Added Google Bigtable `from()`.
|
||||
|
||||
### Bug fixes
|
||||
- Add `pagerduty.severityFromLevel()` helper function.
|
||||
- Sleep function now gets canceled when the context is canceled.
|
||||
- Categorize the undefined identifier as an invalid status code.
|
||||
- Panic from `CheckKind` in `memberEvaluator`.
|
||||
|
||||
---
|
||||
|
||||
## v0.44.0 [2019-09-05]
|
||||
|
||||
### Features
|
||||
- Add `http.basicAuth` function.
|
||||
- Add measurement filters to `monitor.from` and `monitor.logs`.
|
||||
|
||||
### Bug fixes
|
||||
- changed the default HTTP client to be more robust.
|
||||
|
||||
---
|
||||
|
||||
## v0.43.0 [2019-09-04]
|
||||
|
||||
### Features
|
||||
- PagerDuty endpoint for alerts and notifications.
|
||||
|
||||
---
|
||||
|
||||
## v0.42.0 [2019-08-30]
|
||||
|
||||
### Features
|
||||
- Add `stateChanges` function.
|
||||
|
||||
### Bug fixes
|
||||
- Race condition in looking up types in `map`.
|
||||
- Support bool equality expressions.
|
||||
- Calculating a type variable's free type variables.
|
||||
- Do not generate fresh type variables for member expressions.
|
||||
- Array instantiation.
|
||||
|
||||
---
|
||||
|
||||
## v0.41.0 [2019-08-26]
|
||||
|
||||
### Features
|
||||
- Add ability to validate URLs before making `http.post` requests.
|
||||
- Evaluate string interpolation.
|
||||
- Implement the `secrets.get` function.
|
||||
- Added secret service interface.
|
||||
- Add secrets package that will construct a secret object.
|
||||
- Added a SecretService interface and a new dependencies package and a basic test of functionality.
|
||||
- Add Slack endpoint.
|
||||
|
||||
### Bug fixes
|
||||
- Make `reset()` check for non-nil data before calling `Release()`.
|
||||
- Add test case for `notify` function.
|
||||
- Add missing math import to test case.
|
||||
- Make packages aware of options.
|
||||
- Resolved `holtWinters` panic.
|
||||
- Use non-pointer receiver for `interpreter.function`.
|
||||
|
||||
---
|
||||
|
||||
## v0.40.2 [2019-08-22]
|
||||
|
||||
### Bug fixes
|
||||
- Resolved `holtWinters()` panic.
|
||||
|
||||
---
|
||||
|
||||
## v0.40.1 [2019-08-21]
|
||||
|
||||
### Bug fixes
|
||||
- Use non-pointer receiver for `interpreter.function`.
|
||||
|
||||
---
|
||||
|
||||
## v0.40.0 [2019-08-20]
|
||||
|
||||
### Breaking changes
|
||||
- Update compiler package to use true scope.
|
||||
- Add `http` and `json` to prelude.
|
||||
|
||||
### Features
|
||||
- Add `alerts.check()` function.
|
||||
- Add `alerts.notify` function.
|
||||
- Add `kaufmansER()` and `kaufmansAMA()` functions.
|
||||
- Add `experimental.to()` function.
|
||||
- Add `experimental.set()` function to update entire object.
|
||||
- Add `experimental.objectKeys()` function.
|
||||
- Add `tripleExponentialDerivative()` function.
|
||||
- Add `json.encode()` function.
|
||||
- Add `mqtt.to()` function.
|
||||
- Add Bytes type.
|
||||
- Update compiler package to use true scope.
|
||||
- Add http endpoint.
|
||||
- Add post method implementation.
|
||||
- String interpolation.
|
||||
|
||||
### Bug fixes
|
||||
- Avoid wrapping table errors in the CSV encoder.
|
||||
- Remove irrelevant TODOs.
|
||||
- `mode()` now properly considers nulls when calculating the mode.
|
||||
- Add `http` and `json` to prelude.
|
||||
- Rename all Flux test files to use `_test.flux`.
|
||||
|
||||
---
|
||||
|
||||
## v0.39.0 [2019-08-13]
|
||||
|
||||
> A queryd panic has been reported in `HoltWinters()`. We're working to resolve this issue as soon as possible.
|
||||
{{% warn %}}
|
||||
In Flux 0.39.0, `holtWinters()` can cause the query engine to panic.
|
||||
**Flux 0.40.2 resolves this panic.**
|
||||
{{% /warn %}}
|
||||
|
||||
### Breaking changes
|
||||
- Implement the scanning components for string expressions.
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
title: Store and use secrets
|
||||
description:
|
||||
v2.0/tags: [secrets, security]
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Security & authorization
|
||||
weight: 102
|
||||
---
|
||||
|
||||
There are two options for storing secrets with InfluxDB:
|
||||
|
||||
- By default, secrets are Base64-encoded and stored in the InfluxDB embedded key value store, [BoltDB](https://github.com/boltdb/bolt).
|
||||
- You can also set up Vault to store secrets. For details, see [Store secrets in Vault](/v2.0/security/secrets/use-vault).
|
||||
|
||||
## Use secrets in a query
|
||||
Import the `influxdata/influxd/secrets` package and use the `secrets.get()` function
|
||||
to populate sensitive data in queries with secrets from your secret store.
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/secrets"
|
||||
import "sql"
|
||||
|
||||
username = secrets.get(key: "POSTGRES_USERNAME")
|
||||
password = secrets.get(key: "POSTGRES_PASSWORD")
|
||||
|
||||
sql.from(
|
||||
driverName: "postgres",
|
||||
dataSourceName: "postgresql://${username}:${password}@localhost",
|
||||
query:"SELECT * FROM example-table"
|
||||
)
|
||||
```
|
||||
|
||||
## Add, list, and delete secrets
|
||||
|
||||
See [Manage secrets](/v2.0/security/secrets/manage-secrets).
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
title: Manage secrets
|
||||
description: Manage secrets in InfluxDB with the InfluxDB API.
|
||||
v2.0/tags: [secrets, security]
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Store and use secrets
|
||||
weight: 201
|
||||
---
|
||||
|
||||
|
||||
Manage secrets using the InfluxDB `/org/{orgID}/secrets` API endpoint.
|
||||
All secrets belong to an organization and are stored in your [secret-store](/v2.0/security/secrets/).
|
||||
Include your [organization ID](/v2.0/organizations/view-orgs/#view-your-organization-id)
|
||||
and [authentication token](/v2.0/security/tokens/view-tokens/) with each request.
|
||||
|
||||
### Add a secret
|
||||
Use the `PATCH` request method to add a new secret to your organization.
|
||||
Pass the secret key-value pair in the request body.
|
||||
|
||||
```sh
|
||||
curl -XPATCH http://localhost:9999/api/v2/orgs/<org-id>/secrets \
|
||||
-H 'authorization: Token YOURAUTHTOKEN' \
|
||||
-H 'Content-type: application/json' \
|
||||
--data '{
|
||||
"<secret-key>": "<secret-value>"
|
||||
}'
|
||||
```
|
||||
|
||||
### View secret keys
|
||||
Use the `GET` request method to view your organization's secrets keys.
|
||||
|
||||
```sh
|
||||
curl -XGET http://localhost:9999/api/v2/orgs/<org-id>/secrets \
|
||||
-H 'authorization: Token YOURAUTHTOKEN'
|
||||
```
|
||||
|
||||
### Delete a secret
|
||||
Use the `POST` request method and the `orgs/{orgID}/secrets/delete` API endpoint
|
||||
to delete one or more secrets.
|
||||
Include an array of secret keys to delete in the requests body in the following format.
|
||||
|
||||
```bash
|
||||
curl -XGET http://localhost:9999/api/v2/orgs/<org-id>/secrets/delete \
|
||||
--H 'authorization: Token YOURAUTHTOKEN'
|
||||
--data '{
|
||||
"secrets": [
|
||||
"<secret-key>"
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
## Use secrets in a query
|
||||
Import the `influxdata/influxd/secrets` package and use the `secrets.get()` function
|
||||
to populate sensitive data in queries with secrets from your secret store.
|
||||
|
||||
```js
|
||||
import "influxdata/influxdb/secrets"
|
||||
import "sql"
|
||||
|
||||
username = secrets.get(key: "POSTGRES_USERNAME")
|
||||
password = secrets.get(key: "POSTGRES_PASSWORD")
|
||||
|
||||
sql.from(
|
||||
driverName: "postgres",
|
||||
dataSourceName: "postgresql://${username}:${password}@localhost",
|
||||
query:"SELECT * FROM example-table"
|
||||
)
|
||||
```
|
|
@ -0,0 +1,68 @@
|
|||
---
|
||||
title: Store secrets in Vault
|
||||
description: Manage secrets in InfluxDB using the InfluxDB UI or the influx CLI.
|
||||
v2.0/tags: [secrets, security]
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Store and use secrets
|
||||
weight: 201
|
||||
---
|
||||
|
||||
[Vault](https://www.vaultproject.io/) secures, stores, and tightly controls access
|
||||
to tokens, passwords, certificates, and other sensitive secrets.
|
||||
Store sensitive secrets in Vault using the InfluxDB built-in Vault integration.
|
||||
|
||||
## Start a Vault server
|
||||
|
||||
Start a Vault server and ensure InfluxDB has network access to the server.
|
||||
|
||||
The following links provide information about running Vault in both development and production:
|
||||
|
||||
- [Install Vault](https://learn.hashicorp.com/vault/getting-started/install)
|
||||
- [Start a Vault dev server](https://learn.hashicorp.com/vault/getting-started/dev-server)
|
||||
- [Deploy Vault](https://learn.hashicorp.com/vault/getting-started/deploy)
|
||||
|
||||
{{% note %}}
|
||||
InfluxDB supports the [Vault KV Secrets Engine Version 2 API](https://www.vaultproject.io/api/secret/kv/kv-v2.html) only.
|
||||
When you create a secrets engine, enable the `kv-v2` version by running:
|
||||
|
||||
```js
|
||||
vault secrets enable kv-v2
|
||||
```
|
||||
{{% /note %}}
|
||||
|
||||
For this example, install Vault on your local machine and start a Vault dev server.
|
||||
|
||||
```sh
|
||||
vault server -dev
|
||||
```
|
||||
|
||||
## Define Vault environment variables
|
||||
|
||||
Use [Vault environment variables](https://www.vaultproject.io/docs/commands/index.html#environment-variables)
|
||||
to provide connection credentials and other important Vault-related information to InfluxDB.
|
||||
|
||||
#### Required environment variables
|
||||
|
||||
- `VAULT_ADDR`: The API address of your Vault server _(provided in the Vault server output)_.
|
||||
- `VAULT_TOKEN`: The [Vault token](https://learn.hashicorp.com/vault/getting-started/authentication)
|
||||
required to access your Vault server.
|
||||
|
||||
_Your Vault server configuration may require other environment variables._
|
||||
|
||||
```sh
|
||||
export VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN='s.0X0XxXXx0xXxXXxxxXxXxX0x'
|
||||
```
|
||||
|
||||
## Start InfluxDB
|
||||
|
||||
Start the [`influxd` service](/v2.0/reference/cli/influxd/) with the `--secret-store`
|
||||
option set to `vault`.
|
||||
|
||||
```bash
|
||||
influxd --secret-store vault
|
||||
```
|
||||
|
||||
## Manage tokens through the InfluxDB API
|
||||
Use the InfluxDB `/org/{orgID}/secrets` API endpoint to add tokens to Vault.
|
||||
For details, see [Manage secrets](/v2.0/security/secrets/manage-secrets/).
|
|
@ -16,9 +16,9 @@ command line interface (CLI).
|
|||
|
||||
## Create a token in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** icon in the navigation bar.
|
||||
1. Click the **Load Data** icon in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "disks" >}}
|
||||
|
||||
2. Click **Tokens**.
|
||||
3. Click the **+ Generate** dropdown in the upper right and select a token type (**Read/Write Token** or **All Access Token**).
|
||||
|
|
|
@ -17,9 +17,9 @@ have access to your InfluxDB instance.
|
|||
|
||||
## Delete tokens in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** icon in the navigation bar.
|
||||
1. Click the Click the **Load Data** icon in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "disks" >}}
|
||||
|
||||
2. Click **Tokens**. All of your account's tokens appear.
|
||||
3. Hover over the token you want to delete and click **Delete** and **Confirm**.
|
||||
|
|
|
@ -15,9 +15,9 @@ Update an authentication token's description using the InfluxDB user interface (
|
|||
|
||||
## Update a token in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** icon in the navigation bar.
|
||||
1. Click the **Load Data** icon in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "disks" >}}
|
||||
|
||||
2. Click **Tokens**. All of your account's tokens appear.
|
||||
3. Click the pencil icon {{< icon "pencil" >}} next to the token's name in the **Description** column.
|
||||
|
|
|
@ -16,9 +16,9 @@ command line interface (CLI).
|
|||
|
||||
## View tokens in the InfluxDB UI
|
||||
|
||||
1. Click the **Settings** icon in the navigation bar.
|
||||
1. Click the **Load Data** icon in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "disks" >}}
|
||||
|
||||
2. Click **Tokens**. All of your account's tokens appear.
|
||||
3. Click on a token name from the list to view the token and a summary of access permissions.
|
||||
|
|
|
@ -1,129 +0,0 @@
|
|||
---
|
||||
title: Store secrets in Vault
|
||||
description: Manage authentication tokens in InfluxDB using the InfluxDB UI or the influx CLI.
|
||||
v2.0/tags: [tokens, security]
|
||||
menu:
|
||||
v2_0:
|
||||
parent: Security & authorization
|
||||
weight: 102
|
||||
---
|
||||
|
||||
[Vault](https://www.vaultproject.io/) secures, stores, and tightly controls access
|
||||
to tokens, passwords, certificates, and other sensitive secrets.
|
||||
Store sensitive secrets in Vault using the InfluxDB built-in Vault integration.
|
||||
|
||||
{{% note %}}
|
||||
When not using Vault, secrets are Base64-encoded and stored in the InfluxDB embedded key value store,
|
||||
[BoltDB](https://github.com/boltdb/bolt).
|
||||
{{% /note %}}
|
||||
|
||||
## Start a Vault server
|
||||
Start a Vault server and ensure InfluxDB has network access to the server.
|
||||
The following links provide information about running Vault in both development and production:
|
||||
|
||||
- [Install Vault](https://learn.hashicorp.com/vault/getting-started/install)
|
||||
- [Start a Vault dev server](https://learn.hashicorp.com/vault/getting-started/dev-server)
|
||||
- [Deploy Vault](https://learn.hashicorp.com/vault/getting-started/deploy)
|
||||
|
||||
For this example, install Vault on your local machine and start a Vault dev server.
|
||||
|
||||
```sh
|
||||
vault server -dev
|
||||
```
|
||||
|
||||
## Define Vault environment variables
|
||||
Use [Vault environment variables](https://www.vaultproject.io/docs/commands/index.html#environment-variables)
|
||||
to provide connection credentials and other important Vault-related information to InfluxDB.
|
||||
|
||||
#### Required environment variables
|
||||
- `VAULT_ADDR`: The API address of your Vault server _(provided in the Vault server output)_.
|
||||
- `VAULT_TOKEN`: The [Vault token](https://learn.hashicorp.com/vault/getting-started/authentication)
|
||||
required to access your Vault server.
|
||||
|
||||
_Your Vault server configuration may require other environment variables._
|
||||
|
||||
```sh
|
||||
export VAULT_ADDR='http://127.0.0.1:8200' VAULT_TOKEN='s.0X0XxXXx0xXxXXxxxXxXxX0x'
|
||||
```
|
||||
|
||||
## Start InfluxDB
|
||||
Start the [`influxd` service](/v2.0/reference/cli/influxd/) with the `--secret-store`
|
||||
option set to `vault`.
|
||||
|
||||
```bash
|
||||
influxd --secret-store vault
|
||||
```
|
||||
|
||||
## Test Vault storage
|
||||
With Vault and InfluxDB servers running, use the InfluxDB API to test Vault:
|
||||
|
||||
{{% note %}}
|
||||
Replace `<org-id>` with your [organization ID](/v2.0/organizations/view-orgs/#view-your-organization-id)
|
||||
and `YOURAUTHTOKEN` with your [InfluxDB authentication token](/v2.0/security/tokens/).
|
||||
{{% /note %}}
|
||||
|
||||
##### Retrieve an organization's secrets
|
||||
```sh
|
||||
curl --request GET \
|
||||
--url http://localhost:9999/api/v2/orgs/<org-id>/secrets \
|
||||
--header 'authorization: Token YOURAUTHTOKEN'
|
||||
|
||||
# should return
|
||||
# {
|
||||
# "links": {
|
||||
# "org": "/api/v2/orgs/031c8cbefe101000",
|
||||
# "secrets": "/api/v2/orgs/031c8cbefe101000/secrets"
|
||||
# },
|
||||
# "secrets": []
|
||||
# }
|
||||
```
|
||||
|
||||
##### Add secrets to an organization
|
||||
```sh
|
||||
curl --request PATCH \
|
||||
--url http://localhost:9999/api/v2/orgs/<org-id>/secrets \
|
||||
--header 'authorization: Token YOURAUTHTOKEN' \
|
||||
--header 'content-type: application/json' \
|
||||
--data '{
|
||||
"foo": "bar",
|
||||
"hello": "world"
|
||||
}'
|
||||
|
||||
# should return 204 no content
|
||||
```
|
||||
|
||||
##### Retrieve the added secrets
|
||||
```bash
|
||||
curl --request GET \
|
||||
--url http://localhost:9999/api/v2/orgs/<org-id>/secrets \
|
||||
--header 'authorization: Token YOURAUTHTOKEN'
|
||||
|
||||
# should return
|
||||
# {
|
||||
# "links": {
|
||||
# "org": "/api/v2/orgs/031c8cbefe101000",
|
||||
# "secrets": "/api/v2/orgs/031c8cbefe101000/secrets"
|
||||
# },
|
||||
# "secrets": [
|
||||
# "foo",
|
||||
# "hello"
|
||||
# ]
|
||||
# }
|
||||
```
|
||||
|
||||
## Vault secrets storage
|
||||
For each organization, InfluxDB creates a [secrets engine](https://learn.hashicorp.com/vault/getting-started/secrets-engines)
|
||||
using the following pattern:
|
||||
|
||||
```
|
||||
/secret/data/<org-id>
|
||||
```
|
||||
|
||||
Secrets are stored in Vault as key value pairs in their respective secrets engines.
|
||||
|
||||
```
|
||||
/secret/data/031c8cbefe101000 ->
|
||||
this_key: foo
|
||||
that_key: bar
|
||||
a_secret: key
|
||||
```
|
|
@ -114,11 +114,11 @@ influx write -b bucketName -o orgName -p s @/path/to/line-protocol.txt
|
|||
```
|
||||
|
||||
## Write data in the InfluxDB UI
|
||||
1. Click **Settings** in the left navigation menu.
|
||||
1. Click **Load Data** in the left navigation menu.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Select the **Buckets** tab.
|
||||
2. Select **Buckets**.
|
||||
3. Hover over the bucket to write data to and click **{{< icon "plus" >}} Add Data**.
|
||||
4. Select **Line Protocol**.
|
||||
_You can also [use Telegraf](/v2.0/write-data/use-telegraf/) or
|
||||
|
|
|
@ -13,17 +13,17 @@ weight: 301
|
|||
Create a new scraper in the InfluxDB user interface (UI).
|
||||
|
||||
## Create a scraper in the InfluxDB UI
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Click the **Scrapers** tab.
|
||||
2. Click **Scrapers**.
|
||||
3. Click **{{< icon "plus" >}} Create Scraper**.
|
||||
4. Enter a **Name** for the scraper.
|
||||
5. Select a **Bucket** to store the scraped data.
|
||||
6. Enter the **Target URL** to scrape. The default URL value is `http://localhost:9999/metrics`,
|
||||
which provides InfluxDB-specific metrics in the [Prometheus data format](https://prometheus.io/docs/instrumenting/exposition_formats/).
|
||||
7. Click **Finish**.
|
||||
7. Click **Create**.
|
||||
|
||||
The new scraper will begin scraping data after approximately 10 seconds,
|
||||
then continue scraping in 10 second intervals.
|
||||
|
|
|
@ -13,11 +13,11 @@ weight: 303
|
|||
Delete a scraper from the InfluxDB user interface (UI).
|
||||
|
||||
## Delete a scraper from the InfluxDB UI
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Click the **Scrapers** tab. A listing of any existing scrapers appears with the
|
||||
**Name**, **URL**, and **BUCKET** for each scraper.
|
||||
2. Click **Scrapers**. A listing of any existing scrapers appears with the
|
||||
**Name**, **URL**, and **Bucket** for each scraper.
|
||||
3. Hover over the scraper you want to delete and click **Delete**.
|
||||
4. Click **Confirm**.
|
||||
|
|
|
@ -13,16 +13,16 @@ weight: 302
|
|||
Update a scraper in the InfluxDB user interface (UI).
|
||||
|
||||
{{% note %}}
|
||||
Scraper **Target URLs** and **BUCKETS** can not be updated.
|
||||
Scraper **Target URLs** and **Buckets** can not be updated.
|
||||
To modify either, [create a new scraper](/v2.0/write-data/scrape-data/manage-scrapers/create-a-scraper).
|
||||
{{% /note %}}
|
||||
|
||||
## Update a scraper in the InfluxDB UI
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Click the **Scrapers** tab. A list of existing scrapers appears.
|
||||
2. Click **Scrapers**. A list of existing scrapers appears.
|
||||
3. Hover over the scraper you would like to update and click the **{{< icon "pencil" >}}**
|
||||
that appears next to the scraper name.
|
||||
4. Enter a new name for the scraper. Press Return or click out of the name field to save the change.
|
||||
|
|
|
@ -25,33 +25,32 @@ for using Telegraf with InfluxDB v2.0._
|
|||
## Create a Telegraf configuration
|
||||
|
||||
1. Open the InfluxDB UI _(default: [localhost:9999](http://localhost:9999))_.
|
||||
2. Click **Organizations** in the left navigation menu.
|
||||
2. Click **Load Data** in the left navigation menu.
|
||||
|
||||
{{< nav-icon "orgs" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
3. Click on the name of your organization.
|
||||
4. Click the **Telegraf** tab.
|
||||
5. Click **{{< icon "plus" >}} Create Configuration**.
|
||||
6. In the **Bucket** dropdown, select the bucket where Telegraf will store collected data.
|
||||
7. Select one or more of the available plugin groups
|
||||
3. Select **Telegrafs**.
|
||||
4. Click **{{< icon "plus" >}} Create Configuration**.
|
||||
5. In the **Bucket** dropdown, select the bucket where Telegraf will store collected data.
|
||||
6. Select one or more of the available plugin groups
|
||||
(e.g. **System**, **Docker**, **Kubernetes**, **NGINX**, or **Redis**), and click **Continue**.
|
||||
{{% note %}}
|
||||
All Telegraf plugins are supported, but only a subset are configurable using the InfluxDB UI.
|
||||
To use plugins other than those listed, you must [manually configure Telegraf](/v2.0/write-data/use-telegraf/manual-config).
|
||||
{{% /note %}}
|
||||
8. Review the list of **Plugins to Configure** for configuration requirements.
|
||||
7. Review the list of **Plugins to Configure** for configuration requirements.
|
||||
Plugins listed with a <span style="color:#32B08C">{{< icon "check" >}}</span>
|
||||
require no additional configuration.
|
||||
To configure a plugin or access plugin documentation, click the plugin name.
|
||||
9. Provide a **Telegraf Configuration Name** and an optional **Telegraf Configuration Description**.
|
||||
10. Click **Create and Verify**.
|
||||
11. The **Test Your Configuration** page provides instructions for how to start
|
||||
8. Provide a **Telegraf Configuration Name** and an optional **Telegraf Configuration Description**.
|
||||
9. Click **Create and Verify**.
|
||||
10. The **Test Your Configuration** page provides instructions for how to start
|
||||
Telegraf using the generated configuration.
|
||||
_See [Start Telegraf](#start-telegraf) below for detailed information about what each step does._
|
||||
12. Once Telegraf is running, click **Listen for Data** to confirm Telegraf is successfully
|
||||
11. Once Telegraf is running, click **Listen for Data** to confirm Telegraf is successfully
|
||||
sending data to InfluxDB.
|
||||
Once confirmed, a **Connection Found!** message appears.
|
||||
13. Click **Finish**. Your configuration name and the associated bucket name appears
|
||||
12. Click **Finish**. Your configuration name and the associated bucket name appears
|
||||
in the list of Telegraf connections.
|
||||
|
||||
## Start Telegraf
|
||||
|
|
|
@ -12,16 +12,14 @@ weight: 303
|
|||
|
||||
To delete a Telegraf configuration:
|
||||
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the left navigation menu.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Click the **Telegraf** tab.
|
||||
2. Select **Telegraf**.
|
||||
3. Hover over the configuration you want to delete, click the **{{< icon "trash" >}}**
|
||||
icon, and **Delete**.
|
||||
|
||||
{{< img-hd src="/img/2-0-telegraf-config-delete.png" />}}
|
||||
|
||||
{{% note %}}
|
||||
Deleting a Telegraf configuration does not affect _**running**_ Telegraf agents.
|
||||
However, if an agents stops, it needs a new configuration to start.
|
||||
|
|
|
@ -17,13 +17,11 @@ of a Telegraf configuration created in the UI.
|
|||
You cannot modify Telegraf settings in existing Telegraf configurations through the UI.
|
||||
{{% /note %}}
|
||||
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in left the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Click the **Telegraf** tab.
|
||||
2. Select **Telegraf**.
|
||||
3. Hover over the configuration you want to edit and click **{{< icon "pencil" >}}**
|
||||
to update the name or description.
|
||||
4. Press Return or click out of the editable field to save your changes.
|
||||
|
||||
{{< img-hd src="/img/2-0-telegraf-config-update.png" />}}
|
||||
|
|
|
@ -14,11 +14,11 @@ weight: 301
|
|||
|
||||
View Telegraf configuration information in the InfluxDB user interface (UI):
|
||||
|
||||
1. Click the **Settings** tab in the navigation bar.
|
||||
1. Click **Load Data** in the navigation bar.
|
||||
|
||||
{{< nav-icon "settings" >}}
|
||||
{{< nav-icon "load data" >}}
|
||||
|
||||
2. Click the **Telegraf** tab.
|
||||
2. Click **Telegraf**.
|
||||
|
||||
### View and download the telegraf.conf
|
||||
To view the actual `telegraf.conf` associated with the configuration,
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
<h3>Visualize Data</h3>
|
||||
</a>
|
||||
|
||||
<a class="card quarter" href="monitor-alert">
|
||||
<h3>Monitor & alert</h3>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
{{ else if or (eq $icon "refresh") (eq $icon "replay") }}
|
||||
<span class="inline icon-ui-refresh middle small"></span>
|
||||
{{ else if or (eq $icon "remove") (eq $icon "x") }}
|
||||
<span class="inline icon-ui-remove middle small"></span>
|
||||
<span class="inline icon-ui-remove top small"></span>
|
||||
{{ else if eq $icon "search" }}
|
||||
<span class="inline icon-ui-search middle small"></span>
|
||||
{{ else if or (eq $icon "trash") (eq $icon "trashcan") (eq $icon "delete") }}
|
||||
|
@ -54,6 +54,10 @@
|
|||
<span class="inline icon-ui-nav-chat large"></span>
|
||||
{{ else if eq $icon "chat" }}
|
||||
<span class="inline icon-ui-chat large"></span>
|
||||
{{ else if or (eq $icon "eye-open") (eq $icon "eye") (eq $icon "view") }}
|
||||
<span class="inline icon-ui-eye-open large"></span>
|
||||
{{ else if or (eq $icon "eye-closed") (eq $icon "hide") }}
|
||||
<span class="inline icon-ui-eye-closed large"></span>
|
||||
{{ else if eq $icon "add-label" }}
|
||||
<span class="inline add-btn-round"></span>
|
||||
{{ else if eq $icon "toggle" }}
|
||||
|
|
|
@ -11,11 +11,14 @@
|
|||
{{ else if eq $navIcon "tasks" }}
|
||||
{{ .Scratch.Set "icon" "calendar" }}
|
||||
{{ .Scratch.Set "title" "Tasks" }}
|
||||
{{ else if or (eq $navIcon "organizations") (eq $navIcon "orgs") }}
|
||||
{{ .Scratch.Set "icon" "organizations" }}
|
||||
{{ .Scratch.Set "title" "Organizations" }}
|
||||
{{ else if or (eq $navIcon "monitor") (eq $navIcon "alerts") (eq $navIcon "bell") }}
|
||||
{{ .Scratch.Set "icon" "bell" }}
|
||||
{{ .Scratch.Set "title" "Monitoring & Alerting" }}
|
||||
{{ else if or (eq $navIcon "disks") (eq $navIcon "load data") (eq $navIcon "load-data") }}
|
||||
{{ .Scratch.Set "icon" "disks-nav" }}
|
||||
{{ .Scratch.Set "title" "Load Data" }}
|
||||
{{ else if eq $navIcon "settings" }}
|
||||
{{ .Scratch.Set "icon" "wrench-2" }}
|
||||
{{ .Scratch.Set "icon" "wrench-nav" }}
|
||||
{{ .Scratch.Set "title" "Settings" }}
|
||||
{{ else if or (eq $navIcon "feedback") }}
|
||||
{{ .Scratch.Set "icon" "nav-chat" }}
|
||||
|
|
Binary file not shown.
|
@ -66,9 +66,14 @@
|
|||
<glyph unicode="" glyph-name="x" d="M571.733 298.667l226.133 226.133c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0l-226.133-226.133-226.133 226.133c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l226.133-226.133-226.133-226.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8l226.133 226.133 226.133-226.133c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-226.133 226.133z" />
|
||||
<glyph unicode="" glyph-name="ui-wrench-2" d="M199.68-193.28c-43.52 0-87.040 17.92-120.32 51.2-28.16 25.6-48.64 71.68-48.64 117.76 0 43.52 17.92 84.48 48.64 117.76l330.24 327.68c-2.56 17.92-5.12 35.84-5.12 53.76 0 161.28 133.12 294.4 294.4 294.4 35.84 0 66.56-7.68 92.16-15.36s40.96-28.16 43.52-48.64c2.56-17.92 0-35.84-10.24-51.2l-5.12-7.68-110.080-110.080c-2.56-2.56-5.12-5.12-5.12-7.68s2.56-5.12 5.12-7.68l38.4-38.4c5.12-5.12 12.8-5.12 17.92 0l107.52 107.52c12.8 17.92 38.4 25.6 58.88 20.48 20.48-2.56 40.96-17.92 48.64-40.96 7.68-28.16 15.36-58.88 15.36-94.72 0-161.28-133.12-294.4-294.4-294.4-17.92 0-35.84 2.56-53.76 5.12l-330.24-330.24c-33.28-30.72-74.24-48.64-117.76-48.64zM698.88 692.48c-120.32 0-217.6-97.28-217.6-217.6 0-20.48 2.56-35.84 7.68-58.88l5.12-20.48-358.4-358.4c-17.92-17.92-28.16-40.96-28.16-61.44 0-17.92 7.68-46.080 25.6-61.44 38.4-38.4 94.72-38.4 128-5.12l358.4 358.4 20.48-5.12c17.92-5.12 35.84-7.68 56.32-7.68 120.32 0 217.6 97.28 217.6 217.6 0 15.36-2.56 28.16-5.12 46.080l-89.6-92.16c-35.84-35.84-89.6-35.84-125.44 0l-38.4 38.4c-17.92 17.92-25.6 38.4-25.6 64 0 23.040 10.24 46.080 25.6 64l94.72 94.72c-20.48 2.56-35.84 5.12-51.2 5.12z" />
|
||||
<glyph unicode="" glyph-name="chat" horiz-adv-x="879" d="M805.357 586.934h-732.144c-36.607 0-73.214-36.607-73.214-73.214v-439.286c0-36.607 36.607-73.214 73.214-73.214h292.857l292.857-219.643v219.643h146.429c36.607 0 73.214 36.607 73.214 73.214v439.286c0 36.607-36.607 73.214-73.214 73.214z" />
|
||||
<glyph unicode="" glyph-name="bell" horiz-adv-x="961" d="M944.923 49.267l-35.234 60.859c-12.813 22.422-25.625 41.641-35.234 57.656-35.234 54.453-54.453 86.484-67.266 150.547l-44.844 214.61c-25.625 137.735-147.344 233.828-285.078 237.031h-6.406c-140.938 0-265.86-105.703-288.282-246.641l-28.828-182.578c-12.813-86.484-38.438-131.328-86.484-208.203-6.406-12.813-16.016-25.625-22.422-41.641l-22.422-41.641c-25.625-41.641-25.625-96.094 0-137.735 19.219-44.844 67.266-70.469 118.516-70.469h214.61c12.813-54.453 64.063-96.094 124.922-96.094 57.656 0 112.109 41.641 124.922 96.094h214.61c48.047 0 99.297 25.625 124.922 70.469 22.422 41.641 22.422 96.094 0 137.735zM820.001-62.843h-679.063c-32.031 0-54.453 35.234-38.438 64.063l22.422 41.641c60.859 105.703 105.703 160.156 121.719 281.875l28.828 182.578c19.219 92.891 96.094 166.563 195.391 166.563h3.203c92.891 0 172.969-67.266 188.985-156.953l44.844-214.61c19.219-105.703 57.656-147.344 115.313-240.235l35.234-60.859c16.016-28.828-6.406-64.063-38.438-64.063z" />
|
||||
<glyph unicode="" glyph-name="disks-nav" d="M512 706.909c-162.909 0-325.818-41.891-325.818-139.636v-558.545c0-97.745 162.909-139.636 325.818-139.636s325.818 41.891 325.818 139.636v558.545c0 97.745-162.909 139.636-325.818 139.636zM744.727 385.745c-13.964-13.964-93.091-51.2-232.727-51.2s-218.764 37.236-232.727 51.2v79.127c60.509-23.273 148.945-37.236 232.727-37.236s172.218 13.964 232.727 37.236v-79.127zM744.727 199.564c-13.964-13.964-93.091-51.2-232.727-51.2s-218.764 37.236-232.727 51.2v79.127c60.509-23.273 148.945-37.236 232.727-37.236s172.218 13.964 232.727 37.236v-79.127zM512 613.818c130.327 0 204.8-27.927 228.073-46.545-23.273-18.618-97.745-46.545-228.073-46.545s-204.8 27.927-228.073 46.545c23.273 18.618 97.745 46.545 228.073 46.545zM512-37.818c-139.636 0-218.764 32.582-232.727 51.2v79.127c60.509-23.273 148.945-37.236 232.727-37.236s172.218 13.964 232.727 37.236v-79.127c-13.964-18.618-93.091-51.2-232.727-51.2z" />
|
||||
<glyph unicode="" glyph-name="wrench-nav" d="M186.182-177.455c-37.236 0-74.473 13.964-97.745 41.891-55.855 55.855-55.855 144.291 0 195.491l339.782 339.782c-4.655 27.927-9.309 51.2-9.309 74.473 0 153.6 125.673 279.273 279.273 279.273 41.891 0 88.436-9.309 130.327-32.582 13.964-4.655 23.273-18.618 23.273-32.582s-4.655-27.927-13.964-41.891l-121.018-121.018 37.236-37.236 121.018 121.018c9.309 9.309 23.273 13.964 41.891 13.964 13.964-4.655 27.927-9.309 32.582-23.273 18.618-41.891 27.927-83.782 27.927-125.673 0-153.6-125.673-279.273-279.273-279.273-23.273 0-46.545 4.655-69.818 9.309l-339.782-339.782c-27.927-27.927-65.164-41.891-102.4-41.891zM698.182 660.364c-102.4 0-186.182-83.782-186.182-186.182 0-23.273 4.655-46.545 13.964-69.818 4.655-18.618 4.655-37.236-9.309-51.2l-363.055-363.055c-18.618-18.618-18.618-46.545 0-65.164s46.545-18.618 65.164 0l363.055 363.055c13.964 13.964 32.582 18.618 51.2 9.309 23.273-9.309 46.545-13.964 69.818-13.964 102.4 0 186.182 83.782 186.182 186.182 0 4.655 0 9.309 0 18.618l-97.745-97.745c-18.618-18.618-46.545-18.618-65.164 0l-102.4 102.4c-13.964 9.309-18.618 18.618-18.618 32.582s4.655 23.273 13.964 32.582l97.745 102.4c-4.655 0-13.964 0-18.618 0z" />
|
||||
<glyph unicode="" glyph-name="cloud" d="M835.77-54.33h-646.539c-102.5 0-189.231 86.731-189.231 197.115 0 78.846 43.365 149.808 110.385 181.346 0 7.885 0 15.769 0 23.654 0 149.808 114.327 268.077 256.25 268.077 86.731 0 165.577-43.365 212.885-118.269 23.654 7.885 47.308 11.827 70.961 11.827 102.5 0 189.231-70.961 216.827-173.461 90.674-15.769 157.692-94.615 157.692-193.174 0-110.385-82.789-197.115-189.231-197.115zM366.635 537.016c-98.558 0-177.404-86.731-177.404-189.231 0-15.769 0-27.596 3.942-43.365l7.885-39.423-35.481-7.885c-51.25-11.827-86.731-59.135-86.731-114.327 0-67.019 47.308-118.269 110.385-118.269h646.539c59.135 0 110.385 51.25 110.385 118.269s-47.308 118.269-110.385 118.269h-39.423l-3.942 35.481c-7.885 78.846-70.961 137.981-141.924 137.981-23.654 0-47.308-7.885-70.961-19.711l-39.423-23.654-19.711 39.423c-23.654 67.019-86.731 106.442-153.75 106.442z" />
|
||||
<glyph unicode="" glyph-name="nav-chat" d="M729.327-192.311c-7.885 0-15.769 3.942-23.654 7.885l-279.904 208.942h-275.961c-59.135 0-110.385 55.192-110.385 110.385v346.924c0 59.135 55.192 114.327 110.385 114.327h721.443c59.135 0 114.327-55.192 114.327-114.327v-346.924c0-59.135-55.192-110.385-110.385-110.385h-106.442v-177.404c0-15.769-7.885-27.596-23.654-35.481-3.942-3.942-7.885-3.942-15.769-3.942zM149.808 517.305c-11.827 0-31.539-19.711-31.539-35.481v-346.924c0-15.769 19.711-31.539 31.539-31.539h287.789c7.885 0 15.769-3.942 23.654-7.885l224.711-169.52v137.981c0 23.654 15.769 39.423 39.423 39.423h145.865c15.769 0 31.539 19.711 31.539 31.539v346.924c3.942 15.769-15.769 35.481-27.596 35.481h-725.385z" />
|
||||
<glyph unicode="" glyph-name="map2" d="M672 576l-320 128-352-128v-768l352 128 320-128 352 128v768l-352-128zM384 622.27l256-102.4v-630.138l-256 102.398v630.14zM64 531.172l256 93.090v-631.8l-256-93.088v631.798zM960-19.172l-256-93.092v631.8l256 93.090v-631.798z" />
|
||||
<glyph unicode="" glyph-name="eye-closed" d="M1017.313 272.845c-41 76.875-99.938 143.5-171.688 192.188l-128.125-128.125c7.688-23.063 12.813-48.688 12.813-76.875 0-120.438-97.375-217.813-217.813-217.813-28.188 0-53.813 5.125-76.875 12.813l-82-82c51.25-12.813 105.063-20.5 158.875-20.5 215.25 0 407.438 112.75 504.813 292.125l7.688 12.813-7.688 15.375zM179.375 52.47l128.125 128.125c-7.688 23.063-12.813 48.688-12.813 76.875 0 120.438 97.375 217.813 217.813 217.813 28.188 0 53.813-5.125 76.875-12.813l82 82c-51.25 12.813-105.063 20.5-158.875 20.5-217.813 0-410-112.75-504.813-292.125l-7.688-15.375 7.688-15.375c41-76.875 99.938-140.938 171.688-189.625zM128.125-165.343c-10.25 0-20.5 2.563-28.188 10.25-15.375 15.375-15.375 38.438 0 53.813l768.751 768.751c15.375 15.375 38.438 15.375 53.813 0s15.375-38.438 0-53.813l-768.751-768.751c-5.125-7.688-15.375-10.25-25.625-10.25z" />
|
||||
<glyph unicode="" glyph-name="eye-open" d="M1017.313 272.845c-97.375 179.375-289.563 292.125-504.813 292.125-217.813 0-410-112.75-504.813-292.125l-7.688-15.375 7.688-15.375c97.375-179.375 289.563-292.125 504.813-292.125s407.438 112.75 504.813 292.125l7.688 15.375-7.688 15.375zM512.5 39.657c-120.438 0-217.813 97.375-217.813 217.813s97.375 217.813 217.813 217.813 217.813-97.375 217.813-217.813-97.375-217.813-217.813-217.813zM550.938 295.908c-25.625 25.625-25.625 66.625 0 89.688 25.625 25.625 66.625 25.625 89.688 0s25.625-66.625 0-89.688c-25.625-25.625-64.063-25.625-89.688 0z" />
|
||||
<glyph unicode="" glyph-name="heart" d="M755.188 704c-107.63 0-200.258-87.554-243.164-179-42.938 91.444-135.578 179-243.216 179-148.382 0-268.808-120.44-268.808-268.832 0-301.846 304.5-380.994 512.022-679.418 196.154 296.576 511.978 387.206 511.978 679.418 0 148.392-120.43 268.832-268.812 268.832z" />
|
||||
<glyph unicode="" glyph-name="loop2" d="M889.68 601.68c-93.608 102.216-228.154 166.32-377.68 166.32-282.77 0-512-229.23-512-512h96c0 229.75 186.25 416 416 416 123.020 0 233.542-53.418 309.696-138.306l-149.696-149.694h352v352l-134.32-134.32zM928 256c0-229.75-186.25-416-416-416-123.020 0-233.542 53.418-309.694 138.306l149.694 149.694h-352v-352l134.32 134.32c93.608-102.216 228.154-166.32 377.68-166.32 282.77 0 512 229.23 512 512h-96z" />
|
||||
<glyph unicode="" glyph-name="github" d="M512.008 755.358c-282.738 0-512.008-229.218-512.008-511.998 0-226.214 146.704-418.132 350.136-485.836 25.586-4.738 34.992 11.11 34.992 24.632 0 12.204-0.48 52.542-0.696 95.324-142.448-30.976-172.504 60.41-172.504 60.41-23.282 59.176-56.848 74.916-56.848 74.916-46.452 31.778 3.51 31.124 3.51 31.124 51.4-3.61 78.476-52.766 78.476-52.766 45.672-78.27 119.776-55.64 149.004-42.558 4.588 33.086 17.852 55.68 32.506 68.464-113.73 12.942-233.276 56.85-233.276 253.032 0 55.898 20.004 101.574 52.76 137.428-5.316 12.9-22.854 64.972 4.952 135.5 0 0 43.006 13.752 140.84-52.49 40.836 11.348 84.636 17.036 128.154 17.234 43.502-0.198 87.336-5.886 128.256-17.234 97.734 66.244 140.656 52.49 140.656 52.49 27.872-70.528 10.35-122.6 5.036-135.5 32.82-35.856 52.694-81.532 52.694-137.428 0-196.654-119.778-239.95-233.79-252.624 18.364-15.89 34.724-47.046 34.724-94.812 0-68.508-0.596-123.644-0.596-140.508 0-13.628 9.222-29.594 35.172-24.566 203.322 67.776 349.842 259.626 349.842 485.768 0 282.78-229.234 511.998-511.992 511.998z" />
|
||||
|
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 56 KiB |
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue