Grafana version: v9.5.1
Hi! I am working with a panel that contains multi-frame time series, and I am trying to generate an alert based on this.
The query accesses MSSQL and retrieves:
In the panel, each of the labels and their numerical values can be seen:
The transformation for multi-frame time series was applied:

I need to generate an alert with the condition that if one of the labels has a value > 50, it should trigger an alert. However, when I try to configure it, I get the error Failed to evaluate queries and expressions: input data must be a wide series but got type long (input refid)
:

How can I configure the alert in this case?
Anyone with this problem? I’m having problems with Azure Monitor too (Log Analytics).
Hi,
Do I assume correctly that Prepare time series
is a transformation? Those are not supported in alerting, so you’ll have to do without them, only relying on your query and expressions. Unfortunately, I have never used any of the datasources you’re using, so I won’t be much of a help with that 
Hi @dawiddebowski ! Thanks for your reply.
That’s correct. I’m using a “multi-frame time series” in that transformation. The data sources are mostly anecdotal. Essentially, I’m manipulating the data to add labels to the time series graph, allowing me to divide it into multiple lines based on grouped string values.
Based on your experience, how would you approach solving this?
Tbh I’m not sure. Could you provide some data taken out of the query (can be random, the schema and operations are what I’m after) and some sample scenario (e.g. for the data like this I would like to alert when the column A reaches something). Grafana alerts are meant to work on numbers so it might not be required to stretch your data to time series (time series data must be reduced in order to be alerted on, the error you’ve gotten probably is from the shortcut of creating an alert from the panel but an alert can be created and linked to the panel given you’re using Grafana 8+).
No problemo. Let’s say I’m using a Kusto Query like this:
Heartbeat
| where TimeGenerated > ago(24h)
| where Computer contains "domain"
| summarize count() by bin(TimeGenerated, 1m), Computer
This will output something like this:
| TimeGenerated | Computer | count_ |
| ------------------------------------------------ |
| [timestamp] | server1.domain.com | 1 |
| [timestamp] | server2.domain.com | 1 |
| [timestamp] | server1.domain.com | 1 |
| [timestamp] | server2.domain.com | 1 |
The value 1 means there’s a hb corresponding to that server. In this scenario, a persisted value of 0 means that the server is offline, so the alert configuration would be hb < 1
. After the multiframe transformation, the output looks like this (also renaming the column of values):
frame: server1.domain.com
| TimeGenerated | server1.domain.com |
| ------------------------------------------------ |
| [timestamp] | 1 |
| [timestamp] | 1 |
| [timestamp] | 1 |
Or…
frame: server2.domain.com
| TimeGenerated | server2.domain.com |
| ------------------------------------------------ |
| [timestamp] | 1 |
| [timestamp] | 1 |
| [timestamp] | 1 |
This allows me to graph with multiple labels:
However, this leads to the error I described in the post. I’m trying to properly display a value/label/time graph and at the same time configure alerts so I can be notified when any label crosses the threshold.
PD: I’m using Grafana v10.4.7
Ok, so:
As you already know, transformations you’re executing in panel are not executed in alert. I managed to replicate the same error you have using Infinity Plugin. Now, what I think is happening (despite what the error says), Grafana has a hard time understanding your query. It tries to create time series but can’t (because of reasons
I don’t know
). Additionally, it cannot create an alert from your tabular data because you have two numbers - a TimeGenerated
field and count_
field. What sorta worked for me was removing the TimeGenerated
field from the result:
However, as you might see, the data is duplicated. If that’s possible in the query (I’ve never used the datasource you’re using), I’d get the most recent point for each server and operate on last point in the alert, so that your data look like this:
and threshold expression like this:

Sorry if it’s not ideal response, but I don’t know why Grafana doesn’t recognize the time column as timestamp and creates time series from that out of the box.