Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grafana 8.0.4 alerts does not correctly work (multiple alerts per graph) #362

Closed
IvanTheFirst opened this issue Aug 5, 2021 · 5 comments
Assignees

Comments

@IvanTheFirst
Copy link

IvanTheFirst commented Aug 5, 2021

Hello!
I have grafana 8.0.4 with new alerts and plugin version 2.3.1.
And there are two problems:

  1. I can create alert only from dashboard graph. When I try to create alert from "Alerting" menu i get this error -

Failed to evaluate queries and expressions: failed to execute conditions: failed to query data: Failed to query data: rpc error: code = Unknown desc = unable to parse json {"dateTimeType":"DATETIME","extrapolate":true,"format":"time_series","formattedQuery":"SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t","hide":false,"intervalFactor":1,"intervalMs":1000,"maxDataPoints":43200,"query":"SELECT 1\n","rawQuery":true,"refId":"A","round":"0s","skip_comments":true}. Error: json: cannot unmarshal bool into Go struct field Query.rawQuery of type string

  1. Alert does not contain "labels" and I can't create multiple alerts from one graph like this [Feature request] Multiple alerts per graph grafana/grafana#7832 (comment)

  2. sometimes doubling metrics names in alerts

sample request
SELECT Time, groupArray((instance,value)) as arr FROM (SELECT toDateTime(now() - INTERVAL 60 SECOND) as Time,'cpu1_host1'as instance,20 as value UNION ALL SELECT toDateTime(now() - INTERVAL 120 SECOND) as Time ,'cpu1_host1'as instance,30 as value UNION ALL SELECT toDateTime(now() - INTERVAL 60 SECOND) as Time ,'cpu1_host2'as instance,50 as value UNION ALL SELECT toDateTime(now() - INTERVAL 120 SECOND) as Time ,'cpu1_host2'as instance,40 as value ) GROUP BY Time,instance ORDER BY Time

Is there any way to fix this?
Thank you.

@IvanTheFirst IvanTheFirst changed the title Grafana 8.0.4 alerts does not correctly work Grafana 8.0.4 alerts does not correctly work (multiple alerts per graph) Aug 5, 2021
@Slach Slach self-assigned this Aug 5, 2021
@Slach
Copy link
Collaborator

Slach commented Aug 5, 2021

thanks a lot for reporting
unfortunately I don't have resources to fix it asap, so feel free to create PR

@IvanTheFirst
Copy link
Author

Eugene, I will try :)

@derN3rd
Copy link

derN3rd commented Oct 17, 2021

Any progress so far? In Grafana 8.2 it seems you can't create alerts the old way anymore if you use the new ones, so we can't setup any alerts based on this plugin anymore.
Is there any other known workaround?

@Slach
Copy link
Collaborator

Slach commented Nov 18, 2021

I found the root reason, but unfortunatelly it's not easy to fix. New grafana unified alerts need to implements full sql parser on golang part
please subsribe here to follow progress
#380 (comment)

@derN3rd you can set up grafana alerts in old way
just set the following environment variables

GF_UNIFIED_ALERTING_ENABLED=false
GF_ALERTING_ENABLED=true

@Slach Slach closed this as completed Nov 18, 2021
@derN3rd
Copy link

derN3rd commented Nov 18, 2021

My problem is, that we are dependent on the new alertings, so I sadly can't just disable the new alerts and use the old ones...
Any estimation on when or even if this will be done in the future?

EDIT: Just seen the link for the progress. Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants