Skip to content

Commit 253c16a

Browse files
authored
Merge pull request #5923 from influxdata/jts/5917-processing-engine-trigger-settings-formatting
Jts/5917 revise processing engine guide, misc fixes
2 parents 3739fe0 + ee1f85b commit 253c16a

File tree

8 files changed

+615
-615
lines changed

8 files changed

+615
-615
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ GitHub Copilot should help document InfluxData products by creating clear, accur
5959
- Follow Google Developer Documentation style guidelines
6060
- For API references, follow YouTube Data API style
6161
- Use semantic line feeds (one sentence per line)
62-
- Use only h2-h6 headings in content (h1 comes from frontmatter)
62+
- Use only h2-h6 headings in content (h1 comes from frontmatter title properties)
6363
- Use sentence case for headings
6464
- Use GitHub callout syntax
6565
- Image naming: `project/version-context-description.png`

content/influxdb3/core/plugins.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ menu:
77
influxdb3_core:
88
name: Processing engine and Python plugins
99
weight: 4
10-
influxdb3/core/tags: []
10+
influxdb3/core/tags: [processing engine, python]
1111
related:
1212
- /influxdb3/core/reference/cli/influxdb3/test/wal_plugin/
13-
- /influxdb3/core/reference/cli/influxdb3/create/plugin/
1413
- /influxdb3/core/reference/cli/influxdb3/create/trigger/
1514
source: /shared/v3-core-plugins/_index.md
1615
---
1716

1817
<!--
19-
The content of this page is at /shared/v3-core-plugins/_index.md
18+
//SOURCE - content/shared/v3-core-plugins/_index.md
2019
-->

content/influxdb3/core/reference/cli/influxdb3/create/trigger.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ menu:
88
parent: influxdb3 create
99
name: influxdb3 create trigger
1010
weight: 400
11+
alias: /influxdb3/core/cli/influxdb3/create/plugin/
1112
source: /shared/influxdb3-cli/create/trigger.md
1213
---
1314

1415
<!--
15-
The content of this file is at content/shared/influxdb3-cli/create/trigger.md
16+
//SOURCE - content/shared/influxdb3-cli/create/trigger.md
1617
-->

content/influxdb3/enterprise/plugins.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ menu:
77
influxdb3_enterprise:
88
name: Processing Engine and Python plugins
99
weight: 4
10-
influxdb3/core/tags: []
10+
influxdb3/enterprise/tags: [processing engine, python]
1111
related:
1212
- /influxdb3/enterprise/reference/cli/influxdb3/test/wal_plugin/
13-
- /influxdb3/enterprise/reference/cli/influxdb3/create/plugin/
1413
- /influxdb3/enterprise/reference/cli/influxdb3/create/trigger/
1514
source: /shared/v3-core-plugins/_index.md
1615
---
1716

1817
<!--
19-
The content of this page is at /shared/v3-core-plugins/_index.md
18+
//SOURCE - content/shared/v3-core-plugins/_index.md
2019
-->

content/influxdb3/enterprise/reference/cli/influxdb3/create/trigger.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ menu:
88
parent: influxdb3 create
99
name: influxdb3 create trigger
1010
weight: 400
11+
alias: /influxdb3/enterprise/cli/influxdb3/create/plugin/
1112
source: /shared/influxdb3-cli/create/trigger.md
1213
---
1314

1415
<!--
15-
The content of this file is at content/shared/influxdb3-cli/create/trigger.md
16+
//SOURCE - content/shared/influxdb3-cli/create/trigger.md
1617
-->

content/shared/v3-core-get-started/_index.md

Lines changed: 56 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,17 @@ The following examples show how to start InfluxDB 3 with different object store
156156
```bash
157157
# Memory object store
158158
# Stores data in RAM; doesn't persist data
159-
influxdb3 serve --node-id=host01 --object-store=memory
159+
influxdb3 serve \
160+
--node-id host01 \
161+
--object-store memory
160162
```
161163

162164
```bash
163165
# Filesystem object store
164166
# Provide the filesystem directory
165167
influxdb3 serve \
166-
--node-id=host01 \
167-
--object-store=file \
168+
--node-id host01 \
169+
--object-store file \
168170
--data-dir ~/.influxdb3
169171
```
170172

