‹ Plugins / Forecast Error Evaluator
Scheduled

Forecast Error Evaluator

The Forecast Error Evaluator plugin continuously checks forecast accuracy in production by comparing predictions to real results and tracking error metrics like MAE, RMSE, MAPE, and SMAPE. It helps teams catch model drift early, improve trust in forecasts, and act faster across demand planning, capacity forecasting, weather, sensor, and other prediction-driven workflows.

Configuration

Plugin parameters may be specified as key-value pairs in the --trigger-arguments flag (CLI) or in the trigger_arguments field (API) when creating a trigger. Some plugins support TOML configuration files, which can be specified using the plugin’s config_file_path parameter.

If a plugin supports multiple trigger specifications, some parameters may depend on the trigger specification that you use.

Plugin metadata

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 UI to display and configure the plugin.

Required parameters

Parameter Type Default Description
forecast_measurement string required Measurement containing forecasted values
actual_measurement string required Measurement containing actual (ground truth) values
forecast_field string required Field name for forecasted values
actual_field string required Field name for actual values
error_metric string required Error metric to compute: “mse”, “mae”, “rmse”, “mape”, or “smape”
error_thresholds string required Threshold levels. Format: INFO-"0.5":WARN-"0.9":ERROR-"1.2":CRITICAL-"1.5"
window string required Time window for data analysis. Format: <number><unit> (e.g., “1h”)
senders string required Dot-separated list of notification channels (e.g., “slack.discord”)

Notification parameters

Parameter Type Default Description
notification_text string default template Template for notification message with variables $measurement, $level, $field, $error, $metric, $tags
notification_path string “notify” URL path for the notification sending plugin
port_override integer 8181 Port number where InfluxDB accepts requests

Timing parameters

Parameter Type Default Description
min_condition_duration string none Minimum duration for anomaly condition to persist before triggering notification
rounding_freq string “1s” Frequency to round timestamps for alignment

Authentication parameters

Parameter Type Default Description
influxdb3_auth_token string env variable API token for InfluxDB 3. Can be set via INFLUXDB3_AUTH_TOKEN

Sender-specific parameters

Slack notifications

Parameter Type Default Description
slack_webhook_url string required Webhook URL from Slack
slack_headers string none Base64-encoded HTTP headers

Discord notifications

Parameter Type Default Description
discord_webhook_url string required Webhook URL from Discord
discord_headers string none Base64-encoded HTTP headers

HTTP notifications

Parameter Type Default Description
http_webhook_url string required Custom webhook URL for POST requests
http_headers string none Base64-encoded HTTP headers

SMS notifications (via Twilio)

Parameter Type Default Description
twilio_sid string env variable Twilio Account SID (or TWILIO_SID env var)
twilio_token string env variable Twilio Auth Token (or TWILIO_TOKEN env var)
twilio_from_number string required Twilio sender number (e.g., “+1234567890”)
twilio_to_number string required Recipient number (e.g., “+0987654321”)

TOML configuration

Parameter Type Default Description
config_file_path string none TOML config file path relative to PLUGIN_DIR (required for TOML configuration)

To use a TOML configuration file, set the PLUGIN_DIR environment variable and specify the config_file_path in the trigger arguments. This is in addition to the --plugin-dir flag when starting InfluxDB 3.

Example TOML configuration

[forecast_error_config_scheduler.toml]

For more information on using TOML configuration files, see the Using TOML Configuration Files section in the influxdb3_plugins/README.md.

Examples

Example 1: Temperature forecast validation with Slack alerts

Validate temperature forecast accuracy and send Slack notifications:

# Create the trigger
influxdb3 create trigger \
  --database weather_db \
  --path "gh:influxdata/forecast_error_evaluator/forecast_error_evaluator.py" \
  --trigger-spec "every:15m" \
  --trigger-arguments 'forecast_measurement=temp_forecast,actual_measurement=temp_actual,forecast_field=predicted,actual_field=temperature,error_metric=rmse,error_thresholds=INFO-"0.5":WARN-"1.0":ERROR-"2.0":CRITICAL-"3.0",window=30m,senders=slack,slack_webhook_url="$SLACK_WEBHOOK_URL",min_condition_duration=10m' \
  temp_forecast_check

# Write forecast data
influxdb3 write \
  --database weather_db \
  "temp_forecast,location=station1 predicted=22.5"

# Write actual data  
influxdb3 write \
  --database weather_db \
  "temp_actual,location=station1 temperature=21.8"

# Check logs after trigger runs
influxdb3 query \
  --database YOUR_DATABASE \
  "SELECT * FROM system.processing_engine_logs WHERE trigger_name = 'temp_forecast_check'"

Expected output

  • Plugin computes RMSE between forecast and actual values
  • If RMSE > 0.5, sends INFO-level notification
  • If RMSE > 1.0, sends WARN-level notification
  • Only triggers if condition persists for 10+ minutes (debounce)

Set SLACK_WEBHOOK_URL to your Slack incoming webhook URL.

Notification example:

[WARN] Forecast error alert in temp_forecast.predicted: rmse=1.2. Tags: location=station1

Example 2: Multi-metric validation with multiple channels

Monitor multiple forecast metrics with different notification channels:

# Create trigger with Discord and HTTP notifications
influxdb3 create trigger \
  --database analytics \
  --path "gh:influxdata/forecast_error_evaluator/forecast_error_evaluator.py" \
  --trigger-spec "every:1h" \
  --trigger-arguments 'forecast_measurement=sales_forecast,actual_measurement=sales_actual,forecast_field=predicted_sales,actual_field=sales_amount,error_metric=mae,error_thresholds=WARN-"1000":ERROR-"5000":CRITICAL-"10000",window=6h,senders=discord.http,discord_webhook_url="$DISCORD_WEBHOOK_URL",http_webhook_url="$HTTP_WEBHOOK_URL",notification_text="[$$level] Sales forecast error: $$metric=$$error (threshold exceeded)",rounding_freq=5min' \
  sales_forecast_monitor

Set DISCORD_WEBHOOK_URL and HTTP_WEBHOOK_URL to your webhook URLs.

Example 3: SMS alerts for critical forecast failures

Set up SMS notifications for critical forecast accuracy issues:

# Set environment variables (recommended for sensitive data)
export TWILIO_SID="your_twilio_sid"
export TWILIO_TOKEN="your_twilio_token"

# Create trigger with SMS notifications
influxdb3 create trigger \
  --database production_forecasts \
  --path "gh:influxdata/forecast_error_evaluator/forecast_error_evaluator.py" \
  --trigger-spec "every:5m" \
  --trigger-arguments 'forecast_measurement=demand_forecast,actual_measurement=demand_actual,forecast_field=predicted_demand,actual_field=actual_demand,error_metric=mse,error_thresholds=CRITICAL-"100000",window=15m,senders=sms,twilio_from_number="+1234567890",twilio_to_number="+0987654321",notification_text="CRITICAL: Production demand forecast error exceeded threshold. MSE: $$error",min_condition_duration=2m' \
  critical_forecast_alert

Ready to get started?

Download InfluxDB 3 and have Forecast Error Evaluator running in minutes.