From fee62e27e79730b8cb03e4cbfd7fecc163755f0e Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 3 Sep 2020 10:41:19 -0600 Subject: [PATCH 01/23] added release notes for flux 0.82-0.83 --- .../v2.0/reference/release-notes/flux.md | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/content/influxdb/v2.0/reference/release-notes/flux.md b/content/influxdb/v2.0/reference/release-notes/flux.md index d99cfcac3..72a96c364 100644 --- a/content/influxdb/v2.0/reference/release-notes/flux.md +++ b/content/influxdb/v2.0/reference/release-notes/flux.md @@ -9,11 +9,59 @@ menu: --- {{% note %}} -The latest release of InfluxDB v2.0 beta includes **Flux v0.77.1**. +_The latest release of InfluxDB v2.0 beta includes **Flux v0.77.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.83.1 [2020-09-02] + +### Bug fixes +- Single value integral interpolation. + +--- + +## v0.83.0 [2020-09-01] + +### Features +- Improve window errors. +- Add BigQuery support to [`sql` package](#). +- Add `TypeExpression` to `BuiltinStmt` and fix tests. +- Time-weighted average ([`timeWeightedAvg()` function](#)). +- Integration with linear interpolation. +- Make experimental tracing an attribute of the context. + +### Bug fixes +- Update builtin statement for `integral`. +- Add Rust JSON tests. +- CSV no longer deadlocks when next transformation does not consume table. + +--- + +## v0.82.2 [2020-08-25] + +### Features +- Add `tasks.lastSuccess` function to retrieve the last successful run of an InfluxDB task. + +--- + +## v0.82.1 [2020-08-25] +- _Internal code cleanup._ + +--- + +## v0.82.0 [2020-08-24] + +### Features +- Add the [`profiler` package](#). +- Add a documentation URL field to Flux errors. +- Check InfluxDB schema compatibility. + +### Bug fixes +- Panic when a map object property contains an invalid type. + +--- + ## v0.81.0 [2020-08-17] ### Features From 729845c9afde68d635312feab1d3e272114f0b2d Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 3 Sep 2020 10:53:27 -0600 Subject: [PATCH 02/23] added the flux profiler package --- .../reference/flux/stdlib/profiler/_index.md | 38 +++++++++++++++++++ .../v2.0/reference/release-notes/flux.md | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md diff --git a/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md b/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md new file mode 100644 index 000000000..5325c4379 --- /dev/null +++ b/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md @@ -0,0 +1,38 @@ +--- +title: Flux Profiler package +list_title: Profiler package +description: > + The Flux Profiler package provides performance profiling tools for Flux queries and operations. + Import the `profiler` package. +menu: + influxdb_2_0_ref: + name: Profiler + parent: Flux standard library +weight: 202 +influxdb/v2.0/tags: [functions, optimize, package] +--- + +The Flux Profiler package provides performance profiling tools for Flux queries and operations. +Import the `profiler` package: + +```js +import "profiler" +``` + +## Options +The Profiler package includes the following options: + +#### enabledProfilers +Use the `enabledProfilers` option to enable Flux profilers. + +{{% note %}} +_Available profilers will be added as they are released._ +{{% /note %}} + +_**Data type:** Array of strings_ + +```js +import "profiler" + +option profiler.enabledProfilers = [""] +``` \ No newline at end of file diff --git a/content/influxdb/v2.0/reference/release-notes/flux.md b/content/influxdb/v2.0/reference/release-notes/flux.md index 72a96c364..649d1148d 100644 --- a/content/influxdb/v2.0/reference/release-notes/flux.md +++ b/content/influxdb/v2.0/reference/release-notes/flux.md @@ -41,7 +41,7 @@ InfluxDB until the next InfluxDB v2.0 release._ ## v0.82.2 [2020-08-25] ### Features -- Add `tasks.lastSuccess` function to retrieve the last successful run of an InfluxDB task. +- Add [`tasks.lastSuccess` function](#) to retrieve the last successful run of an InfluxDB task. --- From a47b2e0111e20819a1c376c158640d8ae2fae0b8 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 3 Sep 2020 10:55:33 -0600 Subject: [PATCH 03/23] added link to profiler package in flux release notes --- content/influxdb/v2.0/reference/release-notes/flux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/influxdb/v2.0/reference/release-notes/flux.md b/content/influxdb/v2.0/reference/release-notes/flux.md index 649d1148d..6daeb6ed3 100644 --- a/content/influxdb/v2.0/reference/release-notes/flux.md +++ b/content/influxdb/v2.0/reference/release-notes/flux.md @@ -53,7 +53,7 @@ InfluxDB until the next InfluxDB v2.0 release._ ## v0.82.0 [2020-08-24] ### Features -- Add the [`profiler` package](#). +- Add the [`profiler` package](/influxdb/v2.0/reference/flux/stdlib/profiler/). - Add a documentation URL field to Flux errors. - Check InfluxDB schema compatibility. From 97429b4b0f0e99a4cdc307093618de21535b5371 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 3 Sep 2020 11:25:58 -0600 Subject: [PATCH 04/23] added flux influxdb tasks package --- .../flux/stdlib/influxdb-tasks/_index.md | 44 +++++++++++++++++++ .../flux/stdlib/influxdb-tasks/lastsuccess.md | 41 +++++++++++++++++ .../reference/flux/stdlib/profiler/_index.md | 4 +- .../v2.0/reference/release-notes/flux.md | 3 +- 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/_index.md create mode 100644 content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md diff --git a/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/_index.md b/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/_index.md new file mode 100644 index 000000000..be8476054 --- /dev/null +++ b/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/_index.md @@ -0,0 +1,44 @@ +--- +title: Flux InfluxDB Tasks package +list_title: InfluxDB Tasks package +description: > + The Flux InfluxDB Tasks package provides options and functions for working with + [InfluxDB tasks](/influxdb/v2.0/process-data/get-started/). + Import the `influxdata/influxdb/tasks` package. +aliases: + - /influxdb/v2.0/reference/flux/functions/influxdb-v1/ +menu: + influxdb_2_0_ref: + name: InfluxDB Tasks + parent: Flux standard library +weight: 202 +influxdb/v2.0/tags: [functions, tasks, package] +related: + - /influxdb/v2.0/process-data/get-started/ +--- + +The Flux InfluxDB Tasks package provides options and functions for working with +[InfluxDB tasks](/influxdb/v2.0/process-data/get-started/). +Import the `influxdata/influxdb/tasks` package: + +```js +import "influxdata/influxdb/tasks" +``` + +## Options +The InfluxDB Tasks package provides the following options: + +#### lastSuccessTime +Define the time of the last successful task run. +_Only use this option to override the time of the last successful run provided by +the InfluxDB task engine._ + +```js +import "influxdata/influxdb/tasks" + +option tasks.lastSuccessTime = 0000-01-01T00:00:00Z +``` + +## Functions + +{{< children type="functions" show="pages" >}} diff --git a/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md b/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md new file mode 100644 index 000000000..8a2b0d9bb --- /dev/null +++ b/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md @@ -0,0 +1,41 @@ +--- +title: tasks.lastSuccess() function +description: The `tasks.lastSuccess()` function returns ... +menu: + influxdb_2_0_ref: + name: tasks.lastSuccess + parent: InfluxDB Tasks +weight: 301 +--- + +The `tasks.lastSuccess()` function returns the time of last successful run of the +InfluxDB task or the value of the `orTime` parameter if the task has never successfully run. + +```js +import "influxdata/influxdb/tasks" + +tasks.lastSuccess(orTime: 2020-01-01T00:00:00Z) +``` + +## Parameters + +### orTime +The default time value returned if the task has never successfully run. + +_**Data type:** Time_ + +## Examples + +##### Query data since that last successful task run +```js +import "influxdata/influxdb/tasks" + +options task = { + name: "Example task", + every: 30m +} + +from(bucket: "example-bucket") + |> range(start: tasks.lastSuccess(orTime: 2020-01-01T00:00:00Z)) + // ... +``` \ No newline at end of file diff --git a/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md b/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md index 5325c4379..eda8a643a 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md @@ -10,6 +10,8 @@ menu: parent: Flux standard library weight: 202 influxdb/v2.0/tags: [functions, optimize, package] +related: + - /influxdb/v2.0/query-data/optimize-queries/ --- The Flux Profiler package provides performance profiling tools for Flux queries and operations. @@ -23,7 +25,7 @@ import "profiler" The Profiler package includes the following options: #### enabledProfilers -Use the `enabledProfilers` option to enable Flux profilers. +Enable Flux profilers. {{% note %}} _Available profilers will be added as they are released._ diff --git a/content/influxdb/v2.0/reference/release-notes/flux.md b/content/influxdb/v2.0/reference/release-notes/flux.md index 6daeb6ed3..2b78efba1 100644 --- a/content/influxdb/v2.0/reference/release-notes/flux.md +++ b/content/influxdb/v2.0/reference/release-notes/flux.md @@ -41,7 +41,8 @@ InfluxDB until the next InfluxDB v2.0 release._ ## v0.82.2 [2020-08-25] ### Features -- Add [`tasks.lastSuccess` function](#) to retrieve the last successful run of an InfluxDB task. +- Add [`tasks.lastSuccess` function](/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess/) + to retrieve the time of the last successful run of an InfluxDB task. --- From 269581842ad8fb851104767cea8ef932869ae7ff Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 3 Sep 2020 14:57:57 -0600 Subject: [PATCH 05/23] updated flux integral with timeColumn and interpolate params --- .../transformations/aggregates/integral.md | 40 +++++++++++++++++-- .../reference/flux/stdlib/profiler/_index.md | 38 +++++++++++++++--- .../v2.0/reference/release-notes/flux.md | 4 +- 3 files changed, 71 insertions(+), 11 deletions(-) diff --git a/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md b/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md index 090579c14..04ab2b672 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md @@ -20,23 +20,46 @@ _**Function type:** Aggregate_ _**Output data type:** Float_ ```js -integral(unit: 10s, column: "_value") +integral( + unit: 10s, + column: "_value", + timeColumn: "_time", + interpolation: "" +) ``` ## Parameters ### unit -The time duration used when computing the integral. +Time duration used when computing the integral. _**Data type:** Duration_ ### column -The column on which to operate. +Column on which to operate. Defaults to `"_value"`. _**Data type:** String_ +### timeColumn +Column that contains time values to use in the operation. +Defaults to `"_time"`. + +_**Data type:** String_ + +### interpolate +Type of value interpolation to use. +Defaults to `""`. + +Use one of the following interpolation options: + +- linear + +_**Data type:** String_ + ## Examples + +##### Calculate the integral without interpolation ```js from(bucket: "example-bucket") |> range(start: -5m) @@ -46,3 +69,14 @@ from(bucket: "example-bucket") ) |> integral(unit:10s) ``` + +##### Calculate the integral with linear interpolation +```js +from(bucket: "example-bucket") + |> range(start: -5m) + |> filter(fn: (r) => + r._measurement == "cpu" and + r._field == "usage_system" + ) + |> integral(unit:10s, interpolate: "linear") +``` diff --git a/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md b/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md index eda8a643a..a210d078c 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/profiler/_index.md @@ -24,17 +24,43 @@ import "profiler" ## Options The Profiler package includes the following options: -#### enabledProfilers +### enabledProfilers Enable Flux profilers. -{{% note %}} -_Available profilers will be added as they are released._ -{{% /note %}} - _**Data type:** Array of strings_ ```js import "profiler" option profiler.enabledProfilers = [""] -``` \ No newline at end of file +``` + +#### Available profilers + +##### query +The `query` profiler provides statistics about the execution of an entire Flux script. +When enabled, results returned by [`yield()`](/influxdb/v2.0/reference/flux/stdlib/built-in/outputs/yield/) +include a table with the following columns: + +- **TotalDuration**: total query duration in nanoseconds. +- **CompileDuration**: number of nanoseconds spent compiling the query. +- **QueueDuration**: number of nanoseconds spent queueing. +- **RequeueDuration**: number fo nanoseconds spent requeueing. +- **PlanDuration**: number of nanoseconds spent planning the query. +- **ExecuteDuration**: number of nanoseconds spent executing the query. +- **Concurrency**: number of goroutines allocated to process the query. +- **MaxAllocated**: maximum number of bytes the query allocated. +- **TotalAllocated**: total number of bytes the query allocated (includes memory that was freed and then used again). +- **RuntimeErrors**: error messages returned during query execution. +- **flux/query-plan**: Flux query plan. +- **influxdb/scanned-values**: value scanned by InfluxDB. +- **influxdb/scanned-bytes**: number of bytes scanned by InfluxDB. + +#### Use the query profiler to output statistics about query execution +```js +import "profilers" + +option profiler.enabledProfiles["query"] + +// ... Query to profile +``` diff --git a/content/influxdb/v2.0/reference/release-notes/flux.md b/content/influxdb/v2.0/reference/release-notes/flux.md index 2b78efba1..7b8cdf586 100644 --- a/content/influxdb/v2.0/reference/release-notes/flux.md +++ b/content/influxdb/v2.0/reference/release-notes/flux.md @@ -28,11 +28,11 @@ InfluxDB until the next InfluxDB v2.0 release._ - Add BigQuery support to [`sql` package](#). - Add `TypeExpression` to `BuiltinStmt` and fix tests. - Time-weighted average ([`timeWeightedAvg()` function](#)). -- Integration with linear interpolation. +- Integral with linear interpolation. - Make experimental tracing an attribute of the context. ### Bug fixes -- Update builtin statement for `integral`. +- Update builtin statement for `integral()`. - Add Rust JSON tests. - CSV no longer deadlocks when next transformation does not consume table. From 40021cb275c56d7d806e923533805e41e831dfa8 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 3 Sep 2020 14:58:53 -0600 Subject: [PATCH 06/23] minor updates to flux integral --- .../stdlib/built-in/transformations/aggregates/integral.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md b/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md index 04ab2b672..c36cbe630 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md @@ -48,7 +48,7 @@ Defaults to `"_time"`. _**Data type:** String_ ### interpolate -Type of value interpolation to use. +Type of interpolation to use. Defaults to `""`. Use one of the following interpolation options: @@ -59,7 +59,7 @@ _**Data type:** String_ ## Examples -##### Calculate the integral without interpolation +##### Calculate the integral ```js from(bucket: "example-bucket") |> range(start: -5m) From db6e89ce041136d542bb29eecf025cda9897e978 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 3 Sep 2020 15:15:40 -0600 Subject: [PATCH 07/23] added timeWeightedAvg function --- .../aggregates/timeweightedavg.md | 53 +++++++++++++++++++ .../v2.0/reference/release-notes/flux.md | 5 +- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg.md diff --git a/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg.md b/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg.md new file mode 100644 index 000000000..0b8b4cc1a --- /dev/null +++ b/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg.md @@ -0,0 +1,53 @@ +--- +title: timeWeightedAvg() function +description: The `timeWeightedAvg()` function outputs the timeWeightedAvg of non-null records as a float. +menu: + influxdb_2_0_ref: + name: timeWeightedAvg + parent: built-in-aggregates +weight: 501 +related: + - /influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral/ +--- + +The `timeWeightedAvg()` function outputs the time-weighted average of non-null records +in a table as a float. +Time is weighted using the linearly interpolated integral of values in the table. + +_**Function type:** Aggregate_ +_**Output data type:** Float_ + +```js +timeWeightedAvg(unit: "_value") +``` + +## Parameters + +### unit +Time duration used when computing the time-weighted average. + +_**Data type:** Duration_ + +## Examples +```js +from(bucket: "example-bucket") + |> range(start: -5m) + |> filter(fn: (r) => + r._measurement == "cpu" and + r._field == "usage_system" + ) + |> timeWeightedAvg(unit: 1m) +``` + +## Function definition +```js +timeWeightedAvg = (tables=<-, unit) => tables + |> integral( + unit: unit, + interpolate: "linear" + ) + |> map(fn: (r) => ({ + r with + _value: (r._value * float(v: uint(v: unit))) / float(v: int(v: r._stop) - int(v: r._start)) + })) +``` \ No newline at end of file diff --git a/content/influxdb/v2.0/reference/release-notes/flux.md b/content/influxdb/v2.0/reference/release-notes/flux.md index 7b8cdf586..6f983cb59 100644 --- a/content/influxdb/v2.0/reference/release-notes/flux.md +++ b/content/influxdb/v2.0/reference/release-notes/flux.md @@ -27,8 +27,9 @@ InfluxDB until the next InfluxDB v2.0 release._ - Improve window errors. - Add BigQuery support to [`sql` package](#). - Add `TypeExpression` to `BuiltinStmt` and fix tests. -- Time-weighted average ([`timeWeightedAvg()` function](#)). -- Integral with linear interpolation. +- Time-weighted average ([`timeWeightedAvg()` function](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg/)). +- Update [`integral()`](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral/) + with linear interpolation. - Make experimental tracing an attribute of the context. ### Bug fixes From 75b7fdd00a8bacd134dc1ec1cef6cbb53264635c Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Thu, 3 Sep 2020 15:26:13 -0600 Subject: [PATCH 08/23] added BigQuery support to sql package --- content/influxdb/v2.0/query-data/flux/sql.md | 35 +++++++++++-- .../v2.0/reference/flux/stdlib/sql/_index.md | 4 +- .../v2.0/reference/flux/stdlib/sql/from.md | 43 ++++++++++++++++ .../v2.0/reference/flux/stdlib/sql/to.md | 51 +++++++++++++++++-- .../v2.0/reference/release-notes/flux.md | 3 +- 5 files changed, 127 insertions(+), 9 deletions(-) diff --git a/content/influxdb/v2.0/query-data/flux/sql.md b/content/influxdb/v2.0/query-data/flux/sql.md index 21a45b055..1da75b3f3 100644 --- a/content/influxdb/v2.0/query-data/flux/sql.md +++ b/content/influxdb/v2.0/query-data/flux/sql.md @@ -5,7 +5,7 @@ list_title: Query SQL data description: > The Flux `sql` package provides functions for working with SQL data sources. Use `sql.from()` to query SQL databases like PostgreSQL, MySQL, Snowflake, - SQLite, Microsoft SQL Server, and Amazon Athena. + SQLite, Microsoft SQL Server, Amazon Athena, and Google BigQuery. influxdb/v2.0/tags: [query, flux, sql] menu: influxdb_2_0: @@ -33,8 +33,8 @@ The [Flux](/influxdb/v2.0/reference/flux) `sql` package provides functions for w like [PostgreSQL](https://www.postgresql.org/), [MySQL](https://www.mysql.com/), [Snowflake](https://www.snowflake.com/), [SQLite](https://www.sqlite.org/index.html), [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server/default.aspx), -and [Amazon Athena](https://aws.amazon.com/athena/) and use the results with -InfluxDB dashboards, tasks, and other operations. +[Amazon Athena](https://aws.amazon.com/athena/) and [Google BigQuery](https://cloud.google.com/bigquery) +and use the results with InfluxDB dashboards, tasks, and other operations. - [Query a SQL data source](#query-a-sql-data-source) - [Join SQL data with data in InfluxDB](#join-sql-data-with-data-in-influxdb) @@ -61,6 +61,8 @@ To query a SQL data source: [Snowflake](#) [SQLite](#) [SQL Server](#) +[Athena](#) +[BigQuery](#) {{% /code-tabs %}} {{% code-tab-content %}} @@ -129,6 +131,33 @@ sql.from( _For information about authenticating with SQL Server using ADO-style parameters, see [SQL Server ADO authentication](/influxdb/v2.0/reference/flux/stdlib/sql/from/#sql-server-ado-authentication)._ {{% /code-tab-content %}} + +{{% code-tab-content %}} +```js +import "sql" +sql.from( + driverName: "awsathena", + dataSourceName: "s3://myorgqueryresults/?accessID=12ab34cd56ef®ion=region-name&secretAccessKey=y0urSup3rs3crEtT0k3n", + query: "GO SELECT * FROM Example.Table" +) +``` + +_For information about parameters to include in the Athena DSN, +see [Athena connection string](/influxdb/v2.0/reference/flux/stdlib/sql/from/#athena-connection-string)._ +{{% /code-tab-content %}} +{{% code-tab-content %}} +```js +import "sql" +sql.from( + driverName: "bigquery", + dataSourceName: "bigquery://projectid/?apiKey=mySuP3r5ecR3tAP1K3y", + query: "SELECT * FROM exampleTable" +) +``` + +_For information about authenticating with BigQuery, see +[BigQuery authentication parameters](/influxdb/v2.0/reference/flux/stdlib/sql/from/#bigquery-authentication-parameters)._ +{{% /code-tab-content %}} {{< /code-tabs-wrapper >}} _See the [`sql.from()` documentation](/influxdb/v2.0/reference/flux/stdlib/sql/from/) for diff --git a/content/influxdb/v2.0/reference/flux/stdlib/sql/_index.md b/content/influxdb/v2.0/reference/flux/stdlib/sql/_index.md index a1a2f6875..b274e9290 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/sql/_index.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/sql/_index.md @@ -3,7 +3,8 @@ title: Flux SQL package list_title: SQL package description: > The Flux SQL package provides tools for working with data in SQL databases such - as MySQL, PostgreSQL, Snowflake, SQLite, Microsoft SQL Server, and Amazon Athena. + as MySQL, PostgreSQL, Snowflake, SQLite, Microsoft SQL Server, Amazon Athena, + and Google BigQuery. Import the `sql` package. aliases: - /influxdb/v2.0/reference/flux/functions/sql/ @@ -20,6 +21,7 @@ related: SQL Flux functions provide tools for working with data in SQL databases such as: - Amazon Athena +- Google BigQuery - Microsoft SQL Server - MySQL - PostgreSQL diff --git a/content/influxdb/v2.0/reference/flux/stdlib/sql/from.md b/content/influxdb/v2.0/reference/flux/stdlib/sql/from.md index 54f59b3d8..5babdafc1 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/sql/from.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/sql/from.md @@ -36,6 +36,7 @@ _**Data type:** String_ The following drivers are available: - awsathena +- bigquery - mysql - postgres - snowflake @@ -73,6 +74,10 @@ sqlserver://username:password@localhost:1234?database=examplebdb server=localhost;user id=username;database=examplebdb; server=localhost;user id=username;database=examplebdb;azure auth=ENV server=localhost;user id=username;database=examplebdbr;azure tenant id=77e7d537;azure client id=58879ce8;azure client secret=0123456789 + +# Google BigQuery DSNs +bigquery://projectid/?param1=value¶m2=value +bigquery://projectid/location?param1=value¶m2=value ``` ### query @@ -88,6 +93,7 @@ _**Data type:** String_ - [SQLite](#query-an-sqlite-database) - [Amazon Athena](#query-an-amazon-athena-database) - [SQL Server](#query-a-sql-server-database) +- [Google BigQuery](#query-a-bigquery-database) {{% note %}} The examples below use [InfluxDB secrets](/influxdb/v2.0/security/secrets/) to populate @@ -250,3 +256,40 @@ _For information about managed identities, see [Microsoft managed identities](ht ``` azure auth=MSI ``` + +### Query a BigQuery database +```js +import "sql" +import "influxdata/influxdb/secrets" +projectID = secrets.get(key: "BIGQUERY_PROJECT_ID") +apiKey = secrets.get(key: "BIGQUERY_APIKEY") +sql.from( + driverName: "bigquery", + dataSourceName: "bigquery://${projectID}/?apiKey=${apiKey}", + query:"SELECT * FROM exampleTable" +) +``` + +#### Common BigQuery URL parameters +- **dataset** - BigQuery dataset ID. When set, you can use unqualified table names in queries. + +#### BigQuery authentication parameters +The Flux BigQuery implementation uses the Google Cloud Go SDK. +Provide your authentication credentials using one of the following methods: + +- The `GOOGLE_APPLICATION_CREDENTIALS` environment variable that identifies the + location of your credential JSON file. +- Provide your BigQuery API key using the **apiKey** URL parameter in your BigQuery DSN. + + ###### Example apiKey URL parameter + ``` + bigquery://projectid/?apiKey=AIzaSyB6XK8IO5AzKZXoioQOVNTFYzbDBjY5hy4 + ``` + +- Provide your base-64 encoded service account, refresh token, or JSON credentials + using the **credentials** URL parameter in your BigQuery DSN. + + ###### Example credentials URL parameter + ``` + bigquery://projectid/?credentials=eyJ0eXBlIjoiYXV0... + ``` diff --git a/content/influxdb/v2.0/reference/flux/stdlib/sql/to.md b/content/influxdb/v2.0/reference/flux/stdlib/sql/to.md index 8f66a6afc..c06fec1ff 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/sql/to.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/sql/to.md @@ -34,12 +34,18 @@ _**Data type:** String_ The following drivers are available: +- bigquery - mysql - postgres - snowflake - sqlite3 – _Does not work with InfluxDB OSS or InfluxDB Cloud. More information [below](#write-data-to-an-sqlite-database)._ - sqlserver, mssql +{{% warn %}} +#### sql.to does not support Amazon Athena +The `sql.to` function does not support writing data to [Amazon Athena](https://aws.amazon.com/athena/). +{{% /warn %}} + ### dataSourceName The data source name (DSN) or connection string used to connect to the SQL database. The string's form and structure depend on the [driver](#drivername) used. @@ -67,6 +73,10 @@ sqlserver://username:password@localhost:1234?database=examplebdb server=localhost;user id=username;database=examplebdb; server=localhost;user id=username;database=examplebdb;azure auth=ENV server=localhost;user id=username;database=examplebdbr;azure tenant id=77e7d537;azure client id=58879ce8;azure client secret=0123456789 + +# Google BigQuery DSNs +bigquery://projectid/?param1=value¶m2=value +bigquery://projectid/location?param1=value¶m2=value ``` ### table @@ -91,6 +101,7 @@ If writing to a **SQLite** database, set `batchSize` to `999` or less. - [Snowflake](#write-data-to-a-snowflake-database) - [SQLite](#write-data-to-an-sqlite-database) - [SQL Server](#write-data-to-a-sql-server-database) +- [Google BigQuery](#write-data-to-a-sql-server-database) {{% note %}} The examples below use [InfluxDB secrets](/influxdb/v2.0/security/secrets/) to populate @@ -223,7 +234,39 @@ _For information about managed identities, see [Microsoft managed identities](ht azure auth=MSI ``` -{{% warn %}} -### sql.to does not support Amazon Athena -The `sql.to` function does not support writing data to [Amazon Athena](https://aws.amazon.com/athena/). -{{% /warn %}} +### Write to a BigQuery database +```js +import "sql" +import "influxdata/influxdb/secrets" +projectID = secrets.get(key: "BIGQUERY_PROJECT_ID") +apiKey = secrets.get(key: "BIGQUERY_APIKEY") +sql.to( + driverName: "bigquery", + dataSourceName: "bigquery://${projectID}/?apiKey=${apiKey}", + table:"exampleTable" +) +``` + +#### Common BigQuery URL parameters +- **dataset** - BigQuery dataset ID. When set, you can use unqualified table names in queries. + +#### BigQuery authentication parameters +The Flux BigQuery implementation uses the Google Cloud Go SDK. +Provide your authentication credentials using one of the following methods: + +- The `GOOGLE_APPLICATION_CREDENTIALS` environment variable that identifies the + location of your credential JSON file. +- Provide your BigQuery API key using the **apiKey** URL parameter in your BigQuery DSN. + + ###### Example apiKey URL parameter + ``` + bigquery://projectid/?apiKey=AIzaSyB6XK8IO5AzKZXoioQOVNTFYzbDBjY5hy4 + ``` + +- Provide your base-64 encoded service account, refresh token, or JSON credentials + using the **credentials** URL parameter in your BigQuery DSN. + + ###### Example credentials URL parameter + ``` + bigquery://projectid/?credentials=eyJ0eXBlIjoiYXV0... + ``` diff --git a/content/influxdb/v2.0/reference/release-notes/flux.md b/content/influxdb/v2.0/reference/release-notes/flux.md index 6f983cb59..e918fd559 100644 --- a/content/influxdb/v2.0/reference/release-notes/flux.md +++ b/content/influxdb/v2.0/reference/release-notes/flux.md @@ -25,7 +25,8 @@ InfluxDB until the next InfluxDB v2.0 release._ ### Features - Improve window errors. -- Add BigQuery support to [`sql` package](#). +- Add [BigQuery](https://cloud.google.com/bigquery) support to + [`sql` package](/influxdb/v2.0/reference/flux/stdlib/sql/). - Add `TypeExpression` to `BuiltinStmt` and fix tests. - Time-weighted average ([`timeWeightedAvg()` function](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg/)). - Update [`integral()`](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral/) From fa9a79bef00083d65c25a9e7df9862cb9934a8b6 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 4 Sep 2020 09:42:12 -0600 Subject: [PATCH 09/23] updated flux docs to address PR review --- .../flux/stdlib/built-in/transformations/aggregates/integral.md | 1 + .../v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md | 2 +- content/influxdb/v2.0/reference/release-notes/flux.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md b/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md index c36cbe630..7cb52c5bf 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral.md @@ -53,6 +53,7 @@ Defaults to `""`. Use one of the following interpolation options: +- _empty sting for no interpolation_ - linear _**Data type:** String_ diff --git a/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md b/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md index 8a2b0d9bb..cab6e0ade 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/influxdb-tasks/lastsuccess.md @@ -26,7 +26,7 @@ _**Data type:** Time_ ## Examples -##### Query data since that last successful task run +##### Query data since the last successful task run ```js import "influxdata/influxdb/tasks" diff --git a/content/influxdb/v2.0/reference/release-notes/flux.md b/content/influxdb/v2.0/reference/release-notes/flux.md index e918fd559..bc4e16efc 100644 --- a/content/influxdb/v2.0/reference/release-notes/flux.md +++ b/content/influxdb/v2.0/reference/release-notes/flux.md @@ -28,7 +28,7 @@ InfluxDB until the next InfluxDB v2.0 release._ - Add [BigQuery](https://cloud.google.com/bigquery) support to [`sql` package](/influxdb/v2.0/reference/flux/stdlib/sql/). - Add `TypeExpression` to `BuiltinStmt` and fix tests. -- Time-weighted average ([`timeWeightedAvg()` function](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg/)). +- Add time-weighted average ([`timeWeightedAvg()` function](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/timeweightedavg/)). - Update [`integral()`](/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/aggregates/integral/) with linear interpolation. - Make experimental tracing an attribute of the context. From c3562ee0decab4d4c2d70b268985775531b0085f Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 4 Sep 2020 09:52:54 -0600 Subject: [PATCH 10/23] updated flux operator precendence --- .../reference/flux/language/expressions.md | 17 +++++----- .../v2.0/reference/flux/language/operators.md | 34 ++++++++++--------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/content/influxdb/v2.0/reference/flux/language/expressions.md b/content/influxdb/v2.0/reference/flux/language/expressions.md index a014c1ff4..b589e9d12 100644 --- a/content/influxdb/v2.0/reference/flux/language/expressions.md +++ b/content/influxdb/v2.0/reference/flux/language/expressions.md @@ -223,18 +223,19 @@ Operators with a lower number have higher precedence. | 1 | `a()` | Function call | | | `a[]` | Member or index access | | | `.` | Member access | -| 2 | `^` | Exponentiation | -| 3 | `*` `/` `%` | Multiplication, division, and modulo | -| 4 | `+` `-` | Addition and subtraction | -| 5 |`==` `!=` | Comparison operators | +| 2 | \|> | Pipe forward | +| 3 | `^` | Exponentiation | +| 4 | `*` `/` `%` | Multiplication, division, and modulo | +| 5 | `+` `-` | Addition and subtraction | +| 6 |`==` `!=` | Comparison operators | | | `<` `<=` | | | | `>` `>=` | | | |`=~` `!~` | | -| 6 | `not` | Unary logical operator | +| 7 | `not` | Unary logical operator | | | `exists` | Null check operator | -| 7 | `and` | Logical AND | -| 8 | `or` | Logical OR | -| 9 | `if` `then` `else` | Conditional | +| 8 | `and` | Logical AND | +| 9 | `or` | Logical OR | +| 10 | `if` `then` `else` | Conditional | The operator precedence is encoded directly into the grammar as the following. diff --git a/content/influxdb/v2.0/reference/flux/language/operators.md b/content/influxdb/v2.0/reference/flux/language/operators.md index d3cbe2d1b..64fef0b33 100644 --- a/content/influxdb/v2.0/reference/flux/language/operators.md +++ b/content/influxdb/v2.0/reference/flux/language/operators.md @@ -131,19 +131,21 @@ Literal constructors define fixed values. The table below outlines operator precedence. Operators with a lower number have higher precedence. -| Precedence | Operator | Description | -|:----------:|:--------: |:--------------------------| -| 1 | `a()` | Function call | -| | `a[]` | Member or index access | -| | `.` | Member access | -| 2 | `*` `/` |Multiplication and division| -| 3 | `+` `-` | Addition and subtraction | -| 4 |`==` `!=` | Comparison operators | -| | `<` `<=` | | -| | `>` `>=` | | -| |`=~` `!~` | | -| 5 | `not` | Unary logical operator | -| | `exists` | Null check operator | -| 6 | `and` | Logical AND | -| 7 | `or` | Logical OR | -| 8 | `if` `then` `else` | Conditional | +| Precedence | Operator | Description | +|:----------:|:--------: |:-------------------------- | +| 1 | `a()` | Function call | +| | `a[]` | Member or index access | +| | `.` | Member access | +| 2 | \|> | Pipe forward | +| 3 | `^` | Exponentiation | +| 4 | `*` `/` `%` | Multiplication, division, and modulo | +| 5 | `+` `-` | Addition and subtraction | +| 6 |`==` `!=` | Comparison operators | +| | `<` `<=` | | +| | `>` `>=` | | +| |`=~` `!~` | | +| 7 | `not` | Unary logical operator | +| | `exists` | Null check operator | +| 8 | `and` | Logical AND | +| 9 | `or` | Logical OR | +| 10 | `if` `then` `else` | Conditional | From 4fc956dae261400a1b15c631627855c672a0ec7f Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 4 Sep 2020 10:11:36 -0600 Subject: [PATCH 11/23] hotfix: added alias to influxdb 1.8 flux getting started, resolves #1395 --- content/influxdb/v1.8/flux/get-started/_index.md | 1 + deploy/edge.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/content/influxdb/v1.8/flux/get-started/_index.md b/content/influxdb/v1.8/flux/get-started/_index.md index e543561fa..b46c3a700 100644 --- a/content/influxdb/v1.8/flux/get-started/_index.md +++ b/content/influxdb/v1.8/flux/get-started/_index.md @@ -11,6 +11,7 @@ menu: weight: 2 aliases: - /influxdb/v1.8/flux/getting-started/ + - /influxdb/v1.8/flux/introduction/getting-started/ --- Flux is InfluxData's new functional data scripting language designed for querying, diff --git a/deploy/edge.js b/deploy/edge.js index 767b86778..d27f4ed83 100644 --- a/deploy/edge.js +++ b/deploy/edge.js @@ -104,10 +104,10 @@ exports.handler = (event, context, callback) => { // Redirect flux guides and introduction based on latest InfluxDB version if (/v2/.test(latestVersions['influxdb'])) { temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/guides\//, `/influxdb/${latestVersions['influxdb']}/query-data/flux/`)); - temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/introduction\//, `/influxdb/${latestVersions['influxdb']}/query-data/get-started/`)); + temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/introduction\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/introduction\//, `/influxdb/${latestVersions['influxdb']}/query-data/get-started/`)); } else { temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/guides\//, `/influxdb/${latestVersions['influxdb']}/flux/guides/`)); - temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/introduction\//, `/influxdb/${latestVersions['influxdb']}/flux/introduction/`)); + temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/introduction\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/introduction\//, `/influxdb/${latestVersions['influxdb']}/flux/`)); } // Redirect Flux stdlib and language sections to v2 Flux docs temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/(?:functions|stdlib|language)\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\//, `/influxdb/${latestVersions['influxdbv2']}/reference/flux/`)); From f7467a58884052856536feca4fd5b905d45b9ba7 Mon Sep 17 00:00:00 2001 From: noramullen1 <42354779+noramullen1@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:17:13 -0700 Subject: [PATCH 12/23] Fix broken links --- content/influxdb/v1.8/concepts/crosswalk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/influxdb/v1.8/concepts/crosswalk.md b/content/influxdb/v1.8/concepts/crosswalk.md index 5538a0f07..e267eca90 100644 --- a/content/influxdb/v1.8/concepts/crosswalk.md +++ b/content/influxdb/v1.8/concepts/crosswalk.md @@ -120,12 +120,12 @@ InfluxDB supports multiple query languages: ### Flux -[Flux](/flux/latest/introduction) is a data scripting language designed for querying, analyzing, and acting on time series data. +[Flux](/influxdb/v1.8/flux/) is a data scripting language designed for querying, analyzing, and acting on time series data. Beginning with **InfluxDB 1.8.0**, Flux is available for production use along side InfluxQL. For those familiar with [InfluxQL](#influxql), Flux is intended to address many of the outstanding feature requests that we've received since introducing InfluxDB 1.0. -For a comparison between Flux and InfluxQL, see [Flux vs InfluxQL](/flux/latest/introduction/flux-vs-influxql). +For a comparison between Flux and InfluxQL, see [Flux vs InfluxQL](/influxdb/v1.8/flux/flux-vs-influxql/). Flux is the primary language for working with data in [InfluxDB 2.0 OSS](/influxdb/v2.0/get-started) (currently in _beta_) and [InfluxDB Cloud 2.0](/influxdb/v2.0/cloud/get-started/), From a0cba6adb4d88a06482e3cc1aae73e1a62b6d050 Mon Sep 17 00:00:00 2001 From: pierwill <19642016+pierwill@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:00:47 -0700 Subject: [PATCH 13/23] Document creating custom checks (#1391) Co-authored-by: Russ Savage --- .../v2.0/monitor-alert/custom-checks.md | 102 ++++++++++++++++++ .../v2.0/monitor-alert/task-failure.md | 69 ------------ 2 files changed, 102 insertions(+), 69 deletions(-) create mode 100644 content/influxdb/v2.0/monitor-alert/custom-checks.md delete mode 100644 content/influxdb/v2.0/monitor-alert/task-failure.md diff --git a/content/influxdb/v2.0/monitor-alert/custom-checks.md b/content/influxdb/v2.0/monitor-alert/custom-checks.md new file mode 100644 index 000000000..71b33e03d --- /dev/null +++ b/content/influxdb/v2.0/monitor-alert/custom-checks.md @@ -0,0 +1,102 @@ +--- +title: Create custom checks +seotitle: Custom checks +description: > + Create custom checks with a Flux task. +menu: + influxdb_2_0: + parent: Monitor & alert +weight: 201 +v2.0/tags: [alerts, checks, tasks, Flux] +--- + +In the UI, you can create two kinds of [checks](/influxdb/v2.0/reference/glossary/#check): +[`threshold`](/influxdb/v2.0/monitor-alert/checks/create/#threshold-check) and +[`deadman`](/influxdb/v2.0/monitor-alert/checks/create/#deadman-check). + +Using a Flux task, you can create a custom check that provides a couple advantages: + +- Customize and transform the data you would like to use for the check. +- Set up custom criteria for your alert (other than `threshold` and `deadman`). + +## Create a task + +1. In the InfluxDB UI, select **Tasks** in the navigation menu on the left. + + {{< nav-icon "tasks" >}} + +2. Click **{{< icon "plus" >}} Create Task**, and then select **New Task**. +3. In the **Name** field, enter a descriptive name, + and then enter how often to run the task in the **Every** field (for example, `10m`). + For more detail, such as using cron syntax or including an offset, see [Task configuration options](/influxdb/v2.0/process-data/task-options/). +4. Enter the Flux script for your custom check, including the [`monitor.check`](/influxdb/v2.0/reference/flux/stdlib/monitor/check/) function. + +{{% note %}} +Use the the API endpoint `/checks/{checkID}/query` to see the Flux code for a check built in the UI. +This can be useful for constructing custom checks. +{{% /note %}} + +### Example: Monitor failed tasks + +The script below is fairly complex, and can be used as a framework for similar tasks. +It does the following: + +- Import the necessary `influxdata/influxdb/monitor` package, and other packages for data processing. +- Query the `_tasks` bucket to retrieve all statuses generated by your check. +- Set the `_level` to alert on, for example, `crit`, `warn`, `info`, or `ok`. +- Create a `check` object that specifies an ID, name, and type for the check. +- Define the `ok` and `crit` statuses. +- Execute the `monitor` function on the `check` using the `task_data`. + +#### Example alert task script + +```js +import "strings" +import "regexp" +import "influxdata/influxdb/monitor" +import "influxdata/influxdb/v1" + +option task = {name: "Failed Tasks Check", every: 1h, offset: 4m} + +task_data = from(bucket: "_tasks") + |> range(start: -task.every) + |> filter(fn: (r) => + (r["_measurement"] == "runs")) + |> filter(fn: (r) => + (r["_field"] == "logs")) + |> map(fn: (r) => ({ r with name: strings.split(v: regexp.findString(r: /option task = \{([^\}]+)/, v: r._value), t: "\\\\\\\"")[1] })) + |> drop(columns: ["_value", "_start", "_stop"]) + |> group(columns: ["name", "taskID", "status", "_measurement"]) + |> map(fn: (r) => + ({r with _value: if r.status == "failed" then 1 else 0})) + |> last() +check = { + _check_id: "0000000000000001", // 16 characters, alphanumeric + _check_name: "Failed Tasks Check", // string + _type: "custom", // can also use "threashold" or "deadman" + tags: {}, +} +ok = (r) => + (r["logs"] == 0) +crit = (r) => + (r["logs"] == 1) +messageFn = (r) => + ("The task: ${r.taskID} - ${r.name} has a status of ${r.status}") + +task_data + |> v1["fieldsAsCols"]() + |> monitor["check"]( + data: check, + messageFn: messageFn, + ok: ok, + crit: crit, + ) +``` + +{{% note %}} +Creating a custom check does not send a notification email. +For information on how to create notification emails, see +[Create notification endpoints](/influxdb/v2.0/monitor-alert/notification-endpoints/create), +[Create notification rules](/influxdb/v2.0/monitor-alert/notification-rules/create), +and [Send alert email](/influxdb/v2.0/monitor-alert/send-email/) +{{% /note %}} diff --git a/content/influxdb/v2.0/monitor-alert/task-failure.md b/content/influxdb/v2.0/monitor-alert/task-failure.md deleted file mode 100644 index b88630dca..000000000 --- a/content/influxdb/v2.0/monitor-alert/task-failure.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Alert on failed tasks -seotitle: Alert on failed tasks. -description: > - Create an alert when a task fails. -menu: - influxdb_2_0: - parent: Monitor & alert -weight: 201 -influxdb/v2.0/tags: [tasks] ---- - -Use a task to receive alerts when a task fails. - -## Example alert task script - -```js -import "strings" - import "regexp" -import "influxdata/influxdb/monitor" -import "influxdata/influxdb/v1" - -option task = {name: "Failed Tasks Check", every: 1h, offset: 4m} - -task_data = from(bucket: "_tasks") - |> range(start: -1h, stop: now()) - |> filter(fn: (r) => - (r["_measurement"] == "runs")) - |> filter(fn: (r) => - (r["_field"] == "logs")) - |> map(fn: (r) => ({ r with name: strings.split(v: regexp.findString(r: /option task = \{([^\}]+)/, v: r._value), t: "\\\\\\\"")[1] })) - |> drop(columns: ["_value", "_start", "_stop"]) - |> group(columns: ["name", "taskID", "status", "_measurement"]) - |> map(fn: (r) => - ({r with _value: if r.status == "failed" then 1 else 0})) - |> last() -check = { - _check_id: "0000000deadbeef1", - _check_name: "Failed Tasks Check", - _type: "threshold", - tags: {}, -} -ok = (r) => - (r["logs"] == 0) -crit = (r) => - (r["logs"] == 1) -messageFn = (r) => - ("The task: ${r.taskID} - ${r.name} has a status of ${r.status}") - -task_data - |> v1["fieldsAsCols"]() - |> monitor["check"]( - data: check, - messageFn: messageFn, - ok: ok, - crit: crit, - ) -``` - -## Add your task - -Once your task is ready, see [Create a task](/influxdb/v2.0/process-data/manage-tasks/create-task) for information about adding it to InfluxDB. - -{{% note %}} -This script does not send an email alert. -For information on how to create notification emails, see -[Create notification endpoints](/influxdb/v2.0/monitor-alert/notification-endpoints/create) -and [Create notification rules](/influxdb/v2.0/monitor-alert/notification-rules/create). -{{% /note %}} From 63a9c8b536c588ad15c4bba0e3fcdfa4cdeaf8ad Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 8 Sep 2020 14:11:04 -0600 Subject: [PATCH 14/23] removed depricated parameters from slack functions, resolves #1402 --- .../reference/flux/stdlib/slack/endpoint.md | 6 ---- .../reference/flux/stdlib/slack/message.md | 29 +------------------ 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/content/influxdb/v2.0/reference/flux/stdlib/slack/endpoint.md b/content/influxdb/v2.0/reference/flux/stdlib/slack/endpoint.md index bf4593544..b1c8d9344 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/slack/endpoint.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/slack/endpoint.md @@ -67,11 +67,8 @@ _**Data type:** Function_ The returned record must include the following fields: -- `username` - `channel` -- `workspace` - `text` -- `iconEmoji` - `color` _For more information, see [`slack.message()`](/influxdb/v2.0/reference/flux/stdlib/slack/message/)_ @@ -92,11 +89,8 @@ crit_statuses = from(bucket: "example-bucket") crit_statuses |> e(mapFn: (r) => ({ - username: r.username, channel: r.channel, - workspace: r.workspace, text: r.text, - iconEmoji: r.iconEmoji, color: r.color, }) )() diff --git a/content/influxdb/v2.0/reference/flux/stdlib/slack/message.md b/content/influxdb/v2.0/reference/flux/stdlib/slack/message.md index 5030d0d6b..ce3c3f636 100644 --- a/content/influxdb/v2.0/reference/flux/stdlib/slack/message.md +++ b/content/influxdb/v2.0/reference/flux/stdlib/slack/message.md @@ -24,11 +24,8 @@ import "slack" slack.message( url: "https://slack.com/api/chat.postMessage", token: "mySuPerSecRetTokEn", - username: "Fluxtastic", - channel: "#flux", - workspace: "", + channel: "#flux",, text: "This is a message from the Flux slack.message() function.", - iconEmoji: "wave", color: "good" ) ``` @@ -57,39 +54,16 @@ A token is only required if using the Slack chat.postMessage API. _**Data type:** String_ -### username -The username to use when posting the message to a Slack channel. Required - -_**Data type:** String_ - ### channel The name of channel to post the message to. Required _**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. Required _**Data type:** String_ -### iconEmoji -The name of emoji to use as the user avatar when posting the message to Slack. -Required - -_**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. Required @@ -120,7 +94,6 @@ lastReported = slack.message( url: "https://slack.com/api/chat.postMessage", token: "mySuPerSecRetTokEn", - username: "johndoe", channel: "#system-status", text: "The last reported status was \"${lastReported.status}\"." ) From eacc420a4fae62429d7dfa0780a32c41e527bfa3 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 8 Sep 2020 15:12:03 -0600 Subject: [PATCH 15/23] added canonical override to canonical partial --- layouts/partials/header/canonical.html | 28 ++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/layouts/partials/header/canonical.html b/layouts/partials/header/canonical.html index 0453b71a3..f051cf7d9 100644 --- a/layouts/partials/header/canonical.html +++ b/layouts/partials/header/canonical.html @@ -17,8 +17,32 @@ {{ $baseURL := replaceRE `\/$` "" .Site.BaseURL }} {{ $scratch.Set "canonicalURL" (print $baseURL .RelPermalink) }} -{{ if ge (len (findRE "[^/]+.*?" .RelPermalink)) 2 }} - {{ $scratch.Set "canonicalURL" (print $baseURL (replaceRE `v[0-9]\.[0-9]{1,2}` $latestMinorVersion .RelPermalink))}} + +{{ if .Page.Params.canonical }} + {{ if in .Page.Params.canonical "{{< latest" }} + + + {{ $product := replaceRE `[ \"]` "" (index (findRE ` \"\w*\"` .Page.Params.canonical) 0) }} + {{ $majorVersion := replaceRE `[ \"]` "" (index (findRE ` \"\w*\"` .Page.Params.canonical) 1) }} + {{ $minorVersions := (index $.Site.Data.products $product).versions }} + + {{ $scratch.Set "latestVersion" (index $.Site.Data.products $product).latest }} + {{ if gt (len $majorVersion) 0 }} + {{ if eq $majorVersion "v1" }} + {{ $scratch.Set "latestVersion" (index (last 1 (findRE `v1\.[0-9]{1,2}` (delimit $minorVersions " "))) 0) }} + {{ else if eq $majorVersion "v2" }} + {{ $scratch.Set "latestVersion" (index (last 1 (findRE `v2\.[0-9]{1,2}` (delimit $minorVersions " "))) 0) }} + {{ end }} + {{ end }} + + {{ $productLatestVersion := $scratch.Get "latestVersion" }} + {{ $replaceLatest := replaceRE `\{\{\< latest \".*\" \>\}\}` (print $product "/" $productLatestVersion) .Page.Params.canonical }} + {{ $scratch.Set "canonicalURL" (print $baseURL $replaceLatest) }} + {{ else }} + {{ $scratch.Set "canonicalURL" (print $baseURL .Page.Params.canonical) }} + {{ end }} +{{ else if ge (len (findRE "[^/]+.*?" .RelPermalink)) 2 }} + {{ $scratch.Set "canonicalURL" (print $baseURL (replaceRE `v[0-9]\.[0-9]{1,2}` $latestMinorVersion .RelPermalink)) }} {{ end }} {{ $canonicalURL := $scratch.Get "canonicalURL" }} From 9255dc5665094ebd6d2647d5845dcee8480c4aea Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 8 Sep 2020 15:34:48 -0600 Subject: [PATCH 16/23] added canonocial url info to contributing --- CONTRIBUTING.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 177a4a422..8ab1b5ec4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,6 +75,7 @@ list_code_example: # Code example included with article descriptions in children list_query_example: # Code examples included with article descriptions in children type="articles" shortcode, # References to examples in data/query_examples products: # List of products that the page specifically applies to: [oss, cloud, enterprise] +canonical: # Path to canonical page, overrides auto-gen'd canonical URL ``` #### Title usage @@ -644,6 +645,25 @@ Redoc generates HTML documentation using the InfluxDB `swagger.yml`. For more information about generating InfluxDB API documentation, see the [API Documentation README](https://github.com/influxdata/docs-v2/tree/master/api-docs#readme). +## Canonical URLs +Search engines use canonocial URLs to accurately rank pages with similar or identical content. +The `canonical` HTML meta tag identifies which page should be used as the source of truth. + +By default, canonical URLs are automatically generated for each page in the InfluxData +documentation using the latest version of the current product and the current path. + +Use the `canonical` frontmatter to override the auto-generated canonical URL. + +_**Note:** The `canonical` front matter supports the `{{< latest >}}` shortcode._ + +```yaml +canonical: /path/to/canonical/doc/ + +# OR + +canonical: /{{< latest "influxdb" "v2" >}}/path/to/canonical/doc/ +``` + ## InfluxDB URLs When a user selects an InfluxDB product and region, example URLs in code blocks throughout the documentation are updated to match their product and region. From dec1ea6e2940b09eb937f1136e5efd949756a902 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 8 Sep 2020 15:39:56 -0600 Subject: [PATCH 17/23] added canonical overrides to 1.x line protocol reference docs, resolves #1314 --- .../v1.3/write_protocols/line_protocol_reference.md | 1 + .../v1.4/write_protocols/line_protocol_reference.md | 1 + .../v1.5/write_protocols/line_protocol_reference.md | 1 + .../v1.6/write_protocols/line_protocol_reference.md | 1 + .../v1.7/write_protocols/line_protocol_reference.md | 7 ++++--- .../v1.8/write_protocols/line_protocol_reference.md | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/content/influxdb/v1.3/write_protocols/line_protocol_reference.md b/content/influxdb/v1.3/write_protocols/line_protocol_reference.md index 85777fcb6..523e3e5bc 100644 --- a/content/influxdb/v1.3/write_protocols/line_protocol_reference.md +++ b/content/influxdb/v1.3/write_protocols/line_protocol_reference.md @@ -6,6 +6,7 @@ menu: influxdb_1_3: weight: 10 parent: Write protocols +canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/ --- diff --git a/content/influxdb/v1.4/write_protocols/line_protocol_reference.md b/content/influxdb/v1.4/write_protocols/line_protocol_reference.md index bdd9763ca..14b620bd2 100644 --- a/content/influxdb/v1.4/write_protocols/line_protocol_reference.md +++ b/content/influxdb/v1.4/write_protocols/line_protocol_reference.md @@ -6,6 +6,7 @@ menu: influxdb_1_4: weight: 10 parent: Write protocols +canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/ --- diff --git a/content/influxdb/v1.5/write_protocols/line_protocol_reference.md b/content/influxdb/v1.5/write_protocols/line_protocol_reference.md index a402bf216..d4f080c5b 100644 --- a/content/influxdb/v1.5/write_protocols/line_protocol_reference.md +++ b/content/influxdb/v1.5/write_protocols/line_protocol_reference.md @@ -7,6 +7,7 @@ menu: name: Line Protocol reference weight: 10 parent: Write protocols +canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/ --- diff --git a/content/influxdb/v1.6/write_protocols/line_protocol_reference.md b/content/influxdb/v1.6/write_protocols/line_protocol_reference.md index 93d8cc498..ae039e90e 100644 --- a/content/influxdb/v1.6/write_protocols/line_protocol_reference.md +++ b/content/influxdb/v1.6/write_protocols/line_protocol_reference.md @@ -7,6 +7,7 @@ menu: name: Line Protocol reference weight: 10 parent: Write protocols +canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/ --- diff --git a/content/influxdb/v1.7/write_protocols/line_protocol_reference.md b/content/influxdb/v1.7/write_protocols/line_protocol_reference.md index ace2ede27..8c835d475 100644 --- a/content/influxdb/v1.7/write_protocols/line_protocol_reference.md +++ b/content/influxdb/v1.7/write_protocols/line_protocol_reference.md @@ -7,6 +7,7 @@ menu: name: InfluxDB line protocol reference weight: 10 parent: Write protocols +canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/ --- InfluxDB line protocol is a text based format for writing points to InfluxDB. @@ -201,12 +202,12 @@ In field values, you must use a backslash character (`\`) to escape: - the backslash character itself (`\`). For example, `\"` escapes a double quote. - + >#### Note on backslashes: > * If you use multiple backslashes, they must be escaped. Influx interprets backslashes as follows: - * `\` or `\\` interpreted as `\` - * `\\\` or `\\\\` interpreted as `\\` + * `\` or `\\` interpreted as `\` + * `\\\` or `\\\\` interpreted as `\\` * `\\\\\` or `\\\\\\` interpreted as `\\\`, and so on In tag keys, tag values, and field keys, you must escape: diff --git a/content/influxdb/v1.8/write_protocols/line_protocol_reference.md b/content/influxdb/v1.8/write_protocols/line_protocol_reference.md index 6031c3e82..e836f8740 100644 --- a/content/influxdb/v1.8/write_protocols/line_protocol_reference.md +++ b/content/influxdb/v1.8/write_protocols/line_protocol_reference.md @@ -9,6 +9,7 @@ menu: name: InfluxDB line protocol reference weight: 10 parent: Write protocols +canonical: /{{< latest "influxdb" "v2" >}}/reference/syntax/line-protocol/ --- InfluxDB line protocol is a text-based format for writing points to InfluxDB. From d1b9bf5d5288a47b49733165ec49d4eea44f9eb2 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 8 Sep 2020 15:59:27 -0600 Subject: [PATCH 18/23] updated typos in contributing guide --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ab1b5ec4..88d37830a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -646,7 +646,7 @@ For more information about generating InfluxDB API documentation, see the [API Documentation README](https://github.com/influxdata/docs-v2/tree/master/api-docs#readme). ## Canonical URLs -Search engines use canonocial URLs to accurately rank pages with similar or identical content. +Search engines use canonical URLs to accurately rank pages with similar or identical content. The `canonical` HTML meta tag identifies which page should be used as the source of truth. By default, canonical URLs are automatically generated for each page in the InfluxData @@ -654,7 +654,7 @@ documentation using the latest version of the current product and the current pa Use the `canonical` frontmatter to override the auto-generated canonical URL. -_**Note:** The `canonical` front matter supports the `{{< latest >}}` shortcode._ +_**Note:** The `canonical` frontmatter supports the `{{< latest >}}` shortcode._ ```yaml canonical: /path/to/canonical/doc/ From 1766742dd7ea8adce66744870b7e7a816f44d3ee Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Tue, 8 Sep 2020 16:22:34 -0600 Subject: [PATCH 19/23] added link to latest shortcode in contributing --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88d37830a..ad34528dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -654,7 +654,7 @@ documentation using the latest version of the current product and the current pa Use the `canonical` frontmatter to override the auto-generated canonical URL. -_**Note:** The `canonical` frontmatter supports the `{{< latest >}}` shortcode._ +_**Note:** The `canonical` frontmatter supports the [`{{< latest >}}` shortcode](#latest-links)._ ```yaml canonical: /path/to/canonical/doc/ From 0298e6775a3cf16b660d8ca9f18d1c14cd2b20c1 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 9 Sep 2020 09:42:24 -0600 Subject: [PATCH 20/23] added kapacitor enterpise card to homepage --- layouts/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/layouts/index.html b/layouts/index.html index 1080cbacc..2e05da91d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -96,6 +96,13 @@

