Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 39 additions & 35 deletions influxdata/downsampler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,42 @@ If a plugin supports multiple trigger specifications, some parameters may depend

This plugin includes a JSON metadata schema in its docstring that defines supported trigger types and configuration parameters. This metadata enables the [InfluxDB 3 Explorer](https://docs.influxdata.com/influxdb3/explorer/) UI to display and configure the plugin.

### Required parameters

| Parameter | Type | Default | Description |
|----------------------|--------|---------------------------|------------------------------------------------------------------------------------|
| `source_measurement` | string | required | Source measurement containing data to downsample |
| `target_measurement` | string | required | Destination measurement for downsampled data |
| `window` | string | required (scheduled only) | Time window for each downsampling job. Format: `<number><unit>` (e.g., "1h", "1d") |

### Aggregation parameters

| Parameter | Type | Default | Description |
|-------------------|--------|------------|--------------------------------------------------------------------------------------|
| `interval` | string | "10min" | Time interval for downsampling. Format: `<number><unit>` (e.g., "10min", "2h", "1d") |
| `calculations` | string | "avg" | Aggregation functions. Single function or dot-separated field:aggregation pairs |
| `specific_fields` | string | all fields | Dot-separated list of fields to downsample (e.g., "co.temperature") |
| `excluded_fields` | string | none | Dot-separated list of fields and tags to exclude from downsampling results |

### Filtering parameters

| Parameter | Type | Default | Description |
|--------------|--------|---------|---------------------------------------------------------------------|
| `tag_values` | string | none | Tag filters. Format: `tag:value1@value2@value3` for multiple values |
| `offset` | string | "0" | Time offset to apply to the window |

### Advanced parameters

| Parameter | Type | Default | Description |
|-----------------------|---------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `target_database` | string | "default" | Database for storing downsampled data |
| `max_retries` | integer | 5 | Maximum number of retries for write operations |
| `batch_size` | string | "30d" | Time interval for batch processing (HTTP mode only) |
| `enable_full_logging` | boolean | false | When `true`, full exception messages are written to logs. When `false` (default), only the exception type is logged, to avoid leaking sensitive values. Enable temporarily for debugging. |
### Scheduled trigger parameters

| Parameter | Type | Default | Description |
|----------------------|---------|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source_measurement` | string | required | Source measurement containing data to downsample |
| `target_measurement` | string | required | Destination measurement for downsampled data |
| `window` | string | required | Time window for each downsampling job. Format: `<number><unit>` (for example, "1h", "1d") |
| `interval` | string | "10min" | Time interval for downsampling. Format: `<number><unit>` (for example, "10min", "2h", "1d") |
| `calculations` | string | "avg" | Aggregation functions. Single function or dot-separated field:aggregation pairs |
| `specific_fields` | string | all fields | Dot-separated list of fields to downsample (for example, "co.temperature") |
| `excluded_fields` | string | none | Dot-separated list of fields and tags to exclude from downsampling results |
| `tag_values` | string | none | Tag filters. Format: `tag:value1@value2@value3` for multiple values |
| `offset` | string | "0" | Time offset to apply to the window |
| `target_database` | string | "default" | Database for storing downsampled data |
| `max_retries` | integer | 5 | Maximum number of retries for write operations |
| `enable_full_logging` | boolean | false | When `true`, full exception messages are written to logs. When `false` (default), only the exception type is logged, to avoid leaking sensitive values. Enable temporarily for debugging. |

### HTTP request parameters

Send these parameters as JSON in the HTTP POST request body:

| Parameter | Type | Default | Description |
|-----------------------|---------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source_measurement` | string | required | Source measurement containing data to downsample |
| `target_measurement` | string | required | Destination measurement for downsampled data |
| `interval` | string | "10min" | Time interval for downsampling. Format: `<number><unit>` (for example, "10min", "2h", "1d") |
| `batch_size` | string | "30d" | Time interval for each HTTP backfill batch |
| `calculations` | string/array | "avg" | Aggregation functions. Use `"avg"` for all fields, or an array of `[field, aggregation]` pairs |
| `specific_fields` | array | all fields | List of fields to downsample |
| `excluded_fields` | array | none | List of fields and tags to exclude from downsampling results |
| `tag_values` | object | none | Tag filters as an object mapping tag names to lists of values |
| `target_database` | string | "default" | Database for storing downsampled data |
| `max_retries` | integer | 5 | Maximum number of retries for write operations |
| `backfill_start` | string | oldest point | ISO 8601 datetime with timezone for the start of the HTTP backfill window |
| `backfill_end` | string | current time | ISO 8601 datetime with timezone for the end of the HTTP backfill window |
| `enable_full_logging` | boolean | false | When `true`, full exception messages are written to logs. When `false` (default), only the exception type is logged, to avoid leaking sensitive values. Enable temporarily for debugging. |

### TOML configuration

Expand Down Expand Up @@ -237,7 +241,7 @@ Key operations:
3. Applies time-based aggregation with specified functions
4. Writes downsampled data with metadata columns

#### `process_http_request(influxdb3_local, request_body, args)`
#### `process_request(influxdb3_local, query_parameters, request_headers, request_body, args)`

Handles HTTP-triggered on-demand downsampling. Processes batch downsampling with configurable time ranges for backfill scenarios.

Expand All @@ -248,9 +252,9 @@ Key operations:
3. Applies aggregation functions to historical data
4. Returns processing statistics and results

#### `aggregate_data(data, interval, calculations)`
#### `build_downsample_query(fields_list, measurement, tags_list, interval, tag_values, start_time, end_time)`

Core aggregation engine that applies statistical functions to time-series data.
Builds the SQL query that applies time bucketing, tag filters, grouping, and aggregation functions to source data.

Supported aggregation functions:

Expand Down
80 changes: 80 additions & 0 deletions influxdata/downsampler/downsampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,86 @@
"description": "When true, full exception details (messages) are written to logs. When false (default), only the exception type is logged to avoid leaking sensitive values. Default: false.",
"required": false
}
],
"http_args_config": [
{
"name": "source_measurement",
"example": "metrics",
"description": "Name of the source measurement to downsample.",
"required": true
},
{
"name": "target_measurement",
"example": "metrics_daily",
"description": "Name of the target measurement to write downsampled data.",
"required": true
},
{
"name": "interval",
"example": "1d",
"description": "Time interval for downsampling batches. Units: 's', 'min', 'h', 'd', 'w', 'm', 'q', 'y'. Default: 10min.",
"required": false
},
{
"name": "batch_size",
"example": "7d",
"description": "Time interval for each HTTP backfill batch. Units: 's', 'min', 'h', 'd', 'w', 'm', 'q', 'y'. Default: 30d.",
"required": false
},
{
"name": "calculations",
"example": [["cpu_usage", "avg"], ["memory_usage", "max"]],
"description": "Aggregation functions. Use 'avg' for all fields, or a list of [field, aggregation] pairs. Valid functions: avg, sum, min, max, median, count, stddev, first_value, last_value, var, approx_median.",
"required": false
},
{
"name": "specific_fields",
"example": ["cpu_usage", "memory_usage"],
"description": "List of field names to downsample.",
"required": false
},
{
"name": "excluded_fields",
"example": ["status", "host"],
"description": "List of field and tag names to exclude from downsampling results.",
"required": false
},
{
"name": "tag_values",
"example": {"host": ["server1", "server2"]},
"description": "Tag filters as a JSON object mapping tag names to lists of allowed values.",
"required": false
},
{
"name": "max_retries",
"example": "5",
"description": "Maximum number of retries for write operations.",
"required": false
},
{
"name": "target_database",
"example": "analytics",
"description": "Target database for writing downsampled data. If not provided, uses the trigger's database.",
"required": false
},
{
"name": "backfill_start",
"example": "2024-01-01T00:00:00+00:00",
"description": "ISO 8601 datetime with timezone for the start of the HTTP backfill window. If omitted, starts from the oldest source point.",
"required": false
},
{
"name": "backfill_end",
"example": "2024-01-31T00:00:00+00:00",
"description": "ISO 8601 datetime with timezone for the end of the HTTP backfill window. Default: current time.",
"required": false
},
{
"name": "enable_full_logging",
"example": "true",
"description": "When true, full exception details (messages) are written to logs. When false (default), only the exception type is logged to avoid leaking sensitive values. Default: false.",
"required": false
}
]
}
"""
Expand Down
2 changes: 1 addition & 1 deletion influxdata/downsampler/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ manifest_schema_version = "1.2"

[plugin]
name = "downsampler"
version = "1.2.0"
version = "1.3.0"
description = "Enables downsampling of data in InfluxDB 3 with flexible configuration for time intervals, field aggregations, tag filtering, and batch processing. Supports scheduler and HTTP trigger modes."
triggers = ["process_scheduled_call", "process_request"]
homepage = "https://www.influxdata.com/"
Expand Down
62 changes: 62 additions & 0 deletions influxdata/influxdb_to_iceberg/influxdb_to_iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,68 @@
"description": "Automatically update Iceberg table schema when data doesn't match existing schema (default: false).",
"required": false
}
],
"http_args_config": [
{
"name": "measurement",
"example": "temperature",
"description": "Source measurement containing data to transfer.",
"required": true
},
{
"name": "catalog_configs",
"example": {"type": "sql", "uri": "sqlite:///path/to/catalog.db"},
"description": "Iceberg catalog configuration dictionary passed to PyIceberg load_catalog.",
"required": true
},
{
"name": "included_fields",
"example": ["temp_celsius", "humidity", "sensor_id"],
"description": "List of field and tag names to include in replication.",
"required": false
},
{
"name": "excluded_fields",
"example": ["usage_system"],
"description": "List of field and tag names to exclude from replication.",
"required": false
},
{
"name": "namespace",
"example": "weather",
"description": "Iceberg namespace for the target table. Default: default.",
"required": false
},
{
"name": "table_name",
"example": "temperature_metrics",
"description": "Iceberg table name. Default: same as measurement.",
"required": false
},
{
"name": "batch_size",
"example": "12h",
"description": "Batch size duration for HTTP processing. Format: <number><unit> where unit is s, min, h, d, or w. Default: 1d.",
"required": false
},
{
"name": "backfill_start",
"example": "2024-01-01T00:00:00+00:00",
"description": "ISO 8601 datetime with timezone for the start of the HTTP backfill window. If omitted, starts from the oldest source point.",
"required": false
},
{
"name": "backfill_end",
"example": "2024-01-07T00:00:00+00:00",
"description": "ISO 8601 datetime with timezone for the end of the HTTP backfill window. Default: current time.",
"required": false
},
{
"name": "auto_update_schema",
"example": "true",
"description": "Automatically update Iceberg table schema when data doesn't match existing schema. Default: false.",
"required": false
}
]
}
"""
Expand Down
2 changes: 1 addition & 1 deletion influxdata/influxdb_to_iceberg/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ manifest_schema_version = "1.2"

[plugin]
name = "influxdb_to_iceberg"
version = "1.1.0"
version = "1.2.0"
description = "Transfers data from InfluxDB 3 to Apache Iceberg tables with automatic schema management, customizable namespace and table naming, field filtering, and batch processing support."
triggers = ["process_scheduled_call", "process_request"]
homepage = "https://www.influxdata.com/"
Expand Down
2 changes: 1 addition & 1 deletion influxdata/notifier/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ manifest_schema_version = "1.2"

[plugin]
name = "notifier"
version = "1.0.0"
version = "1.1.0"
description = "Notification dispatcher that sends notifications through various channels (Slack, Discord, HTTP, SMS, WhatsApp) based on incoming HTTP requests. Features retry logic and environment variable support."
triggers = ["process_request"]
homepage = "https://www.influxdata.com/"
Expand Down
Loading