Skip to content

Commit 2bcfaa3

Browse files
author
Jackson Newhouse
committed
feat: update plugin error handling and request response docs.
1 parent fe09b06 commit 2bcfaa3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

content/shared/v3-core-plugins/_index.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,19 @@ obj_to_log = {"hello": "world"}
219219
influxdb3_local.info("This is an info message with an object", obj_to_log)
220220
```
221221

222+
### Trigger Settings
223+
224+
#### Run Asynchronously
225+
Triggers can be optionally configured to run asynchronously. This is enabled in the CLI via the `--run-asynchronously` flag.
226+
If this flag is set individual instances of the trigger will run simultaneously.
227+
228+
#### Error Behavior
229+
By default, errors in a plugin will simply be _logged_, writing to the server output and the system.processing_engine_logs system table.
230+
This behavior can be changed by specifying the "Error behavior", via the `--error-behavior` flag. Apart from the default `log`, you may set
231+
232+
* `--error-behavior retry` will immediately the plugin in the event of error.
233+
* `--error-behavior disable` will turn off the plugin as soon as an error occurs. You can enable it again using the CLI.
234+
222235
### Trigger arguments
223236

224237
A plugin can receive arguments from the trigger that runs it.
@@ -388,6 +401,7 @@ influxdb3 create trigger \
388401

389402
On Request plugins are triggered by a request to a custom HTTP API endpoint.
390403
The plugin receives the shared API, query parameters `Dict[str, str]`, request headers `Dict[str, str]`, the request body (as bytes), and any arguments passed in the trigger definition.
404+
The response conventions for On Request plugins follows Flask conventions, as detailed [here](https://flask.palletsprojects.com/en/stable/quickstart/#about-responses).
391405

392406
#### Example: On Request plugin
393407

@@ -411,7 +425,7 @@ def process_request(influxdb3_local, query_parameters, request_headers, request_
411425

412426
influxdb3_local.write(line)
413427

414-
return 200, {"Content-Type": "application/json"}, json.dumps({"status": "ok", "line": line_str})
428+
return {"status": "ok", "line": line_str}
415429
```
416430

417431
#### On Request trigger configuration

0 commit comments

Comments
 (0)