-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from Altinity/fix_github_issues
fix #319
- Loading branch information
Showing
10 changed files
with
355 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<yandex> | ||
<dictionary> | ||
<name>postgres_dict</name> | ||
<structure> | ||
<key> | ||
<attribute> | ||
<name>service_name</name> | ||
<type>String</type> | ||
</attribute> | ||
</key> | ||
<attribute> | ||
<name>service_type</name> | ||
<type>String</type> | ||
<null_value></null_value> | ||
</attribute> | ||
</structure> | ||
|
||
<source> | ||
<postgresql> | ||
<host>postgres</host> | ||
<port>5432</port> | ||
<user>grafana</user> | ||
<password>grafana</password> | ||
<database>grafana</database> | ||
<table>test_grafana_dict</table> | ||
<replica> | ||
<host>postgres</host> | ||
</replica> | ||
<where>service_name='mysql'</where> | ||
<invalidate_query>SELECT now()</invalidate_query> | ||
</postgresql> | ||
</source> | ||
|
||
<layout> | ||
<complex_key_hashed/> | ||
</layout> | ||
|
||
<lifetime> | ||
<min>10</min> | ||
<max>20</max> | ||
</lifetime> | ||
</dictionary> | ||
</yandex> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": "-- Grafana --", | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"editable": true, | ||
"gnetId": null, | ||
"graphTooltip": 0, | ||
"id": 14, | ||
"links": [], | ||
"panels": [ | ||
{ | ||
"aliasColors": {}, | ||
"bars": false, | ||
"dashLength": 10, | ||
"dashes": false, | ||
"datasource": "clickhouse", | ||
"description": "fix https://github.com/Vertamedia/clickhouse-grafana/issues/319", | ||
"fieldConfig": { | ||
"defaults": { | ||
"custom": {} | ||
}, | ||
"overrides": [] | ||
}, | ||
"fill": 1, | ||
"fillGradient": 0, | ||
"gridPos": { | ||
"h": 9, | ||
"w": 12, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"hiddenSeries": false, | ||
"id": 2, | ||
"legend": { | ||
"avg": false, | ||
"current": false, | ||
"max": false, | ||
"min": false, | ||
"show": true, | ||
"total": false, | ||
"values": false | ||
}, | ||
"lines": true, | ||
"linewidth": 1, | ||
"nullPointMode": "null", | ||
"options": { | ||
"alertThreshold": true | ||
}, | ||
"percentage": false, | ||
"pluginVersion": "7.4.5", | ||
"pointradius": 2, | ||
"points": false, | ||
"renderer": "flot", | ||
"seriesOverrides": [], | ||
"spaceLength": 10, | ||
"stack": false, | ||
"steppedLine": false, | ||
"targets": [ | ||
{ | ||
"database": "default", | ||
"dateColDataType": "", | ||
"dateLoading": false, | ||
"dateTimeColDataType": "event_time", | ||
"dateTimeType": "DATETIME", | ||
"datetimeLoading": false, | ||
"extrapolate": true, | ||
"format": "time_series", | ||
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | ||
"interval": "", | ||
"intervalFactor": 1, | ||
"query": "$columns(\n service_name, \n sum(agg_value) as value\n)\nFROM (\n\n SELECT\n $timeSeries as t,\n service_name,\n sum(too_big_value) as agg_value\n FROM $table\n WHERE $timeFilter\n GROUP BY t,service_name\n \n UNION ALL\n \n WITH (SELECT sum(too_big_value) FROM $table) AS total_value\n SELECT\n $timeSeries as t,\n service_name,\n sum(too_big_value) / total_value as agg_value\n FROM $table\n WHERE $timeFilter\n GROUP BY t,service_name\n)", | ||
"queryType": "randomWalk", | ||
"rawQuery": "SELECT t, groupArray((service_name, value)) AS groupArr FROM ( SELECT (intDiv(toUInt32(event_time), 20) * 20) * 1000 AS t, service_name, sum(agg_value) as value FROM default.test_grafana) AS total_value\n SELECT\n (intDiv(toUInt32(event_time), 20) * 20) * 1000 as t,\n service_name,\n sum(too_big_value) / total_value as agg_value\n FROM default.test_grafana\n WHERE event_time >= toDateTime(1616397355) AND event_time >= toDateTime(1616397355)\n GROUP BY t,service_name\n) GROUP BY t, service_name ORDER BY t, service_name) GROUP BY t ORDER BY t", | ||
"refId": "A", | ||
"round": "0s", | ||
"skip_comments": true, | ||
"table": "test_grafana", | ||
"tableLoading": false | ||
} | ||
], | ||
"thresholds": [], | ||
"timeFrom": null, | ||
"timeRegions": [], | ||
"timeShift": null, | ||
"title": "$columns + union all + with", | ||
"tooltip": { | ||
"shared": true, | ||
"sort": 0, | ||
"value_type": "individual" | ||
}, | ||
"type": "graph", | ||
"xaxis": { | ||
"buckets": null, | ||
"mode": "time", | ||
"name": null, | ||
"show": true, | ||
"values": [] | ||
}, | ||
"yaxes": [ | ||
{ | ||
"format": "short", | ||
"label": null, | ||
"logBase": 1, | ||
"max": null, | ||
"min": null, | ||
"show": true | ||
}, | ||
{ | ||
"format": "short", | ||
"label": null, | ||
"logBase": 1, | ||
"max": null, | ||
"min": null, | ||
"show": true | ||
} | ||
], | ||
"yaxis": { | ||
"align": false, | ||
"alignLevel": null | ||
} | ||
} | ||
], | ||
"schemaVersion": 27, | ||
"style": "dark", | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-6h", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "", | ||
"title": "$columns + union all + with", | ||
"uid": "qcnq8TQMk", | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.