What Grafana version and what operating system are you using? v8.3.3
Are you using Grafana Cloud or self-hosted Grafana? Self Hosted
Are you using legacy alerting or Unified Alerting? Unified Alerting
was the alert in question migrated from the legacy platform into Unified Alerting, or did you first create it inside the new platform? Create on new platform
Please list ALL configuration options related to alerting. You can find these in the Alerting and Unified Alerting sections of Grafana’s config file. If you are now using or have previously used the beta version of ngalert (released with Grafana 8), please note that too.
Rule type : Grafana Managed ALERT
SQL query created to alert
Type of query : Time series
Query:
select $__time(created_at), error_code as "metric", count(*) as "Error Value"
from error_table
where $__timeFilter(created_at)
and error_status = 'CRITICAL'
group by created_at,error_code
Duration : now-5m to now
What are you trying to achieve? Alert generated if the error created in the table is of Status "CRITICAL"
How are you trying to achieve it? Configuring a sql based alert on POstgres database.
What happened? Alert gets generated correctly in case of record found in the time span of 5 minutes. If sql query returns no result then alerts fails with error "Failed to evaluate queries and expressions: failed to execute conditions: input data must be a wide series but got type long (input refid)"
What did you expect to happen? NoData alerts generated in case sql query does not return result.
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were. Failed to evaluate queries and expressions: failed to execute conditions: input data must be a wide series but got type long (input refid)
@vineetalagh I’ve opened an issue in github on your behalf for this issue. It could be helpful to share the query response from query inspector in that issue.