View documentation

+
+
+

Kapacitor Enterprise v1.5

+

A high availability Kapacitor cluster with alert deduplication and backend authentication. Run Kapacitor Enterprise on your own infrastructure—on-premises, private cloud, public cloud, or at the edge.

+
+

View documentation archive

+
From 9525ed35743a3823b530a70ab3431c4bfaa0642c Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 9 Sep 2020 10:14:09 -0600 Subject: [PATCH 21/23] hotfix: added flux latest redirect support to edge.js --- deploy/edge.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deploy/edge.js b/deploy/edge.js index d27f4ed83..6112caefa 100644 --- a/deploy/edge.js +++ b/deploy/edge.js @@ -103,14 +103,14 @@ exports.handler = (event, context, callback) => { /////////////////////////////// Flux redirects /////////////////////////////// // Redirect flux guides and introduction based on latest InfluxDB version if (/v2/.test(latestVersions['influxdb'])) { - temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/guides\//, `/influxdb/${latestVersions['influxdb']}/query-data/flux/`)); - temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/introduction\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/introduction\//, `/influxdb/${latestVersions['influxdb']}/query-data/get-started/`)); + temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/guides\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/guides\//, `/influxdb/${latestVersions['influxdb']}/query-data/flux/`)); + temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/introduction\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/introduction\//, `/influxdb/${latestVersions['influxdb']}/query-data/get-started/`)); } else { - temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/guides\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/guides\//, `/influxdb/${latestVersions['influxdb']}/flux/guides/`)); - temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/introduction\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\/introduction\//, `/influxdb/${latestVersions['influxdb']}/flux/`)); + temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/guides\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/guides\//, `/influxdb/${latestVersions['influxdb']}/flux/guides/`)); + temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/introduction\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/introduction\//, `/influxdb/${latestVersions['influxdb']}/flux/`)); } // Redirect Flux stdlib and language sections to v2 Flux docs - temporaryRedirect(/\/flux\/v0\.[0-9]{1,2}\/(?:functions|stdlib|language)\//.test(request.uri), request.uri.replace(/\/flux\/v0\.[0-9]{1,2}\//, `/influxdb/${latestVersions['influxdbv2']}/reference/flux/`)); + temporaryRedirect(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\/(?:functions|stdlib|language)\//.test(request.uri), request.uri.replace(/\/flux\/(?:v0\.[0-9]{1,2}|latest)\//, `/influxdb/${latestVersions['influxdbv2']}/reference/flux/`)); // Redirect versionless and base version to v2 Flux docs temporaryRedirect(/^\/flux\/(?:v0\.[0-9]{1,2}\/|)$/.test(request.uri), `/influxdb/${latestVersions['influxdbv2']}/reference/flux/`); From 2b1559fcd457afc48590885d33a35f9f94b385f1 Mon Sep 17 00:00:00 2001 From: noramullen1 <42354779+noramullen1@users.noreply.github.com> Date: Wed, 9 Sep 2020 12:33:39 -0700 Subject: [PATCH 22/23] Fix formatting issues (addresses #1417 ) --- content/chronograf/v1.8/tools/chronograf-cli/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/chronograf/v1.8/tools/chronograf-cli/_index.md b/content/chronograf/v1.8/tools/chronograf-cli/_index.md index fbac5fbf5..0dbcf8412 100644 --- a/content/chronograf/v1.8/tools/chronograf-cli/_index.md +++ b/content/chronograf/v1.8/tools/chronograf-cli/_index.md @@ -52,14 +52,14 @@ chronograf [flags] | Flag | Description | Env. Variable | |---------|------------------------------------------------------------|--------------------| -| `--cert | File path to PEM-encoded public key certificate | `$TLS_CERTIFICATE` | +| `--cert` | File path to PEM-encoded public key certificate | `$TLS_CERTIFICATE` | | `--key` | File path to private key associated with given certificate | `$TLS_PRIVATE_KEY` | ## Other service option flags | Flag | Description | Env. Variable | |----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------| -| `--custom-link : | Custom link added to Chronograf user menu options. Useful for providing links to internal company resources for your Chronograf users. Can be used when any OAuth 2.0 authentication is enabled. To add another custom link, repeat the custom link option. | | +| `--custom-link` : | Custom link added to Chronograf user menu options. Useful for providing links to internal company resources for your Chronograf users. Can be used when any OAuth 2.0 authentication is enabled. To add another custom link, repeat the custom link option. | | | `-r`, `--reporting-disabled` | Disables reporting of usage statistics. Usage statistics reported once every 24 hours include: `OS`, `arch`, `version`, `cluster_id`, and `uptime`. | `$REPORTING_DISABLED` | | `-l`, `--log-level` | Sets the logging level. Valid values include `info` (default), `debug`, and `error`. | `$LOG_LEVEL` | | `-d`, `--develop` | Runs the Chronograf service in developer mode | | From 5b9783c05548e620152d95d07951137867c67c59 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 9 Sep 2020 21:49:06 -0600 Subject: [PATCH 23/23] New support and feedback layout (#1423) * WIP new feedback/support block * restructured and restyled support and feedback section * added api issue button to swagger-generated api docs, resolves #1415 * added community slack link, restyled ul for feedback block * minor wording change in feedback section --- api-docs/template.hbs | 3 +- assets/styles/layouts/_api-overrides.scss | 51 +++- assets/styles/layouts/article/_feedback.scss | 98 +++++++- assets/styles/themes/_theme-dark.scss | 3 + assets/styles/themes/_theme-light.scss | 3 + assets/styles/tools/_icomoon.scss | 250 +++++++++---------- layouts/partials/article.html | 2 +- layouts/partials/article/_feedback.html | 17 -- layouts/partials/article/feedback.html | 38 +++ static/fonts/icomoon.eot | Bin 17844 -> 17780 bytes static/fonts/icomoon.svg | 148 ++++++----- static/fonts/icomoon.ttf | Bin 17680 -> 17616 bytes static/fonts/icomoon.woff | Bin 17756 -> 17692 bytes static/svgs/slack.svg | 33 +++ 14 files changed, 412 insertions(+), 234 deletions(-) delete mode 100644 layouts/partials/article/_feedback.html create mode 100644 layouts/partials/article/feedback.html create mode 100644 static/svgs/slack.svg diff --git a/api-docs/template.hbs b/api-docs/template.hbs index f886dbfcd..bedacd61c 100644 --- a/api-docs/template.hbs +++ b/api-docs/template.hbs @@ -39,7 +39,8 @@
{{{redocHTML}}}