From a192d13bfdc280d89c11ea942a247fd406eb3494 Mon Sep 17 00:00:00 2001 From: Aliaksei Kharlap Date: Fri, 31 Jul 2026 19:04:36 +0300 Subject: [PATCH] fix: remove http_args_config from plugins that ignore args --- .github/copilot-instructions.md | 2 +- README.md | 2 +- README_TEMPLATE.md | 4 +- influxdata/downsampler/downsampler.py | 80 ------------ influxdata/downsampler/manifest.toml | 2 +- influxdata/influxdb_to_iceberg/README.md | 2 +- .../influxdb_to_iceberg.py | 62 ---------- influxdata/influxdb_to_iceberg/manifest.toml | 2 +- influxdata/notifier/README.md | 2 +- influxdata/notifier/manifest.toml | 2 +- influxdata/notifier/notifier_plugin.py | 16 +-- influxdata/prophet_forecasting/README.md | 2 +- influxdata/prophet_forecasting/manifest.toml | 2 +- .../prophet_forecasting.py | 116 ------------------ 14 files changed, 12 insertions(+), 284 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index cd48a3e..80e1ed2 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -16,7 +16,7 @@ Each plugin must implement specific functions based on its type: - `process_scheduled_call(influxdb3_local, call_time, args)` - for scheduled plugins - `process_writes(influxdb3_local, table_batches, args)` - for data write plugins -- `process_http_request(influxdb3_local, request_body, args)` - for HTTP plugins +- `process_request(influxdb3_local, query_parameters, request_headers, request_body, args)` - for HTTP plugins ### Plugin Organization diff --git a/README.md b/README.md index 6826766..8533c2e 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ ADATA.md). - Implement `process_writes(influxdb3_local, table_batches, args)` 3. **HTTP Plugins** - respond to HTTP requests: - - Implement `process_http_request(influxdb3_local, request_body, args)` + - Implement `process_request(influxdb3_local, query_parameters, request_headers, request_body, args)` ### Development Guidelines diff --git a/README_TEMPLATE.md b/README_TEMPLATE.md index e8e3a9d..fc09cc5 100644 --- a/README_TEMPLATE.md +++ b/README_TEMPLATE.md @@ -234,7 +234,7 @@ Key operations: 2. Applies processing to each row 3. Writes to target measurement immediately -#### `process_http_request(influxdb3_local, request_body, args)` +#### `process_request(influxdb3_local, query_parameters, request_headers, request_body, args)` Handles HTTP-triggered processing. Processes data sent via HTTP requests. Key operations: @@ -256,7 +256,7 @@ Key operations: Plugin Module ├── process_scheduled_call() # Scheduled trigger handler ├── process_writes() # Data write trigger handler -├── process_http_request() # HTTP trigger handler +├── process_request() # HTTP trigger handler ├── validate_config() # Configuration validation ├── apply_processing() # Core processing logic └── helper_functions() # Utility functions diff --git a/influxdata/downsampler/downsampler.py b/influxdata/downsampler/downsampler.py index edba777..fc833d4 100644 --- a/influxdata/downsampler/downsampler.py +++ b/influxdata/downsampler/downsampler.py @@ -80,86 +80,6 @@ "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 - } ] } """ diff --git a/influxdata/downsampler/manifest.toml b/influxdata/downsampler/manifest.toml index 9538be4..8b488d7 100644 --- a/influxdata/downsampler/manifest.toml +++ b/influxdata/downsampler/manifest.toml @@ -2,7 +2,7 @@ manifest_schema_version = "1.2" [plugin] name = "downsampler" -version = "1.3.0" +version = "1.4.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/" diff --git a/influxdata/influxdb_to_iceberg/README.md b/influxdata/influxdb_to_iceberg/README.md index 9012e37..968d99c 100644 --- a/influxdata/influxdb_to_iceberg/README.md +++ b/influxdata/influxdb_to_iceberg/README.md @@ -298,7 +298,7 @@ Key operations: 3. Creates Iceberg table if needed 4. Appends data to Iceberg table -#### `process_http_request(influxdb3_local, request_body, args)` +#### `process_request(influxdb3_local, query_parameters, request_headers, request_body, args)` Handles on-demand data transfers via HTTP. Supports backfill operations with configurable batch sizes. diff --git a/influxdata/influxdb_to_iceberg/influxdb_to_iceberg.py b/influxdata/influxdb_to_iceberg/influxdb_to_iceberg.py index 31f8288..81c122b 100644 --- a/influxdata/influxdb_to_iceberg/influxdb_to_iceberg.py +++ b/influxdata/influxdb_to_iceberg/influxdb_to_iceberg.py @@ -56,68 +56,6 @@ "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: 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 - } ] } """ diff --git a/influxdata/influxdb_to_iceberg/manifest.toml b/influxdata/influxdb_to_iceberg/manifest.toml index c546498..d57c169 100644 --- a/influxdata/influxdb_to_iceberg/manifest.toml +++ b/influxdata/influxdb_to_iceberg/manifest.toml @@ -2,7 +2,7 @@ manifest_schema_version = "1.2" [plugin] name = "influxdb_to_iceberg" -version = "1.2.0" +version = "1.3.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/" diff --git a/influxdata/notifier/README.md b/influxdata/notifier/README.md index 87dbfd4..acd641c 100644 --- a/influxdata/notifier/README.md +++ b/influxdata/notifier/README.md @@ -201,7 +201,7 @@ influxdb3 query --database YOUR_DATABASE "SELECT * FROM system.processing_engine ### Main functions -#### `process_http_request(influxdb3_local, request_body, args)` +#### `process_request(influxdb3_local, query_parameters, request_headers, request_body, args)` Handles incoming HTTP notification requests. Parses the request body, extracts notification text and sender configurations, and dispatches notifications to configured channels. diff --git a/influxdata/notifier/manifest.toml b/influxdata/notifier/manifest.toml index 6c4e81e..583dbf0 100644 --- a/influxdata/notifier/manifest.toml +++ b/influxdata/notifier/manifest.toml @@ -2,7 +2,7 @@ manifest_schema_version = "1.2" [plugin] name = "notifier" -version = "1.1.0" +version = "1.2.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/" diff --git a/influxdata/notifier/notifier_plugin.py b/influxdata/notifier/notifier_plugin.py index 8769493..182f538 100644 --- a/influxdata/notifier/notifier_plugin.py +++ b/influxdata/notifier/notifier_plugin.py @@ -1,20 +1,6 @@ """ { - "plugin_type": ["http"], - "http_args_config": [ - { - "name": "notification_text", - "example": "Alert: High CPU usage detected on server1", - "description": "Text content of the notification message in the HTTP request body.", - "required": true - }, - { - "name": "senders_config", - "example": {"slack": {"slack_webhook_url": "https://hooks.slack.com/services/...", "slack_headers": "eyJDb250ZW50LVR5cGUiOiAiYXBwbGljYXRpb24vanNvbiJ9"}, "sms": {"twilio_from_number": "+19876543210", "twilio_to_number": "+1234567890"}}, - "description": "HTTP request body object mapping sender names to channel-specific configuration. Supported senders: slack (slack_webhook_url, slack_headers), discord (discord_webhook_url, discord_headers), http (http_webhook_url, http_headers), sms and whatsapp (twilio_sid, twilio_token, twilio_from_number, twilio_to_number). Twilio credentials may also come from TWILIO_SID and TWILIO_TOKEN.", - "required": true - } - ] + "plugin_type": ["http"] } """ diff --git a/influxdata/prophet_forecasting/README.md b/influxdata/prophet_forecasting/README.md index 7f9663a..2333938 100644 --- a/influxdata/prophet_forecasting/README.md +++ b/influxdata/prophet_forecasting/README.md @@ -295,7 +295,7 @@ Key operations: 4. Generates forecasts for specified horizon 5. Optionally validates against actual data and sends alerts -#### `process_http_request(influxdb3_local, request_body, args)` +#### `process_request(influxdb3_local, query_parameters, request_headers, request_body, args)` Handles on-demand forecast requests via HTTP. Supports backfill operations with configurable time ranges. diff --git a/influxdata/prophet_forecasting/manifest.toml b/influxdata/prophet_forecasting/manifest.toml index f48ecd8..15ab33c 100644 --- a/influxdata/prophet_forecasting/manifest.toml +++ b/influxdata/prophet_forecasting/manifest.toml @@ -2,7 +2,7 @@ manifest_schema_version = "1.3" [plugin] name = "prophet_forecasting" -version = "1.3.0" +version = "1.4.0" description = "Provides time series forecasting capabilities for InfluxDB 3 data using the Prophet library." triggers = ["process_scheduled_call", "process_request"] homepage = "https://www.influxdata.com/" diff --git a/influxdata/prophet_forecasting/prophet_forecasting.py b/influxdata/prophet_forecasting/prophet_forecasting.py index b165951..34a0398 100644 --- a/influxdata/prophet_forecasting/prophet_forecasting.py +++ b/influxdata/prophet_forecasting/prophet_forecasting.py @@ -212,122 +212,6 @@ "description": "Path to config file to override args. Format: 'config.toml'.", "required": false } - ], - "http_args_config": [ - { - "name": "measurement", - "example": "temperature", - "description": "Source InfluxDB measurement name to query historical data from.", - "required": true - }, - { - "name": "field", - "example": "value", - "description": "Field name within the measurement to forecast.", - "required": true - }, - { - "name": "forecast_horizont", - "example": "7d", - "description": "Forecast horizon duration. Format: where unit is s, min, h, d, w, m, q, or y.", - "required": true - }, - { - "name": "tag_values", - "example": {"region": "us-west", "device": "sensor1"}, - "description": "Tag filters for the InfluxDB query as a JSON object.", - "required": true - }, - { - "name": "target_measurement", - "example": "temperature_forecast", - "description": "Destination measurement name to write forecast points.", - "required": true - }, - { - "name": "unique_suffix", - "example": "model_v1_20250722", - "description": "Unique identifier for model versioning and storage.", - "required": true - }, - { - "name": "start_time", - "example": "2025-05-20T00:00:00+00:00", - "description": "Historical window start time as an ISO 8601 datetime with timezone.", - "required": true - }, - { - "name": "end_time", - "example": "2025-06-19T00:00:00+00:00", - "description": "Historical window end time as an ISO 8601 datetime with timezone.", - "required": true - }, - { - "name": "seasonality_mode", - "example": "additive", - "description": "Prophet seasonality mode: additive or multiplicative. Default: additive.", - "required": false - }, - { - "name": "changepoint_prior_scale", - "example": "0.05", - "description": "Flexibility of trend changepoints. Default: 0.05.", - "required": false - }, - { - "name": "changepoints", - "example": ["2025-01-01", "2025-06-01"], - "description": "List of changepoint dates or datetimes in ISO format.", - "required": false - }, - { - "name": "save_mode", - "example": "true", - "description": "Whether to save or load a persisted model using unique_suffix. Default: false.", - "required": false - }, - { - "name": "validation_window", - "example": "3d", - "description": "Duration for validation window. Defaults to 0s (no validation). Format: .", - "required": false - }, - { - "name": "msre_threshold", - "example": "0.05", - "description": "Maximum acceptable Mean Squared Relative Error for validation. Defaults to infinity.", - "required": false - }, - { - "name": "target_database", - "example": "forecast_db", - "description": "Optional InfluxDB database name for writing forecast results.", - "required": false - }, - { - "name": "holiday_date_list", - "example": ["2025-01-01", "2025-12-25"], - "description": "List of custom holiday dates in ISO format.", - "required": false - }, - { - "name": "holiday_names", - "example": ["New Year", "Christmas"], - "description": "List of names corresponding to holiday_date_list.", - "required": false - }, - { - "name": "holiday_country_names", - "example": ["US", "UK"], - "description": "List of country codes or names for built-in Prophet holidays.", - "required": false - }, - { - "name": "inferred_freq", - "example": "1D", - "description": "Manually specified frequency. If omitted, frequency is inferred from data.", - "required": false - } ] } """