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

rawQuery passed to backend part with $template_variable #334

Closed
Slach opened this issue Apr 14, 2021 · 1 comment · Fixed by #338
Closed

rawQuery passed to backend part with $template_variable #334

Slach opened this issue Apr 14, 2021 · 1 comment · Fixed by #338
Assignees

Comments

@Slach
Copy link
Collaborator

Slach commented Apr 14, 2021

maybe it happens cause grafana start before clickhouse and can't parse template variable values when clickhouse shutdown

@Slach Slach self-assigned this Apr 14, 2021
@Slach
Copy link
Collaborator Author

Slach commented Apr 23, 2021

Unfortunately, grafana generally currently doesn't support template variables for alerting queries.
Also, grafana UI doesn't pass template variables values to a backend, after you change it on frontend UI.

So, the clickhouse grafana plugin can use template variables values, because we have "Generated SQL" which pass to backend "as is"
To ensure template variables values will properly pass to a backend part of the plugin.
Please choose the required template variables values for your alerts in UI dropdown,
ensure values properly rendered in "Generated SQL" (maybe need change SQL query in query editor)
and save a whole dashboard to the Grafana server

WARNING: Test alert button doesn't save a current state of alert rules to a backend part of the plugin.

If "Generated SQL" passed properly into backend part of plugin. You will see something like this
Graph panel with alerts

You also can try to troubleshoot alerts in clickhouse grafana plugin when enable level=debug in log section grafana.ini or via GF_LOG_LEVEL=debug environment variable.

Slach added a commit to Altinity/grafana-plugin-repository that referenced this issue Apr 23, 2021
## Breaking changes

* On latest Grafana 7.x releases, template variables SQL queries shall return only scalar types of values, see Altinity/clickhouse-grafana#328

## Enhancement:

* add support Apple M1 ;)
* switch to new grafana plugin Golang SDK, thanks to @bmanth60 and @valeriakononenko for help
* add BasicAuth support for alerts, see Altinity/clickhouse-grafana#267

## Fixes:

* fix github actions backend build
* fix UNION ALL parsing, see Altinity/clickhouse-grafana#319
* fix many issues with alerting
  * Altinity/clickhouse-grafana#305
  * Altinity/clickhouse-grafana#327
  * Altinity/clickhouse-grafana#334
  * Altinity/clickhouse-grafana#335

Signed-off-by: Eugene Klimov <[email protected]>
daniellee pushed a commit to grafana/grafana-plugin-repository that referenced this issue Jun 2, 2021
## Breaking changes

* On latest Grafana 7.x releases, template variables SQL queries shall return only scalar types of values, see Altinity/clickhouse-grafana#328

## Enhancement:

* add support Apple M1 ;)
* switch to new grafana plugin Golang SDK, thanks to @bmanth60 and @valeriakononenko for help
* add BasicAuth support for alerts, see Altinity/clickhouse-grafana#267

## Fixes:

* fix github actions backend build
* fix UNION ALL parsing, see Altinity/clickhouse-grafana#319
* fix many issues with alerting
  * Altinity/clickhouse-grafana#305
  * Altinity/clickhouse-grafana#327
  * Altinity/clickhouse-grafana#334
  * Altinity/clickhouse-grafana#335

Signed-off-by: Eugene Klimov <[email protected]>
natoscott pushed a commit to natoscott/grafana-plugin-repository that referenced this issue Jul 12, 2021
## Breaking changes

* On latest Grafana 7.x releases, template variables SQL queries shall return only scalar types of values, see Altinity/clickhouse-grafana#328

## Enhancement:

* add support Apple M1 ;)
* switch to new grafana plugin Golang SDK, thanks to @bmanth60 and @valeriakononenko for help
* add BasicAuth support for alerts, see Altinity/clickhouse-grafana#267

## Fixes:

* fix github actions backend build
* fix UNION ALL parsing, see Altinity/clickhouse-grafana#319
* fix many issues with alerting
  * Altinity/clickhouse-grafana#305
  * Altinity/clickhouse-grafana#327
  * Altinity/clickhouse-grafana#334
  * Altinity/clickhouse-grafana#335

Signed-off-by: Eugene Klimov <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant