How to create alert based on grafana transform using LogQL

I’m new using Grafana, and I have only experience in creating simple dashboards, such as :



As you can see from the picture above, I am using the transformation to show the field extra.seconds that are located inside a JSON type of file.

Now I want to make an alert that ping me when it reached a certain threshold (let’s say 50 s).
I created an alert rule and pasted the same LogQL:

{app="backend"} != log_requests|=completion successful|=extra| json sec ="extra.seconds"

However I got this as an error: Failed to evaluate queries and expressions: [sse.readDataError] [A] got error: input data must be a wide series but got type long (input refid)

It must be because of the transform, however I don’t know how to do that in the Alerting page. Can someone help me please?

Your goal is to remove that transformation - you can use JSON parser on that field, then select that field with value and unwrap it at the end.

Example how I got it to work:

count_over_time({app="eta-bot"} | level = `error` [15m])