Skip to content

Commit ad85c95

Browse files
authored
Merge branch 'master' into chore-js-refactor-footer-scripts-modules
2 parents 717ec5c + 3b0f77c commit ad85c95

File tree

5 files changed

+186
-10
lines changed

5 files changed

+186
-10
lines changed

assets/jsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"baseUrl": ".",
44
"paths": {
55
"*": [
6-
"*",
7-
"../node_modules/*"
6+
"*"
87
]
98
}
109
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: influxdb3 test schedule_plugin
3+
description: >
4+
The `influxdb3 test schedule_plugin` command tests a schedule plugin file without needing to create a trigger.
5+
menu:
6+
influxdb3_core:
7+
parent: influxdb3 test
8+
name: influxdb3 test schedule_plugin
9+
weight: 401
10+
source: /shared/influxdb3-cli/test/schedule_plugin.md
11+
---
12+
13+
<!--
14+
The content of this file is at content/shared/influxdb3-cli/test/schedule_plugin.md
15+
-->
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: influxdb3 test schedule_plugin
3+
description: >
4+
The `influxdb3 test schedule_plugin` command tests a schedule plugin file without needing to create a trigger.
5+
menu:
6+
influxdb3_enterprise:
7+
parent: influxdb3 test
8+
name: influxdb3 test schedule_plugin
9+
weight: 401
10+
source: /shared/influxdb3-cli/test/schedule_plugin.md
11+
---
12+
13+
<!--
14+
The content of this file is at content/shared/influxdb3-cli/test/schedule_plugin.md
15+
-->
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
2+
The `influxdb3 test schedule_plugin` command tests a schedule plugin. Use this command to verify plugin behavior without creating a trigger.
3+
4+
## Usage
5+
6+
<!--pytest.mark.skip-->
7+
8+
```bash
9+
influxdb3 test schedule_plugin [OPTIONS] --database <DATABASE_NAME> <FILENAME>
10+
```
11+
12+
## Arguments
13+
14+
- **FILENAME**: Path to the plugin file. Use the absolute path or the path relative to the current working directory, such as `<plugin-dir>/<plugin-file-name>.py`.
15+
16+
## Options
17+
18+
| Option | Flag | Description |
19+
| :----- | :-------------------- | :-------------------------------------------------------------------------------------------- |
20+
| `-H` | `--host` | URL of the running {{< product-name >}} server <br>(default: `http://127.0.0.1:8181`) |
21+
| `-d` | `--database` | _({{< req >}})_ Name of the database you want to test the plugin against |
22+
| | `--token` | _({{< req >}})_ Authentication token |
23+
| | `--input-arguments` | JSON map of key/value pairs to pass as plugin input arguments (for example, `'{"key":"val"}'`)|
24+
| | `--schedule` | Cron schedule to simulate when testing the plugin <br>(default: `* * * * *`) |
25+
| | `--cache-name` | Optional cache name to associate with the test |
26+
| | `--tls-ca` | Path to a custom TLS certificate authority for self-signed certs |
27+
| `-h` | `--help` | Show basic help information |
28+
| | `--help-all` | Show all available help options |
29+
30+
31+
### Option environment variables
32+
33+
You can use the following environment variables to set command options:
34+
35+
| Environment Variable | Corresponding Option |
36+
| :------------------------ | :------------------- |
37+
| `INFLUXDB3_HOST_URL` | `--host` |
38+
| `INFLUXDB3_DATABASE_NAME` | `--database` |
39+
| `INFLUXDB3_AUTH_TOKEN` | `--token` |
40+
| `INFLUXDB3_TLS_CA` | `--tls-ca` |
41+
42+
## Examples
43+
44+
In the examples below, replace the following:
45+
46+
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Your target database
47+
- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Your authentication token
48+
- {{% code-placeholder-key %}}`PLUGIN_DIR`{{% /code-placeholder-key %}}:
49+
the path to the plugin directory you provided when starting the server
50+
- {{% code-placeholder-key %}}`FILENAME`{{% /code-placeholder-key %}}:
51+
Plugin file name
52+
53+
{{% code-placeholders "(DATABASE|PLUGIN_DIR|FILENAME|AUTH_TOKEN)" %}}
54+
55+
### Test a schedule plugin
56+
57+
<!--pytest.mark.skip-->
58+
59+
```bash
60+
influxdb3 test schedule_plugin \
61+
--database DATABASE_NAME \
62+
--token AUTH_TOKEN \
63+
PLUGIN_DIR/FILENAME.py
64+
```
65+
66+
### Test with input arguments and a custom cron schedule
67+
68+
You can pass input arguments to your plugin as key-value pairs and specify a custom cron schedule (using Quartz cron syntax with six fields):
69+
70+
<!--pytest.mark.skip-->
71+
72+
```bash
73+
influxdb3 test schedule_plugin \
74+
--host http://localhost:8182 \
75+
--database DATABASE_NAME \
76+
--token AUTH_TOKEN \
77+
--input-arguments threshold=10,unit=seconds \
78+
--schedule "0 0 * * * ?" \
79+
PLUGIN_DIR/FILENAME.py
80+
```
81+
- Pass plugin parameters using `--input-arguments` as comma-separated key=value pairs.
82+
- Use `--schedule` to set the plugin’s execution time with a Quartz cron expression. For example, "0 0 * * * ?" runs the plugin at the start of every hour.
83+
84+
{{% /code-placeholders %}}

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

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,27 +523,90 @@ influxdb3 create trigger \
523523