@@ -196,24 +198,24 @@ docker run -it \
196198
# S3 object store (default is the us-east-1 region)
197199
# Specify the Object store type and associated options
198200
influxdb3 serve \
199-
--node-id=host01 \
200-
--object-store=s3 \
201-
--bucket=BUCKET \
202-
--aws-access-key=AWS_ACCESS_KEY \
203-
--aws-secret-access-key=AWS_SECRET_ACCESS_KEY
201+
--node-id host01 \
202+
--object-store s3 \
203+
--bucket BUCKET \
204+
--aws-access-key AWS_ACCESS_KEY_ID \
205+
--aws-secret-access-key AWS_SECRET_ACCESS_KEY
204206
```
205207

206208
```bash
207209
# Minio or other open source object store
208210
# (using the AWS S3 API with additional parameters)
209211
# Specify the object store type and associated options
210212
influxdb3 serve \
211-
--node-id=host01 \
212-
--object-store=s3 \
213-
--bucket=BUCKET \
214-
--aws-access-key=AWS_ACCESS_KEY \
215-
--aws-secret-access-key=AWS_SECRET_ACCESS_KEY \
216-
--aws-endpoint=ENDPOINT \
213+
--node-id host01 \
214+
--object-store s3 \
215+
--bucket BUCKET \
216+
--aws-access-key-id AWS_ACCESS_KEY_ID \
217+
--aws-secret-access-key AWS_SECRET_ACCESS_KEY \
218+
--aws-endpoint ENDPOINT \
217219
--aws-allow-http
218220
```
219221

@@ -314,7 +316,7 @@ cpu,host=Alpha,region=us-west,application=webserver val=6i,usage_percent=25.3,st
314316
If you save the preceding line protocol to a file (for example, `server_data`), then you can use the `influxdb3` CLI to write the data--for example:
315317
316318
```bash
317-
influxdb3 write --database=mydb --file=server_data
319+
influxdb3 write --database mydb --file server_data
318320
```
319321
320322
##### Example: write data using the /api/v3 HTTP API
@@ -420,7 +422,11 @@ curl "http://localhost:8181/api/v3/write_lp?db=sensors&precision=auto&no_sync=tr
420422
The `no_sync` CLI option controls when writes are acknowledged--for example:
421423
422424
```bash
423-
influxdb3 write --bucket=mydb --org=my_org --token=my-token --no-sync
425+
influxdb3 write \
426+
--bucket mydb \
427+
--org my_org \
428+
--token my-token \
429+
--no-sync
424430
```
425431
426432
### Create a database or table
@@ -466,7 +472,7 @@ The `query` subcommand includes options to help ensure that the right database i
466472
#### Example: query `“SHOW TABLES”` on the `servers` database:
467473
468474
```console
469-
$ influxdb3 query --database=servers "SHOW TABLES"
475+
$ influxdb3 query --database servers "SHOW TABLES"
470476
+---------------+--------------------+--------------+------------+
471477
| table_catalog | table_schema | table_name | table_type |
472478
+---------------+--------------------+--------------+------------+
@@ -482,7 +488,7 @@ $ influxdb3 query --database=servers "SHOW TABLES"
482488
#### Example: query the `cpu` table, limiting to 10 rows:
483489
484490
```console
485-
$ influxdb3 query --database=servers "SELECT DISTINCT usage_percent, time FROM cpu LIMIT 10"
491+
$ influxdb3 query --database servers "SELECT DISTINCT usage_percent, time FROM cpu LIMIT 10"
486492
+---------------+---------------------+
487493
| usage_percent | time |
488494
+---------------+---------------------+
@@ -506,7 +512,10 @@ $ influxdb3 query --database=servers "SELECT DISTINCT usage_percent, time FROM c
506512
To query using InfluxQL, enter the `influxdb3 query` subcommand and specify `influxql` in the language option--for example:
507513
508514
```bash
509-
influxdb3 query --database=servers --language=influxql "SELECT DISTINCT usage_percent FROM cpu WHERE time >= now() - 1d"
515+
influxdb3 query \
516+
--database servers \
517+
--language influxql \
518+
"SELECT DISTINCT usage_percent FROM cpu WHERE time >= now() - 1d"
510519
```
511520
512521
### Query using the API
@@ -617,11 +626,11 @@ The following command creates a last value cache named `cpuCache`:
617626
618627
```bash
619628
influxdb3 create last_cache \
620-
--database=servers \
621-
--table=cpu \
622-
--key-columns=host,application \
623-
--value-columns=usage_percent,status \
624-
--count=5 cpuCache
629+
--database servers \
630+
--table cpu \
631+
--key-columns host,application \
632+
--value-columns usage_percent,status \
633+
--count 5 cpuCache
625634
```
626635
627636
_You can create a last values cache per time series, but be mindful of high cardinality tables that could take excessive memory._
@@ -632,7 +641,7 @@ To use the LVC, call it using the `last_cache()` function in your query--for exa
632641
633642
```bash
634643
influxdb3 query \
635-
--database=servers \
644+
--database servers \
636645
"SELECT * FROM last_cache('cpu', 'cpuCache') WHERE host = 'Bravo';"
637646
```
638647
@@ -647,8 +656,8 @@ Use the `influxdb3` CLI to [delete a last values cache](/influxdb3/version/refer
647656
648657
```bash
649658
influxdb3 delete last_cache \
650-
-d <DATABASE_NAME> \
651-
-t <TABLE> \
659+
--database <DATABASE_NAME> \
660+
--table <TABLE> \
652661
--cache-name <CACHE_NAME>
653662
```
654663
@@ -660,8 +669,8 @@ You can use the `influxdb3` CLI to [create a distinct values cache](/influxdb3/v
660669
661670
```bash
662671
influxdb3 create distinct_cache \
663-
-d <DATABASE_NAME> \
664-
-t <TABLE> \
672+
--database <DATABASE_NAME> \
673+
--table <TABLE> \
665674
--columns <COLUMNS> \
666675
[CACHE_NAME]
667676
```
@@ -680,9 +689,9 @@ The following command creates a distinct values cache named `cpuDistinctCache`:
680689
681690
```bash
682691
influxdb3 create distinct_cache \
683-
--database=servers \
684-
--table=cpu \
685-
--columns=host,application \
692+
--database servers \
693+
--table cpu \
694+
--columns host,application \
686695
cpuDistinctCache
687696
```
688697
@@ -692,25 +701,23 @@ To use the distinct values cache, call it using the `distinct_cache()` function
692701
693702
```bash
694703
influxdb3 query \
695-
--database=servers \
704+
--database servers \
696705
"SELECT * FROM distinct_cache('cpu', 'cpuDistinctCache')"
697706
```
698707
699708
> [!Note]
700709
> #### Only works with SQL
701710
>
702-
> The Distinct cache only works with SQL, not InfluxQL; SQL is the default language.
703-
704-
711+
> The distinct cache only works with SQL, not InfluxQL; SQL is the default language.
705712
706713
#### Delete a distinct values cache
707714
708715
Use the `influxdb3` CLI to [delete a distinct values cache](/influxdb3/version/reference/cli/influxdb3/delete/distinct_cache/)
709716
710717
```bash
711718
influxdb3 delete distinct_cache \
712-
-d <DATABASE_NAME> \
713-
-t <TABLE> \
719+
--database <DATABASE_NAME> \
720+
--table <TABLE> \
714721
--cache-name <CACHE_NAME>
715722
```
716723
@@ -736,12 +743,12 @@ InfluxDB 3 provides the following types of triggers, each with specific trigger-
736743
737744
- **On WAL flush**: Sends a batch of written data (for a specific table or all tables) to a plugin (by default, every second).
738745
- **On Schedule**: Executes a plugin on a user-configured schedule (using a crontab or a duration); useful for data collection and deadman monitoring.
739-
- **On Request**: Binds a plugin to a custom HTTP API endpoint at `/api/v3/engine/<ENDPOINT>`.
746+
- **On Request**: Binds a plugin to a custom HTTP API endpoint at `/api/v3/engine/<ENDPOINT_PATH>`.
740747
The plugin receives the HTTP request headers and content, and can then parse, process, and send the data into the database or to third-party services.
741748
742749
### Test, create, and trigger plugin code
743750
744-
##### Example: Python plugin for WAL flush
751+
##### Example: Python plugin for WAL rows
745752
746753
```python
747754
# This is the basic structure for Python plugin code that runs in the
@@ -827,7 +834,7 @@ To test a plugin, do the following:
827834
828835
1. Create a _plugin directory_--for example, `/path/to/.influxdb/plugins`
829836
2. [Start the InfluxDB server](#start-influxdb) and include the `--plugin-dir <PATH>` option.
830-
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.
837+
3. Save the [example plugin code](#example-python-plugin-for-wal-flush) 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.
831838
4. To run the test, enter the following command with the following options:
832839
833840
- `--lp` or `--file`: The line protocol to test
@@ -863,19 +870,19 @@ trigger:
863870
# - A Python plugin file named `test.py`
864871
# Test a plugin
865872
influxdb3 test wal_plugin \
866-
--lp="my_measure,tag1=asdf f1=1.0 123" \
867-
-d mydb \
868-
--input-arguments="arg1=hello,arg2=world" \
873+
--lp "my_measure,tag1=asdf f1=1.0 123" \
874+
--database mydb \
875+
--input-arguments "arg1=hello,arg2=world" \
869876
test.py
870877
```
871878
872879
```bash
873880
# Create a trigger that runs the plugin
874881
influxdb3 create trigger \
875882
-d mydb \
876-
--plugin=test_plugin \
877-
--trigger-spec="table:foo" \
878-
--trigger-arguments="arg1=hello,arg2=world" \
883+
--plugin test_plugin \
884+
--trigger-spec "table:foo" \
885+
--trigger-arguments "arg1=hello,arg2=world" \
879886
trigger1
880887
```
881888
@@ -885,3 +892,5 @@ enable the trigger and have it run the plugin as you write data:
885892
```bash
886893
influxdb3 enable trigger --database mydb trigger1
887894
```
895+
896+
For more information, see [Python plugins and the Processing engine](/influxdb3/version/plugins/).

0 commit comments

Comments
 (0)