-
Notifications
You must be signed in to change notification settings - Fork 15
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
Query prettifier doesn't work with Grafana variables #166
Comments
@dmitryk-dk I think this involves changes to metricsql Go lib. |
Ok, i will check it |
@hagen1778 the problem there with Grafana variables. I think we should remove them before executing in a prettify function |
Would that help to prettify query afterwards? Would you be able to restore the prettified query back by putting variables in it? |
@hagen1778 i think we should discuss where it is better to handle it. I am not sure that we should handle Grafana variables in the metricsql library |
@hagen1778 I think we can use a static lookbehind window to replace the Grafana variable. Make the query prettier, and then replace the static look behind window with the Grafana variable back. I think this behavior should work well. |
Agree. Do you think it should be handled on front end side? |
Checked the code. So the backend just works as a proxy to data source, and there are no handlers to handle this request, and I think it is not necessary to add this handler to the backend. I think the better place to do it is on the front end. The frontend part can manipulate query string on request and response and show the correct results. |
The fix was included into v0.8.3 release. |
Try putting the following query in panel:
and press Prettify button.
Expected result: query gets prettified
Actual result:
"msg": "cannot recognize \"$__rate_interval]))by(job, group))\"; unparsed data: \"[$__rate_interval]))by(job, group))\""
The text was updated successfully, but these errors were encountered: