Alerting shows NoData, but dashboard has data

I use the infinity-datasource to fetch CSV data (time column and count column). This data is correctly shown in the dashboard.

Now, I want to add an alert if the count column exceeds the threshold.

I created an alert rule with exact the same properties as in the dashboard, removed the “time” column and added the treshold.

However, the “Preview Alert Rule Condition” only ever shows “no data”.

I am on backend parser, so this post is not the solution for me.

I debugged a little bit, with the following results:

  1. my original HTTP endpoint providing the CSV data is not called at all
  2. the Grafana FE makes a request to /api/v1/eval, with a property “range: true” inside the request.
  3. this request returns no data (empty array)
  4. If a remove the “range:true” property from the request (tested via external HTTP client), the request shows data and my HTTP endpoint is called.

So, my question is: Is this a bug with Grafana or the infinity-datasource or am I missing a configuration or limitation of Grafana or the infinity-datasource?

Thanks @yesoreyeram for the quick reply.

I reviewed your link, but sadly it does not work:
I set up everything in Explore (like in your screenshot, and it shows the data).

My use case: I want to setup an alert if there is any entry in the last 5 minutes having value > 40. I came up with this in Explore:

Entering the exact same settings in the alert rule does not work, it shows empty data, and my HTTP endpoint is not even called.

(I removed some UI controls in the screenshot in order to fit it all into one screen).

More interestingly, if now open that Alert Rule in Explore, I get an error:

The error is: Query error: Unknown Query Type, but the settings are the same in both the manual Explore and the Explore which I opened from the Alert rule.

Alerting can process CSV data when only includes a numeric column. From docs:

Alerting can work with two types of data:

  1. Time series data — The query returns a collection of time series, where each series must be reduced to a single numeric value for evaluating the alert condition.
  2. Tabular data — The query must return data in a table format with only one numeric column. Each row must have a value in that column, used to evaluate the alert condition. See a tabular data example.

The CSV content of this gist file is valid.

Country,Population
India,3000
China,3500
UK,1200
USA,2000
Germany,700

Alerting isn’t able to process the CSV content when fetching the remote file using the Infinity plugin:

However, the same request works fine in Explore.

I’m not sure what’s causing the difference. I tested the same Infinity request in both contexts and noticed subtle differences between Explore and the Alerting query in the browser network inspector.

Maybe @yesoreyeram has some insights into what might be going on here?

@pepecano you need to define columns and types. By default everything in CSV are considered strings. You need to have a number column

Thank you, @yesoreyeram!!

@fafeitsch, defining the columns on the Infinity query editor did the trick for me.

Hi @pepecano,

thanks for your contribution. As seen in the first screenshot of my second post in this thread, I already do define the one column as Number (I also define it in the alert rule, even if the second screenshot does not show it. I removed the control in order to get the whole screen onto that screenshot).

I try to debug it a little further in the coming days, but for now, I don’t have any other idea on how to solve this.

@fafeitsch - I am trying to reproduce the issue but couldn’t.

sample csv : https://gist.githubusercontent.com/yesoreyeram/4ec720bf9a0f950ff2e3389f763a1045/raw/f556f10dd5177c68cd5ccd60b8b05eb3c87d9ebd/data-without-time.csv

device,averageSeconds
a,1
b,2
c,3
d,4

in explore

in alerts

Ok, thanks for all the help. I now think I ran into a strange Grafana bug because the existing alert rule does not work.
I created an identical new rule with exact the same settings (I even asked to collegues to cross check). The new one does show data, whereas the old one seems to be broken beyond repair.

So, for anyone having similar issues: My solution was to scap the alerting rule and create a new one.

Again, thanks for all your effort @yesoreyeram and @pepecano and have a nice weekend.

2 Likes