Alerting with InfluxDB 3 Core and Enterprise
By
Anais Dotis-Georgiou /
Developer
Mar 11, 2025
Navigate to:
Monitoring is only as good as the alerts that surface critical issues before they spiral out of control. With InfluxDB 3 Core and Enterprise, you can extend alerting capabilities beyond built-in solutions by leveraging custom Python processing plugins. Whether you need real-time notifications when thresholds are exceeded or advanced anomaly detection tailored to your infrastructure, developing custom alerting logic ensures you get the right alerts at the right time. In this post, we’ll dive into how to build and integrate alerting plugins within InfluxDB 3. Specifically, we’ll learn how to incorporate a custom alerting plugin that notifies you via Slack, Discord, or other HTTP endpoints when key metrics exceed thresholds. This post will walk through how to set up and configure the alert plugin, covering its features, setup, and real-world use cases.
Why custom alerts matter in InfluxDB 3
InfluxDB 3 provides powerful time-series storage and query capabilities, but detecting anomalies in real-time requires an efficient alerting system. The alert plugin enables dynamic notifications when a sensor value, CPU usage, or any monitored field crosses a threshold.
Key features include:
- Multi-platform notifications – Supports Slack, Discord, and generic HTTP endpoints
- Configurable thresholds – Set custom conditions for triggering alerts
- Flexible messages – Customize alert content with dynamic variables
- Retries with backoff – Ensure delivery with exponential retry mechanisms
- Environment variable support – Securely configure webhook URLs
While this plugin focuses on sending alerts for straightforward threshold-based conditions, you can extend its functionality by building a custom processing plugin that performs sophisticated anomaly detection or forecasting. For example, you could develop a plugin that analyzes trends, detects anomalies, and writes flagged events to a separate database. Then, by setting the threshold to 0
and pointing this alert plugin at the anomaly database, you can trigger alerts whenever new anomalies are detected. This modular approach allows you to integrate advanced anomaly detection with real-time notifications, ensuring a more intelligent and proactive monitoring system.
Getting started: prerequisites
This blog post assumes that you have installed and are using InfluxDB 3 Core or InfluxDB 3 Enterprise. Additionally, before setting up alerts, install the required package for HTTP requests:
influxdb3 install package httpx
This tutorial also assumes that you have created two databases with:
influxdb3 create database my_databaseinflxudb3 create database alerts_history
Setting up notifications
To send alerts to Slack, set up a webhook URL. For testing, use the public webhook (not for production):
export SLACK_WEBHOOK_URL= "https://hooks.slack.com/services/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"
This posts alerts to the #notifications-testing channel in the InfluxData Slack community. For production, use your own Slack webhook:
export SLACK_WEBHOOK_URL="[your slack webhook]"
Similarly, to leverage the Discord Integration, set up a a Discord webhook:
export DISCORD_WEBHOOK_URL="[your discord webhook]"
Testing the influxdata/Anaisdg/Alerts/alert.py plugin
Make sure to place the alert.py script in ~/influxdb3/plugins before running the command below.
Once configured, test alerts using sample data. For example, to send a Slack alert when the temperature exceeds 20°C, run:
influxdb3 test wal_plugin \
--database my_database \
--lp="sensor_data,sensor=TempSensor1,location=living_room temperature=25 123456789" \
--input-arguments "name=temp_alert,endpoint_type=slack,threshold=20,field_name=temperature,notification_text=Alert: Temperature ${temperature} exceeds threshold,webhook_url=$SLACK_WEBHOOK_URL" \
alert.py
Expected behavior: The temperature field exceeds 20, so a notification is sent to Slack with the message:
"Temperature 25 exceeds threshold"
The input-arguments
flag defines all of the configuration options for your plugin. Here’s how you can fine-tune this specific plugin:
Parameter | Required? | Description |
name | Yes | Unique identifier for the alert instance |
endpoint_type | Yes | Choose slack, discord, or http for alerts |
field_name | Yes | Field to monitor (e.g., temperature, cpu_usage) |
threshold | Yes | Numeric value that triggers an alert |
notification_text | Optional | Custom alert message (supports variables) |
webhook_url | Optional | Override environment variable webhook |
headers | Optional | Base64-encoded headers for HTTP endpoints |
alerts_db | Optional | Database to store alert history for tracking and analysis |
Sending and tracking alerts
Now that we’ve tested our plugin, we’re ready to set up and enable an alert trigger. For this example, we’ll send alert notifications to Discord and use the alerts_db option:
influxdb3 create trigger \
--database my_database \
--plugin-filename alert.py \
--trigger-spec "table:sensor_data" \
--trigger-arguments "name=temp_alert_trigger,endpoint_type=discord,threshold=20,field_name=temperature,notification_text=Value is \${temperature},webhook_url=$DISCORD_WEBHOOK_URL,alert_db=alerts_history" \
temperature_alert
influxdb3 enable trigger --database my_database temperature_alert
Now, we can write test data and check the alerts_history database to confirm our notification sent and that we’re writing alert metrics successfully:
influxdb3 write --database my_database "sensor_data,sensor=TempSensor1,location=living_room temperature=25"
influxdb3 query --database alerts_history "select * from sensor_data"
The output of your query should look like this:
time | alert_message | sensor | location | plugin_name | processed_at | temperature |
---|---|---|---|---|---|---|
2025-02-25T00:25:40Z | Value is 25.0 | TempSensor1 | living_room | temp_alert | 2025-02-25T00:25:45Z | 25.0 |
Final thoughts
The influxdata/Anaisdg/alert plugin for InfluxDB 3 provides a powerful and flexible way to monitor key metrics and trigger notifications in real-time. Whether you need Slack, Discord, or custom HTTP alerts, this plugin helps ensure that critical issues never go unnoticed. I hope this tutorial helps you start alerting with Python Plugins and enabling triggers in InfluxDB 3 Core and Enterprise with Docker. I encourage you to look at the InfluxData/influxdb3_plugins as we add examples and plugins there. Also, please contribute your own! To learn more about building your own plugin, check out these resources:
- Transform Data with the New Python Processing Engine in InfluxDB 3
- Get started: Python Plugins and the Processing Engine
- Processing engine and Python plugins
I invite you to contribute any plugin that you create there. Check out our Getting Started Guide for Core and Enterprise, and share your feedback with our development team on Discord in the #influxdb3_core channel, Slack in the #influxdb3_core channel, or our Community Forums.