Create an alert from a Redis datasource list

(using Grafana v12.0.2 running on Ubuntu)

Hi all,

I am trying to create an alert that triggers when the latest timestamp in a Redis datasource (stored as a LIST) is older than a certain amount (indicating that the server that is writing entries to the Redis database is not operational).

In the visualisation panels I am able to query the Redis db using the Redis Datasource Plugin, get the contents of the list with LRANGE <list name> 0 -1, which is basically a list of JSON objects with a timestamp property (in ms) among others, and then use the Transformations Extract Fields (to show a table from the JSON), Convert Field Type, and others on the fields to shwo the data as a Time Series in the Dashboard.

To create the alert that I need, I would need to get the latest entry in the list and also get the current time, compare them, and if over a certain value trigger the alert, which would need an Expression.

However when trying to create an alert from this I get the error:
[sse.readDataError] [A] got error: input data must be a wide series but got type not (input refid)

How can I create a wide series so that I can process it with expressions from a Redis data source?
Is this always an issue with the way Redis stores data in Lists / Hashes, or can the data be formatted some specific way on the db that is more Grafana friendly? Or is there another strategy I can use to get the same effect?

Hi,

If your goal is to detect whether “the server that is writing entries to Redis is not operational,” it might be easier to monitor that server directly rather than inferring it from Redis list entries. For example:

  • Expose a simple metric from the writer process (via Prometheus client libraries or an exporter).

  • Use Prometheus’ up metric or a heartbeat-style metric to track whether the process is alive and updating.

  • Build an alert in Grafana that fires when the writer stops reporting.

This pattern is common and might be more robust to maintain than querying Redis lists.

The Alerting docs includes a guide on related approaches: