Skip to content

Commit

Permalink
Merge pull request #339 from Altinity/fix_github_issues
Browse files Browse the repository at this point in the history
release 2.3.1
  • Loading branch information
Slach authored Apr 23, 2021
2 parents 3b4e6fc + ab60245 commit 7449aac
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bumpversion]
commit = True
tag = True
current_version = 2.2.3
current_version = 2.3.1

[bumpversion:file:package.json]

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ jobs:

- name: Build backend
run: |
GOOS=linux GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_linux_amd64 . && \
GOOS=linux GOARCH=arm64 go build -o ./dist/vertamedia-clickhouse-plugin_linux_arm64 . && \
GOOS=windows GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_windows_amd64.exe . && \
GOOS=darwin GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_darwin_amd64 . && \
# GOOS=darwin GOARCH=arm64 go build -o ./dist/vertamedia-clickhouse-plugin_darwin_arm64 . && \
GOOS=linux GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_linux_amd64 ./pkg/ && \
GOOS=linux GOARCH=arm64 go build -o ./dist/vertamedia-clickhouse-plugin_linux_arm64 ./pkg/ && \
GOOS=windows GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_windows_amd64.exe ./pkg/ && \
GOOS=darwin GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_darwin_amd64 ./pkg/ && \
# GOOS=darwin GOARCH=arm64 go build -o ./dist/vertamedia-clickhouse-plugin_darwin_arm64 ./pkg/ && \
chmod +x ./dist/vertamedia-clickhouse-plugin*
- name: Sign plugin
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# 2.3.1 (2021-04-23)
## Breaking changes

* On latest Grafana 7.x releases, template variables SQL queries shall return only scalar types of values, see https://github.com/Vertamedia/clickhouse-grafana/issues/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 https://github.com/Vertamedia/clickhouse-grafana/issues/267

## Fixes:

* fix github actions backend build
* fix UNION ALL parsing, see https://github.com/Vertamedia/clickhouse-grafana/issues/319
* fix many issues with alerting
* https://github.com/Vertamedia/clickhouse-grafana/issues/305
* https://github.com/Vertamedia/clickhouse-grafana/issues/327
* https://github.com/Vertamedia/clickhouse-grafana/issues/334
* https://github.com/Vertamedia/clickhouse-grafana/issues/335




# 2.2.3 (2021-02-17)
## Enhancement:

