This tutorial will show you how to monitor a system, trigger alerts, send notifications when an alert occurs and display important metrics with a dynamic dashboard.

This blog post will show you how to handle alerts with Warp 10 by building a simple website uptime checker. It follows on from a previous article: Alerts are real time series.
The main idea is to use a runner to periodically check some URLs and store the HTTP status code and the response time.
If the status code is greater or equal to 400, we publish an alert.
Alerts will be notified using https://ntfy.sh/ for demo purposes and finally, we will build a Discovery dashboard.
Configuration
In order for these macros to operate properly, they need to have access to a write token and a read token. These tokens should be defined in your configuration under the following keys:
You also have to configure our HTTP extension.
Macros
At first, we have to define some macros, especially one which contains our website's URLs.
Create a new one in /path/to/warp10/macros/senx/uptime/sites.mc2
:
This macro simply returns a list of URLs with some metadata.
We also define a utility macro which inserts data into a GTS, /path/to/warp10/macros/senx/uptime/utils/toGTS.mc2
:
Read this article to learn more about macro mechanism with Warp 10. |
Runners
The first step is to define a runner in /path/to/warp10/warpscript/uptime/60000/check-sites.mc2
:
This runner will be run each 60000 milliseconds and for each URL will perform a "HEAD" request. We use CHRONOSTART, CHRONOEND, and CHRONOSTATS to grab the response time in nanoseconds.
We store the response time and the HTTP status in GTS.
If the status >= 400, we trigger an alert with @senx/alerting/trigger
.
This will create an entry in the series alert.events{name=warp10.io,group=prod}
indicating a TRIGGER
action was performed, and a true
value will appear in series alert{name=warp10.io,group=prod}
, both at the same current timestamp.
Then we need to monitor our alerts and send a notification if any occur. Create /path/to/warp10/warpscript/uptime/60000/notify.mc2
:
You can also publish your notification to Slack, Teams, AlertManager, or whatever.
Your alerting system is ready.
You can test it directly within the Ntfy web app by subscribing to the right topic.

Read this article to learn more about runner mechanism with Warp 10. |
Discovery Dashboards
Now, we will show you how to build a complete Discovery dashboard that displays statuses, response time and alerts.
Bootstrapping
First, we have to define the dashboard skeleton, you can use either VSCode or WarpStudio.
Data Tile
This tile is a hidden one. It will periodically perform a data fetch and dispatch the data to other tiles.
It is important to WRAP GTS (or list of GTSs) in order to propagate them through the event mechanism.
Status Tile
We will build an array tile that will sum up web sites status.

Since we have wrapped our GTSs, it is important to UNWRAP them before using them.
Response Time Tile
This tile will display a response time area chart.

The Down Phases Chart
This chart is a kind of profile chart. We need to build a GTS which has a duration of an outage as a value.

All together
Here is the final result.

Going further
Of course, you can add more metrics or build a dashboard with a group or website selector.
You can also display some metrics related to SLA, send extra notifications when your website is down for too long, and so on.
You may also use Discovery Explorer to serve dashboards to your team.
As you have seen, managing alerts and external notifications is very easy.
Read more
WarpScript in Jupyter notebooks
WarpScript
Kafka Streams
June 2023: Warp 10 release 3.0.0

Senior Software Engineer