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 cause time condition using from / to useless #327

Closed
azsane opened this issue Feb 23, 2021 · 1 comment · Fixed by #333
Closed

RawQuery cause time condition using from / to useless #327

azsane opened this issue Feb 23, 2021 · 1 comment · Fixed by #333
Assignees

Comments

@azsane
Copy link

azsane commented Feb 23, 2021

When using alert with clickhouse-grafana , time was immutable when using from / to as #305 metioned

After digging into source code for both grafana & clickhouse-grafana
I found it was a problem with rawQuery

Everytime you edit the panel query then save, a rawQuery field in panel.targets and also in alertRuleTags.query was generated
rawQuery was transformed in sql_query.ts, the logic replaced all paramters to determine value
So rawQuery will hold the variable value when dashboard was saved

It's no problem when viewing dashboard in browser,but in alerting,things changed
Alerting loads rule from database,then sends to clickhouse-grafana plugin
the transform logic has no change to trigger,Then cause the from / to unchanged problem

Suggest move the logic from sql_query.ts to datasource.go,and use formattedQuery as query template

@Slach
Copy link
Collaborator

Slach commented Feb 23, 2021

@azsane thanks a lot for the suggestions it really helpful

@Slach Slach self-assigned this Feb 23, 2021
@Slach Slach closed this as completed in #333 Apr 6, 2021
Slach added a commit that referenced this issue Apr 6, 2021
The issue with array in variables on grafana side is reproducible
close #328

partial fix for alerts for use case when query evaluates on server-side each time with same time range,
close #327
close #305
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 <eklimov@altinity.com>
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 <eklimov@altinity.com>
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 <eklimov@altinity.com>
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.

2 participants