Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Macros do not work in alerts #361

Closed
briantopping opened this issue Jul 21, 2021 · 5 comments · Fixed by #375
Closed

Macros do not work in alerts #361

briantopping opened this issue Jul 21, 2021 · 5 comments · Fixed by #375
Milestone

Comments

@briantopping
Copy link

Bug Report

Queries using $__ macros that work fine in the UI fail to work as alerts.

Expected Behavior

We have a query that uses $__timeFilter(COLUMN) to constrain a query from terabytes of data down to just the data that is important for the query. It works as expected. When we set an alert with bounds on this query, the query fails because the $__timeFilter() is processed in the frontend (ie here), not the backend.

Steps to Reproduce the Problem

  1. Create a query with any of the above macros
  2. Set an alert on that query

Notes

If there is a workaround to this, would love to discover it. One is obviously to manually expand the macro in every query. It does seem that the alerting UI should at least warn that there are components of the selected query that will not work as an alert.

@harishkashyap569
Copy link

harishkashyap569 commented Sep 17, 2021

I’m on the same boat as well! Looking for a solution or workaround.

@ofir5300
Copy link
Collaborator

Hi @briantopping,
Please go to relevant alert, click on test rule and approve that the error you get is Illegal input character "$" at..... ?

@briantopping
Copy link
Author

Hi @ofir5300, thanks for looking at this. That is the correct error.

@ofir5300
Copy link
Collaborator

@briantopping Fixed and merged to master.

Note that if you are running our plugin locally on a Mac machine, you can use it starting now.
Simply adjust plugin source to use local repository (bigquery-grafana/dist includes the updated mac binary file),
And of course allow_loading_unsigned_plugins.
Please let me know if you need more detailed instructions about how to use it locally.

Will be added to version 2.0.3 hopefully soon and then will be useful for everyone.

@briantopping
Copy link
Author

That's great, thank you! I will pass along that a release is forthcoming. A lot of folks are eagerly awaiting. Thanks again for your efforts to resolve this!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants