Merge branch 'master' into docs/5823-write-lp-guide
commit
a4b5c15f54
|
@ -570,11 +570,6 @@ influxdb3 create distinct_cache -h
|
||||||
|
|
||||||
### Python plugins and the Processing engine
|
### Python plugins and the Processing engine
|
||||||
|
|
||||||
> [!Important]
|
|
||||||
> #### Processing engine only works with Docker
|
|
||||||
>
|
|
||||||
> The Processing engine is currently supported only in Docker x86 environments. Non-Docker support is coming soon. The engine, API, and developer experience are actively evolving and may change. Join our [Discord](https://discord.gg/9zaNCW2PRT) for updates and feedback.
|
|
||||||
|
|
||||||
The InfluxDB 3 Processing engine is an embedded Python VM for running code inside the database to process and transform data.
|
The InfluxDB 3 Processing engine is an embedded Python VM for running code inside the database to process and transform data.
|
||||||
|
|
||||||
To use the Processing engine, you create [plugins](#plugin) and [triggers](#trigger).
|
To use the Processing engine, you create [plugins](#plugin) and [triggers](#trigger).
|
||||||
|
@ -609,11 +604,6 @@ InfluxDB 3 provides the following types of triggers:
|
||||||
|
|
||||||
### Test, create, and trigger plugin code
|
### Test, create, and trigger plugin code
|
||||||
|
|
||||||
> [!Important]
|
|
||||||
> #### Processing engine only works with Docker
|
|
||||||
>
|
|
||||||
> The Processing engine is currently supported only in Docker x86 environments. Non-Docker support is coming soon. The engine, API, and developer experience are actively evolving and may change. Join our [Discord](https://discord.gg/9zaNCW2PRT) for updates and feedback.
|
|
||||||
|
|
||||||
##### Example: Python plugin for WAL flush
|
##### Example: Python plugin for WAL flush
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
@ -699,10 +689,9 @@ Test your InfluxDB 3 plugin safely without affecting written data. During a plug
|
||||||
To test a plugin, do the following:
|
To test a plugin, do the following:
|
||||||
|
|
||||||
1. Create a _plugin directory_--for example, `/path/to/.influxdb/plugins`
|
1. Create a _plugin directory_--for example, `/path/to/.influxdb/plugins`
|
||||||
2. Make the plugin directory available to the Docker container (for example, using a bind mount)
|
2. [Start the InfluxDB server](#start-influxdb) and include the `--plugin-dir` option with your plugin directory path.
|
||||||
3. Run the Docker command to [start the server](#start-influxdb) and include the `--plugin-dir` option with your plugin directory path.
|
3. Save the [preceding example code](#example-python-plugin) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
|
||||||
4. Save the [preceding example code](#example-python-plugin) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
|
4. To run the test, enter the following command with the following options:
|
||||||
5. To run the test, enter the following command with the following options:
|
|
||||||
|
|
||||||
- `--lp` or `--file`: The line protocol to test
|
- `--lp` or `--file`: The line protocol to test
|
||||||
- Optional: `--input-arguments`: A comma-delimited list of `<KEY>=<VALUE>` arguments for your plugin code
|
- Optional: `--input-arguments`: A comma-delimited list of `<KEY>=<VALUE>` arguments for your plugin code
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
> [!Important]
|
|
||||||
> #### Processing engine only works with Docker
|
|
||||||
>
|
|
||||||
> The Processing engine is currently supported only in Docker x86 environments. Non-Docker support is coming soon. The engine, API, and developer experience are actively evolving and may change. Join our [Discord](https://discord.gg/9zaNCW2PRT) for updates and feedback.
|
|
||||||
|
|
||||||
Use the {{% product-name %}} Processing engine to run code and perform tasks
|
Use the {{% product-name %}} Processing engine to run code and perform tasks
|
||||||
for different database events.
|
for different database events.
|
||||||
|
@ -35,6 +31,7 @@ The Processing engine provides four types of plugins and triggers--each type cor
|
||||||
- **On Request**: Bound to the HTTP API `/api/v3/engine/<CUSTOM_PATH>` endpoint and triggered by a GET or POST request to the endpoint.
|
- **On Request**: Bound to the HTTP API `/api/v3/engine/<CUSTOM_PATH>` endpoint and triggered by a GET or POST request to the endpoint.
|
||||||
|
|
||||||
## Activate the Processing engine
|
## Activate the Processing engine
|
||||||
|
|
||||||
To enable the Processing engine, start the {{% product-name %}} server with the `--plugin-dir` option and a path to your plugins directory (it doesn't need to exist yet)--for example:
|
To enable the Processing engine, start the {{% product-name %}} server with the `--plugin-dir` option and a path to your plugins directory (it doesn't need to exist yet)--for example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -351,6 +348,7 @@ def process_scheduled_call(influxdb3_local, time, args=None):
|
||||||
```
|
```
|
||||||
|
|
||||||
### Schedule Trigger Configuration
|
### Schedule Trigger Configuration
|
||||||
|
|
||||||
Schedule plugins are set with a `trigger-spec` of `schedule:<cron_expression>` or `every:<duration>`. The `args` parameter can be used to pass configuration to the plugin. For example, if we wanted to use the system-metrics example from the Github repo and have it collect every 10 seconds we could use the following trigger definition:
|
Schedule plugins are set with a `trigger-spec` of `schedule:<cron_expression>` or `every:<duration>`. The `args` parameter can be used to pass configuration to the plugin. For example, if we wanted to use the system-metrics example from the Github repo and have it collect every 10 seconds we could use the following trigger definition:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
@ -361,6 +359,7 @@ influxdb3 create trigger \
|
||||||
```
|
```
|
||||||
|
|
||||||
## On Request Plugin
|
## On Request Plugin
|
||||||
|
|
||||||
On Request plugins are triggered by a request to a specific endpoint under `/api/v3/engine`. The plugin will receive the local API, query parameters `Dict[str, str]`, request headers `Dict[str, str]`, request body (as bytes), and any arguments passed in the trigger definition. Here's an example of a simple On Request plugin:
|
On Request plugins are triggered by a request to a specific endpoint under `/api/v3/engine`. The plugin will receive the local API, query parameters `Dict[str, str]`, request headers `Dict[str, str]`, request body (as bytes), and any arguments passed in the trigger definition. Here's an example of a simple On Request plugin:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
@ -387,6 +386,7 @@ def process_request(influxdb3_local, query_parameters, request_headers, request_
|
||||||
```
|
```
|
||||||
|
|
||||||
### On Request Trigger Configuration
|
### On Request Trigger Configuration
|
||||||
|
|
||||||
On Request plugins are set with a `trigger-spec` of `request:<endpoint>`. The `args` parameter can be used to pass configuration to the plugin. For example, if we wanted the above plugin to run on the endpoint `/api/v3/engine/my_plugin`, we would use `request:my_plugin` as the `trigger-spec`.
|
On Request plugins are set with a `trigger-spec` of `request:<endpoint>`. The `args` parameter can be used to pass configuration to the plugin. For example, if we wanted the above plugin to run on the endpoint `/api/v3/engine/my_plugin`, we would use `request:my_plugin` as the `trigger-spec`.
|
||||||
|
|
||||||
Trigger specs must be unique across all configured plugins, regardless of which database they are tied to, given the path is the same. Here's an example to create a request trigger tied to the "hello-world' path using a plugin in the plugin-dir:
|
Trigger specs must be unique across all configured plugins, regardless of which database they are tied to, given the path is the same. Here's an example to create a request trigger tied to the "hello-world' path using a plugin in the plugin-dir:
|
||||||
|
|
|
@ -560,11 +560,6 @@ influxdb3 create distinct_cache -h
|
||||||
|
|
||||||
### Python plugins and the Processing engine
|
### Python plugins and the Processing engine
|
||||||
|
|
||||||
> [!Important]
|
|
||||||
> #### Processing engine only works with Docker
|
|
||||||
>
|
|
||||||
> The Processing engine is currently supported only in Docker x86 environments. Non-Docker support is coming soon. The engine, API, and developer experience are actively evolving and may change. Join our [Discord](https://discord.gg/9zaNCW2PRT) for updates and feedback.
|
|
||||||
|
|
||||||
The InfluxDB 3 Processing engine is an embedded Python VM for running code inside the database to process and transform data.
|
The InfluxDB 3 Processing engine is an embedded Python VM for running code inside the database to process and transform data.
|
||||||
|
|
||||||
To use the Processing engine, you create [plugins](#plugin) and [triggers](#trigger).
|
To use the Processing engine, you create [plugins](#plugin) and [triggers](#trigger).
|
||||||
|
@ -599,11 +594,6 @@ InfluxDB 3 provides the following types of triggers:
|
||||||
|
|
||||||
### Test, create, and trigger plugin code
|
### Test, create, and trigger plugin code
|
||||||
|
|
||||||
> [!Important]
|
|
||||||
> #### Processing engine only works with Docker
|
|
||||||
>
|
|
||||||
> The Processing engine is currently supported only in Docker x86 environments. Non-Docker support is coming soon. The engine, API, and developer experience are actively evolving and may change. Join our [Discord](https://discord.gg/9zaNCW2PRT) for updates and feedback.
|
|
||||||
|
|
||||||
##### Example: Python plugin for WAL flush
|
##### Example: Python plugin for WAL flush
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
@ -689,10 +679,9 @@ Test your InfluxDB 3 plugin safely without affecting written data. During a plug
|
||||||
To test a plugin, do the following:
|
To test a plugin, do the following:
|
||||||
|
|
||||||
1. Create a _plugin directory_--for example, `/path/to/.influxdb/plugins`
|
1. Create a _plugin directory_--for example, `/path/to/.influxdb/plugins`
|
||||||
2. Make the plugin directory available to the Docker container (for example, using a bind mount)
|
2. [Start the InfluxDB server](#start-influxdb) and include the `--plugin-dir` option with your plugin directory path.
|
||||||
3. Run the Docker command to [start the server](#start-influxdb) and include the `--plugin-dir` option with your plugin directory path.
|
3. Save the [preceding example code](#example-python-plugin) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
|
||||||
4. Save the [preceding example code](#example-python-plugin) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
|
4. To run the test, enter the following command with the following options:
|
||||||
5. To run the test, enter the following command with the following options:
|
|
||||||
|
|
||||||
- `--lp` or `--file`: The line protocol to test
|
- `--lp` or `--file`: The line protocol to test
|
||||||
- Optional: `--input-arguments`: A comma-delimited list of `<KEY>=<VALUE>` arguments for your plugin code
|
- Optional: `--input-arguments`: A comma-delimited list of `<KEY>=<VALUE>` arguments for your plugin code
|
||||||
|
|
Loading…
Reference in New Issue