Expand Down
86 changes: 43 additions & 43 deletions dist/MANIFEST.txt
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
{
"manifestVersion": "2.0.0",
"signatureType": "community",
"signedByOrg": "vertamedia",
"signedByOrgName": "Vertamedia",
"plugin": "vertamedia-clickhouse-datasource",
"version": "2.2.3",
"time": 1619170902087,
"keyId": "7e4d0c6a708866e7",
"files": {
"img/annotations.png": "09cc19df992fede5c4dd830f7b3c7a783702feced07ea9693d417ec127077b00",
"img/clickhouse_logo.svg": "111c2048c9bad4a11b0273cf17839696d98968c04cdcc5ea0716bdc973f2e8e4",
"img/datasource.png": "8d6dcdddfad512abed8c251404f652383f63ad17bc5c7cbe3e67ad9e6fa0327f",
"img/query_editor.png": "b8d50f644d413b15aaf0d7b71fdfa4423f1a045761ec368b19a15e3d1aaf9308",
"LICENSE": "a434fc6dd97d5c425c6edbeff0276afd60ab5fffab3ed2c563f95a389502d074",
"module.js": "2f108de0e21552eb218118845d22b2299f43c455eb9946b08b7c646e018525bd",
"module.js.map": "9295c65985531b262e9ddada9f0b2622470e71b2eb9df7f77f11e169277d27ca",
"partials/annotations.editor.html": "14d2d5add7f13c7c722e33bbc53ef83750fb624e5f7d6efee4a9568addc2ab78",
"partials/config.html": "51ba130304c63c1a00590a9dc94c8351ff6277e4cf695720de57bff87aeec744",
"partials/query.editor.html": "eb9ab7af412a922ea2ce09c86b99a75ba70000977a5fd882b8e327a2a27e1904",
"plugin.json": "7e322a287a2bd93abde0a5f02aeb64b7e00d14f3f65a011f39036c572981e812",
"README.md": "3194fcabb4b7ea1666d2d805a633555afbbe8f45e1e6cd73e3c21d0456cd5f46",
"vertamedia-clickhouse-plugin_darwin_amd64": "a8ae79471d47035aca70cf665d089aa223e2626795690d9028fc96c4af22d3fc",
"vertamedia-clickhouse-plugin_darwin_arm64": "9b73d1c63c964f680b31b44419e68acafb384366145d5e1336c12b0ad0c69299",
"vertamedia-clickhouse-plugin_linux_amd64": "832d80be856d15956ab6738423dac4874c4f9e3d14fb84d90d5602e2f27d7cc0",
"vertamedia-clickhouse-plugin_linux_arm64": "04966495be291fa68990d4396efdafb545cbb4b19b9e5063d513a466f600730c",
"vertamedia-clickhouse-plugin_windows_amd64.exe": "063a0b9c6755ede52790bc5c7e664b03cee02419c32ecb73a47178f9d16917d2"
}
}
-----BEGIN PGP SIGNATURE-----
Version: OpenPGP.js v4.10.1
Comment: https://openpgpjs.org
wqIEARMKAAYFAmCCllYACgkQfk0ManCIZudwIgIJASMZzi2TWJ+Shkdx+5zE
gsbGfSJ+TLnjOl2cr7VgzEPNCaMGFIr5BrjeNdnfuTAlRnHNIIICw/1t5Ing
XezVGdFXAgkB72Yck5CKnJSHPUNB6yVc/gJbyVaDLF39yY+KDciftouNXRLO
ZesrJhq88klhAwEgW8CZqffGEQrwUtTrWI5pM3k=
=C/jd
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

{
"manifestVersion": "2.0.0",
"signatureType": "community",
"signedByOrg": "vertamedia",
"signedByOrgName": "Vertamedia",
"plugin": "vertamedia-clickhouse-datasource",
"version": "2.3.1",
"time": 1619185695268,
"keyId": "7e4d0c6a708866e7",
"files": {
"img/annotations.png": "09cc19df992fede5c4dd830f7b3c7a783702feced07ea9693d417ec127077b00",
"img/clickhouse_logo.svg": "111c2048c9bad4a11b0273cf17839696d98968c04cdcc5ea0716bdc973f2e8e4",
"img/datasource.png": "8d6dcdddfad512abed8c251404f652383f63ad17bc5c7cbe3e67ad9e6fa0327f",
"img/query_editor.png": "b8d50f644d413b15aaf0d7b71fdfa4423f1a045761ec368b19a15e3d1aaf9308",
"LICENSE": "a434fc6dd97d5c425c6edbeff0276afd60ab5fffab3ed2c563f95a389502d074",
"module.js": "2f108de0e21552eb218118845d22b2299f43c455eb9946b08b7c646e018525bd",
"module.js.map": "9295c65985531b262e9ddada9f0b2622470e71b2eb9df7f77f11e169277d27ca",
"partials/annotations.editor.html": "14d2d5add7f13c7c722e33bbc53ef83750fb624e5f7d6efee4a9568addc2ab78",
"partials/config.html": "51ba130304c63c1a00590a9dc94c8351ff6277e4cf695720de57bff87aeec744",
"partials/query.editor.html": "eb9ab7af412a922ea2ce09c86b99a75ba70000977a5fd882b8e327a2a27e1904",
"plugin.json": "1f89afc413d2237dc53ce3818b8a90eb20b14c3d25e04736143ea5f558060c02",
"README.md": "4d15621e239ba32ddb0f6743e74abdac71819fb24aca22d5370a5121d0d27d6a",
"vertamedia-clickhouse-plugin_darwin_amd64": "5c07673faa32b561d4b72da749d497e4c55cdcce4fee708f5e880b1a5ac51093",
"vertamedia-clickhouse-plugin_darwin_arm64": "f936e418c9aa0d9c95ee9aaec5c6ff74d4b9e6f8824bd724c9642e2d61ecb174",
"vertamedia-clickhouse-plugin_linux_amd64": "82de94bcf60aef49023ef0650298a310dab49f6be30704471e773086fc63e23b",
"vertamedia-clickhouse-plugin_linux_arm64": "081844c5463332a8e1fa3062fcafaa22276088f76be45e42c1056eb37f9c7fb5",
"vertamedia-clickhouse-plugin_windows_amd64.exe": "12f0db0c68fb42bb66b2c39a9c357e379196a265a75c6448f88ba1d8d108d019"
}
}
-----BEGIN PGP SIGNATURE-----
Version: OpenPGP.js v4.10.1
Comment: https://openpgpjs.org