524524
### Install Python dependencies
525525

526-
If your plugin needs additional Python packages, use the `influxdb3 install` command:
526+
Use the `influxdb3 install package` command to add third-party libraries (like `pandas`, `requests`, or `influxdb3-python`) to your plugin environment.
527+
This installs packages into the Processing Engine’s embedded Python environment to ensure compatibility with your InfluxDB instance.
528+
529+
{{% code-placeholders "CONTAINER_NAME|PACKAGE_NAME" %}}
530+
531+
{{< code-tabs-wrapper >}}
532+
533+
{{% code-tabs %}}
534+
[CLI](#)
535+
[Docker](#)
536+
{{% /code-tabs %}}
537+
538+
{{% code-tab-content %}}
527539

528540
```bash
529-
# Install a package directly
541+
# Use the CLI to install a Python package
530542
influxdb3 install package pandas
543+
531544
```
532545

546+
{{% /code-tab-content %}}
547+
548+
{{% code-tab-content %}}
549+
533550
```bash
534-
# With Docker
551+
# Use the CLI to install a Python package in a Docker container
535552
docker exec -it CONTAINER_NAME influxdb3 install package pandas
536553
```
537554

538-
This creates a Python virtual environment in your plugins directory with the specified packages installed.
555+
{{% /code-tab-content %}}
556+
557+
{{< /code-tabs-wrapper >}}
558+
559+
These examples install the specified Python package (for example, pandas) into the Processing Engine’s embedded virtual environment.
560+
561+
- Use the CLI command when running InfluxDB directly on your system.
562+
- Use the Docker variant if you're running InfluxDB in a containerized environment.
563+
564+
> [!Important]
565+
> #### Use bundled Python for plugins
566+
> When you start the server with the `--plugin-dir` option, InfluxDB 3 creates a Python virtual environment (`<PLUGIN_DIR>/venv`) for your plugins.
567+
> If you need to create a custom virtual environment, use the Python interpreter bundled with InfluxDB 3. Don't use the system Python.
568+
> Creating a virtual environment with the system Python (for example, using `python -m venv`) can lead to runtime errors and plugin failures.
569+
>
570+
>For more information, see the [processing engine README](https://github.com/influxdata/influxdb/blob/main/README_processing_engine.md#official-builds).
571+
572+
{{% /code-placeholders %}}
573+
574+
InfluxDB creates a Python virtual environment in your plugins directory with the specified packages installed.
539575

540576
{{% show-in "enterprise" %}}
541577

542-
### Connect Grafana to your InfluxDB instance
578+
## Distributed cluster considerations
579+
580+
When you deploy {{% product-name %}} in a multi-node environment, configure each node based on its role and the plugins it runs.
581+
582+
### Match plugin types to the correct node
583+
584+
Each plugin must run on a node that supports its trigger type:
585+
586+
| Plugin type | Trigger spec | Runs on |
587+
|--------------------|--------------------------|-----------------------------|
588+
| Data write | `table:` or `all_tables` | Ingester nodes |
589+
| Scheduled | `every:` or `cron:` | Any node with scheduler |
590+
| HTTP request | `path:` | Nodes that serve API traffic|
591+
592+
For example:
593+
- Run write-ahead log (WAL) plugins on ingester nodes.
594+
- Run scheduled plugins on any node configured to execute them.
595+
- Run HTTP-triggered plugins on querier nodes or any node that handles HTTP endpoints.
596+
597+
Place all plugin files in the `--plugin-dir` directory configured for each node.
598+
599+
> [!Note]
600+
> Triggers fail if the plugin file isn’t available on the node where it runs.
601+
602+
### Route third-party clients to querier nodes
603+
604+
External tools—such as Grafana, custom dashboards, or REST clients—must connect to querier nodes in your InfluxDB Enterprise deployment.
543605

544-
When configuring Grafana to connect to an InfluxDB 3 Enterprise instance:
606+
#### Examples
545607

546-
- **URL**: Use a querier URL or any node that serves queries
608+
- **Grafana**: When adding InfluxDB 3 as a Grafana data source, use a querier node URL, such as:
609+
`https://querier.example.com:8086`
610+
- **REST clients**: Applications using `POST /api/v3/query/sql` or similar endpoints must target a querier node.
547611

548-
Example URL format: `https://querier.your-influxdb.com:8086`
549612
{{% /show-in %}}

0 commit comments

Comments
 (0)