add kapa 1.6.2 release notes (#3164)

* add kapa 1.6.2 release notes

* update release date

* add new featurre to RNs

* kapa 1.6.2 updates for template-id

* add new release note

* add new option for tasks

* swap option w property; clarify API response upd

* Auto create task logs db (#3198)

* kapa 1.6.2 updates

* update jsonCompact detail

* fix typos

* add jsonCompact

* add info about Flux log bucket/db

* fix typo

* change bucket to db for 1.x

* add link

* edits

* update config example

* update 2.0 config example

* add link to task templates

* add link to using Flux tasks with Kapactor

* minor edits

* update config file

* add quotes for consistency

* edits

* remove extra line

* remove template-id as query parameter

* another bug fix from Sam

* Update content/kapacitor/v1.6/about_the_project/releasenotes-changelog.md

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* Update content/kapacitor/v1.6/working/api.md

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* Update content/kapacitor/v1.6/working/flux/_index.md

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* Update content/kapacitor/v1.6/working/template_tasks.md

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* Update content/kapacitor/v1.6/about_the_project/releasenotes-changelog.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/kapacitor/v1.6/about_the_project/releasenotes-changelog.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/kapacitor/v1.6/about_the_project/releasenotes-changelog.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* Update content/kapacitor/v1.6/about_the_project/releasenotes-changelog.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

* include correct version of node for api docs

* re-add Jason edit

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
pull/3204/head^2
kelseiv 2021-10-04 15:46:21 -07:00 committed by GitHub
parent 12ebe95cce
commit 421bf757f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 2860 additions and 66 deletions

View File

@ -5,6 +5,7 @@
"description": "InfluxDB API documentation",
"license": "MIT",
"dependencies": {
"npx": "^10.2.2",
"redoc-cli": "0.9.13"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@ menu:
Kapacitor is open source and we welcome contributions from the community.
If you want Kapacitor to be able to output to you own endpoint see
If you want Kapacitor to be able to output to your own endpoint see
[Contributing new Kapacitor output nodes](/kapacitor/v1.5/working/custom_output/).
## Kapacitor release notes

View File

@ -10,7 +10,7 @@ menu:
Kapacitor is open source and we welcome contributions from the community.
If you want Kapacitor to be able to output to you own endpoint see
If you want Kapacitor to be able to output to your own endpoint see
[Contributing new Kapacitor output nodes](/kapacitor/v1.6/working/custom_output/).
## Kapacitor release notes

View File

@ -7,14 +7,31 @@ menu:
name: Release notes
---
## v1.6.2 [2021-09-24]
### Features
- Add the `template-id` property to the `GET /kapacitor/v1/tasks` request response. Adding this property helps to identify tasks that were created from a [template](/kapacitor/v1.6/working/template_tasks/).
- For alert templates, row templates, and details templates, add support for third-party services that reject standard `json` (terminated by a new line character) by compacting `json` in templates. To do this, replace `{{ json . }}` with `{{ jsonCompact . }}` in your templates. (This change also compacts Big Panda alert details to avoid Panda service error.)
- Previously, Kapacitor used a remote `influxdb` bucket (or 1.x database) to store Flux task run logs, and you had to manually create the database or bucket to store Flux logs. Now, Kapacitor automatically creates an InfluxDB 1.x database or InfluxDB 2.x bucket for Flux task logs (by default, kapacitor_fluxtask_logs). For more information, see how to [use Flux tasks with Kapacitor](/kapacitor/v1.6/working/flux/).
### Bug fixes
- Implement `expvar` string json encoding to correctly handle special characters in measurement strings, thanks @prashanthjbabu!
- Correctly validate that connected InfluxDB instances are running when`disable-subscriptions` is set to `true` in the [InfluxDB section of the Kapacitor configuration file](/kapacitor/v1.6/administration/configuration/#influxdb). If InfluxDB is not available, Kapacitor does not start.
- Update `jwt` dependencies and switch to `github.com/golang-jwt/jwt` to remediate the [CVE-2020-26160 vulnerability](https://nvd.nist.gov/vuln/detail/CVE-2020-26160).
- Switch task service to use Flux formatter that preserves comments.
## v1.6.1 [2021-07-22]
### Features
- Add flag for restricting CIDR ranges for certain event handlers and nodes.
- Add flag for disabling alert handlers for additional security (such as
disabling the `exec` alert handler on a shared machine).
### Bug fixes
- Align `DeleteGroupMessage` with `GroupInfo` interface.
- Fix payload serialization for BigPanda.
@ -37,6 +54,7 @@ with the Kapacitor API.
{{% warn %}}
### Breaking changes
Kapacitor 1.6+ no longer supports 32-bit operating systems.
If you are using a 32-bit operating system, continue using Kapacitor 1.5.x.
{{% /warn %}}
@ -56,6 +74,7 @@ If you are using a 32-bit operating system, continue using Kapacitor 1.5.x.
- Handle Delete messages in [joinNode](/kapacitor/v1.6/nodes/join_node/).
### Bug fixes
- Fix a panic in the scraper handler when debug mode is enabled.
## v1.5.9 [2021-04-01]

View File

@ -922,16 +922,16 @@ Use the `[fluxtask]` configuration group to enable and configure Kapacitor Flux
# to store historical task run data in
# Not recommended: use "none" to turn off historical task run data storage.
task-run-influxdb = "localhost"
# Bucket to store historical task run data in.
# If using InfluxDB 1.x, use the "db/rp" convention.
# This bucket or database must already exist in the task-run-influxdb instance.
task-run-bucket = "db/rp"
# Bucket to store historical task run data in. We recommend leaving this empty; by default, data is written to the `kapacitor_fluxtask_logs` bucket or database.
# If you have multiple Kapacitor instances and want to keep your data separate, specify the InfluxDB 2.x bucket or InfluxDB 1.x database to write to. For InfluxDB 1.x, use the `"mydb"` convention--the `"mydb/rp"` convention with the retention policy is not supported.
task-run-bucket=" "
# The organization name or ID if storing historical task run data
# in InfluxDB 2.x or InfluxDB Cloud
task-run-org = ""
task-run-orgid = ""
# The measurement name for the historical task run data
task-run-measurement = "runs"
# ...
```

View File

@ -167,7 +167,7 @@ Define a task using a JSON object with the following options:
| Property | Purpose |
| -------- | ------- |
| id | Unique identifier for the task. If empty a random ID will be chosen. |
| template-id | An optional ID of a template to use instead of specifying a TICKscript and type directly. |
| template-id | (Optional) Template ID to use instead of specifying a TICKscript and type. |
| type | The task type: `stream` or `batch`. |
| dbrps | List of database retention policy pairs the task is allowed to access. |
| script | The content of the script. |
@ -178,7 +178,7 @@ When using `PATCH`, if any property is missing, the task will be left unmodified
{{% note %}}
**Note:** When patching a task, no changes are made to the running task.
The task must be disabled and re-enabled for any changes to take effect.
The task must be disabled and re-enabled for changes to take effect.
{{% /note %}}
##### Vars
@ -205,7 +205,7 @@ The following is a table of valid types and example values.
| bool | true | "true" or "false" |
| int | 42 | Any integer value |
| float | 2.5 or 67 | Any numeric value |
| duration | "1s" or 1000000000 | Any integer value interpretted in nanoseconds or an influxql duration string, (i.e. 10000000000 is 10s) |
| duration | "1s" or 1000000000 | Any integer value interpreted in nanoseconds or an influxql duration string, (i.e. 10000000000 is 10s) |
| string | "a string" | Any string value |
| regex | "^abc.*xyz" | Any string value that represents a valid Go regular expression https://golang.org/pkg/regexp/ |
| lambda | "\"value\" > 5" | Any string that is a valid TICKscript lambda expression |
@ -214,12 +214,13 @@ The following is a table of valid types and example values.
#### Example
Create a new task with the `id` value of `TASK_ID`.
Create a new task with the `id` value of `TASK_ID`. To create a task from a template, add the `template-id`.
```
POST /kapacitor/v1/tasks
{
"id" : "TASK_ID",
"template-id" : "TEMPLATE_ID",
"type" : "stream",
"dbrps": [{"db": "DATABASE_NAME", "rp" : "RP_NAME"}],
"script": "stream\n |from()\n .measurement('cpu')\n",
@ -232,12 +233,13 @@ POST /kapacitor/v1/tasks
}
```
Response with task `id` and `link`.
Response with task details.
```json
{
"link" : {"rel": "self", "href": "/kapacitor/v1/tasks/TASK_ID"},
"id" : "TASK_ID",
"template-id" : "TEMPLATE_ID",
"type" : "stream",
"dbrps" : [{"db": "DATABASE_NAME", "rp" : "RP_NAME"}],
"script" : "stream\n |from()\n .measurement('cpu')\n",
@ -253,7 +255,8 @@ Response with task `id` and `link`.
"error" : "",
"created": "2006-01-02T15:04:05Z07:00",
"modified": "2006-01-02T15:04:05Z07:00",
"stats" : {}
"stats" : {},
"template-id": "TASK_ID"
}
```
@ -295,6 +298,7 @@ Define a new task that is enabled on creation.
POST /kapacitor/v1/tasks
{
"id" : "TASK_ID",
"template-id" : "TEMPLATE_ID",
"type" : "stream",
"dbrps" : [{"db": "DATABASE_NAME", "rp" : "RP_NAME"}],
"script" : "stream\n |from()\n .measurement('cpu')\n",
@ -302,11 +306,12 @@ POST /kapacitor/v1/tasks
}
```
Response with task `id` and `link`.
The response contains the created task.
```json
{
"id" : "TASK_ID",
"template-id" : "TEMPLATE_ID",
"link" : {"rel": "self", "href": "/kapacitor/v1/tasks/TASK_ID"}
}
```
@ -328,7 +333,6 @@ To get information about a task, make a `GET` request to the `/kapacitor/v1/task
| script-format | formatted | One of `formatted` or `raw`. Raw will return the script identical to how it was defined. Formatted will first format the script. |
| replay-id | | Optional ID of a running replay. The returned task information will be in the context of the task for the running replay. |
A task has these read-only properties in addition to the properties listed [above](#defining-tasks).
| Property | Description |
@ -343,7 +347,7 @@ A task has these read-only properties in addition to the properties listed [abov
#### Example
Get information about a task using defaults.
Get information about a task using defaults. If a task is associated with a template, the template ID is included in the response.
```
GET /kapacitor/v1/tasks/TASK_ID
@ -353,6 +357,7 @@ GET /kapacitor/v1/tasks/TASK_ID
{
"link" : {"rel": "self", "href": "/kapacitor/v1/tasks/TASK_ID"},
"id" : "TASK_ID",
"template-id" : "TEMPLATE_ID",
"type" : "stream",
"dbrps" : [{"db": "DATABASE_NAME", "rp" : "RP_NAME"}],
"script" : "stream\n |from()\n .measurement('cpu')\n",
@ -363,7 +368,8 @@ GET /kapacitor/v1/tasks/TASK_ID
"created": "2006-01-02T15:04:05Z07:00",
"modified": "2006-01-02T15:04:05Z07:00",
"last-enabled": "2006-01-03T15:04:05Z07:00",
"stats" : {}
"stats" : {},
"template-id": "TASK_ID"
}
```
@ -377,6 +383,7 @@ GET /kapacitor/v1/tasks/TASK_ID?dot-view=labels&script-format=raw
{
"link" : {"rel": "self", "href": "/kapacitor/v1/tasks/TASK_ID"},
"id" : "TASK_ID",
"template-id" : "TEMPLATE_ID",
"type" : "stream",
"dbrps" : [{"db": "DATABASE_NAME", "rp" : "RP_NAME"}],
"script" : "stream|from().measurement('cpu')",
@ -398,7 +405,6 @@ GET /kapacitor/v1/tasks/TASK_ID?dot-view=labels&script-format=raw
| 200 | Success |
| 404 | Task does not exist |
### Delete a task
To delete a task, make a DELETE request to the `/kapacitor/v1/tasks/TASK_ID` endpoint.
@ -432,7 +438,7 @@ To get information about several tasks, make a `GET` request to the `/kapacitor/
#### Example
Get all tasks.
Get all tasks list details.
```
GET /kapacitor/v1/tasks
@ -451,7 +457,8 @@ GET /kapacitor/v1/tasks
"status" : "enabled",
"executing" : true,
"error" : "",
"stats" : {}
"stats" : {},
"template-id" : "TEMPLATE_ID"
},
{
"link" : {"rel":"self", "href":"/kapacitor/v1/tasks/ANOTHER_TASK_ID"},
@ -463,7 +470,8 @@ GET /kapacitor/v1/tasks
"status" : "disabled",
"executing" : true,
"error" : "",
"stats" : {}
"stats" : {},
"template-id" : "TEMPLATE_ID"
}
]
}
@ -488,7 +496,8 @@ GET /kapacitor/v1/tasks?pattern=TASK*
"status" : "enabled",
"executing" : true,
"error" : "",
"stats" : {}
"stats" : {},
"template-id" : "TEMPLATE_ID"
}
]
}

View File

@ -943,6 +943,7 @@ kapacitor show cpu_alert
##### Example show task output
```bash
ID: cpu_alert
Template: template_id (included if task was created from a template)
Error:
Template:
Type: stream

View File

@ -88,17 +88,14 @@ CREATE RETENTION POLICY threedays on kapacitorfluxtasks DURATION 3d
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
## Configure Kapacitor Flux tasks
Update or add the following settings under `[fluxtask]` your `kapacitor.conf`:
Update or add the following settings under `[fluxtask]` in your `kapacitor.conf`:
- **enabled**: `true`
- **task-run-influxdb**: Name of the [InfluxDB configuration in your `kapacitor.conf`](/kapacitor/v1.6/administration/configuration/#influxdb)
to use to store Flux task data.
_To disable Flux task logging, set to `"none"`._
- **task-run-bucket**: InfluxDB bucket to store Flux task data and logs in.
Use the `"db-name/rp-name"` naming convention.
To use the default RP for the database, use `"db-name/"`.
- **task-run-bucket**: InfluxDB database to store Flux task data and logs in. We recommend leaving this empty. By default, data is written to the `kapacitor_fluxtask_logs` database. To specify another database to write task log data to, use the `"db-name"` naming convention (including the retention policy `"db-name/rp"` is not supported). If the specified database does not already exist in InfluxDB, Kapacitor attempts to create the database. If authentication is turned on, permissions to `CREATE DATABASE` are required. For more information, see [Authentication and authorization in InfluxDB](/influxdb/v1.8/administration/authentication_and_authorization/).
- Provide one of the following:
- **task-run-org**: _Leave as an empty string (`""`)_
- **task-run-orgid**: _Leave as an empty string (`""`)_
@ -112,7 +109,7 @@ Update or add the following settings under `[fluxtask]` your `kapacitor.conf`:
[fluxtask]
enabled = true
task-run-influxdb = "default"
task-run-bucket = "kapacitorfluxtasks/autogen"
task-run-bucket = "kapacitor_fluxtask_logs"
task-run-org = ""
task-run-orgid = ""
task-run-measurement = "runs"
@ -199,10 +196,7 @@ Update or add the following settings under `[fluxtask]` your `kapacitor.conf`:
- **task-run-influxdb**: Name of the [InfluxDB configuration in your `kapacitor.conf`](/kapacitor/v1.6/administration/configuration/#influxdb)
to use to store Flux task data.
_To disable Flux task logging, set to `"none"`._
- **task-run-bucket**: InfluxDB bucket to store Flux task data and logs in.
Use the [_tasks system bucket](/influxdb/cloud/reference/internals/system-buckets/#_tasks-system-bucket)
or [create a new bucket](/influxdb/cloud/organizations/buckets/create-bucket/)
and provide the bucket name.
- **task-run-bucket**: InfluxDB bucket to store Flux task data and logs in. We recommend leaving this empty. By default, data is written to the `kapacitor_fluxtask_logs` bucket. To specify another bucket to write task log data to, use the [_tasks system bucket](/influxdb/cloud/reference/internals/system-buckets/#_tasks-system-bucket) or [create a new bucket](/influxdb/cloud/organizations/buckets/create-bucket/). If the specified bucket does not already exist in InfluxDB, Kapacitor attempts to create it with [`POST /api/v2/buckets`](/influxdb/v2.0/api/#operation/PostBuckets), in which case your API token must have permissions to create buckets in InfluxDB. For more information, see [Manage API tokens](/influxdb/v2.0/security/tokens/).
- Provide one of the following:
- **task-run-org**: InfluxDB organization name.
- **task-run-orgid**: InfluxDB organization ID.
@ -215,7 +209,7 @@ Update or add the following settings under `[fluxtask]` your `kapacitor.conf`:
[fluxtask]
enabled = true
task-run-influxdb = "InfluxDB"
task-run-bucket = "_tasks"
task-run-bucket = "kapacitor_fluxtask_logs"
task-run-org = "example-org"
task-run-measurement = "runs"

View File

@ -17,10 +17,19 @@ Use templates in the CLI and the [API](/kapacitor/v1.6/working/api) to define an
To create a task template, do the following:
1. Create a task template script
2. Run the `define-template` command
1. [Create a task template script](#create-a-task-template-script)
2. [Run the `define-template` command](#run-the-define-template-command)
3. [Define a new task](#define-a-new-task)
Then, use the task template to define new tasks.
{{% note %}}
Some third-party services reject standard `json` terminated by a new-line character. To remove the new line, replace `{{ json . }}` with `{{ jsonCompact . }}` in your templates.
{{% /note %}}
When creating a task template, consider the following:
- [Using variables](#using-variables)
- [Using the `-file` flag](#using-the--file-flag)
- [Specifying dbrp implicitly](#specifying-dbrp-implicitly)
{{% note %}}
Chronograf does **not** display template details, including variable values.