wqIEARMKAAYFAmCC0B8ACgkQfk0ManCIZufDQAIJAdx51OelDKvFVtrsLIbe
klFH50iBiRZCVFzOmYyhiSCUEOJVZOFBp/5fxRsCEnN6uji1PsUt0V2V2cnj
O0fPhXpsAgkBRL1ZRgwbnf6+9zyAalXyHtNxJWksA7oHXTebouMz+hlEP/91
wUcybOh1ufxkiPyyzCIChFzwsiQzD5RMldfFWGs=
=WPBD
-----END PGP SIGNATURE-----
48 changes: 38 additions & 10 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ Restart Grafana, check data sources list at http://your.grafana.instance/datasou
* SingleStat view
* Ad-hoc filters
* Annotations
* Alerts support


### Access to CH via HTTP
### Access to CH via HTTP / HTTPS
Page configuration is standard

![settings](https://cloud.githubusercontent.com/assets/2902918/25473216/3ebd20fc-2b37-11e7-9743-fbbf2c5bdd3f.png)
Expand Down Expand Up @@ -93,7 +94,7 @@ Raw Editor allows custom SQL queries to be written:
Raw Editor allows typing queries, get info about functions and macros, format queries as Clickhouse do.
Under the Editor you can find a raw query (all macros and functions have already been replaced) which will be sent directly to ClickHouse.

### Macros
### Macros support

Plugin supports the following marcos:

Expand Down Expand Up @@ -333,7 +334,7 @@ SELECT hostname FROM host WHERE region IN ($region)

### Conditional Predicate

If you are using templating to feed your predicate, you will face performance degradation when everything will select as the predicate, and it's not necessary. It's also true for textbox when nothing is enter, you have to write specific sql code to handle that.
If you are using templating to feed your predicate, you will face performance degradation when everything will select as the predicate, and it's not necessary. It's also true for textbox when nothing is entered, you have to write specific sql code to handle that.

To workaround this issue a new macro $conditionalTest(SQL Predicate,$variable) can be used to remove some part of the query.
If the variable is type query with all selected or if the variable is a textbox with nothing enter, then the SQL Predicate is not include in the generated query.
Expand Down Expand Up @@ -415,7 +416,7 @@ ORDER BY Reqs
LIMIT 5,10000000000000 /* select some ridiculous number after first 5 */
```

#### Table (https://grafana.com/plugins/table)
#### Table view (https://grafana.com/plugins/table)

There are don't contain any tricks in displaying time-series data. To print summary data, omit time column, and format the result as "Table".
Expand Down Expand Up @@ -509,13 +510,40 @@ SELECT database, table, name, type FROM system.columns WHERE table='myTable' ORD
That should help to control data fetching by ad-hoc queries.
### Query variables
### Template variable values via Query
To use time range dependent macros like `$from` and `$to` in your query the refresh mode of the template variable needs to be set to On Time Range Change.
```
SELECT ClientID FROM events WHERE EventTime > toDateTime($from) AND EventTime < toDateTime($to)
```
### Annotations
Plugin support Annotations with regions. To enable this feature open Dashboard `settings` and add new annotation query with `clickhouse` datasource with properly field names.
![Annotation query example](https://user-images.githubusercontent.com/105560/115864672-a35c3480-a450-11eb-88f4-1103a00c6563.png)
![Annotation with regions graph panel](https://user-images.githubusercontent.com/105560/115865059-3d23e180-a451-11eb-91ce-1159aef29541.png)
### Alerts support
To enable alerts open "alerts" tab in panel, and define alert expression as described on [grafana.com](https://grafana.com/docs/grafana/latest/alerting/create-alerts/)
Be careful with Template variables values, currently grafana doesn't support template variables in alert queries itself.
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 queries 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 the "Generated SQL" properly passed into backend part of plugin, you will see something like this:
![Graph panel with alerts](https://user-images.githubusercontent.com/105560/115866047-95a7ae80-a452-11eb-9dd0-8e85b89e99ec.png)
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.
### Configure the Datasource with Provisioning
It’s now possible to configure datasources using config files with Grafana’s provisioning system.
Expand Down Expand Up @@ -596,11 +624,12 @@ PARTITION BY toYYYYMM(EventDate);

> What about alerts support?
Alerts feature requires changes in `Grafana`'s backend, which can be extended only for Grafana 6.5+. `Grafana`'s maintainers are working on this feature.
Current alerts support for `clickhouse-grafana` datasource plugin in beta and support only for amd64 architecture for Linux, MacOSX, Windows.
Alerts feature requires changes in `Grafana`'s backend, which can be extended only for Grafana 6.5+. `Grafana`'s maintainers are working on this feature.
Current alerts support for `clickhouse-grafana` datasource plugin in beta.

For clickhouse grafana plugin 2.2.3+ support only for amd64 architecture for Linux, macOS, Windows and arm64 Linux, macOS (m1).
Only amd64 prior 2.2.3 version.

The resulting alerts should look like this
![image](https://user-images.githubusercontent.com/5578150/81031711-fd2fad00-8e41-11ea-9b54-5eb4ca1628f1.png)

### Contributing

Expand All @@ -614,4 +643,3 @@ see [CONTRIBUTING.md](https://github.com/Vertamedia/clickhouse-grafana/blob/mast
License
-------
MIT License, please see [LICENSE](https://github.com/Vertamedia/clickhouse-grafana/blob/master/LICENSE) for details.

2 changes: 1 addition & 1 deletion dist/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"url": "https://github.com/Vertamedia/clickhouse-grafana"
}
],
"version": "2.2.3",
"version": "2.3.1",
"updated": "2020-07-31"
},

Expand Down
Binary file modified dist/vertamedia-clickhouse-plugin_darwin_amd64
Binary file not shown.
Binary file modified dist/vertamedia-clickhouse-plugin_darwin_arm64
Binary file not shown.
Binary file modified dist/vertamedia-clickhouse-plugin_linux_amd64
Binary file not shown.
Binary file modified dist/vertamedia-clickhouse-plugin_linux_arm64
Binary file not shown.
Binary file modified dist/vertamedia-clickhouse-plugin_windows_amd64.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vertamedia-clickhouse",
"version": "2.2.3",
"version": "2.3.1",
"description": "ClickHouse datasource for Grafana",
"scripts": {
"build:prod": "webpack --config webpack.config.prod.js",
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"url": "https://github.com/Vertamedia/clickhouse-grafana"
}
],
"version": "2.2.3",
"version": "2.3.1",
"updated": "2020-07-31"
},

Expand Down

0 comments on commit 7449aac

Please sign in to comment.