-
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 #702 from Altinity/issue-642-test
test annotations support
- Loading branch information
Showing
6 changed files
with
421 additions
and
0 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
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,323 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": { | ||
"type": "grafana", | ||
"uid": "-- Grafana --" | ||
}, | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"type": "dashboard" | ||
}, | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"enable": true, | ||
"filter": { | ||
"exclude": false, | ||
"ids": [ | ||
2 | ||
] | ||
}, | ||
"hide": false, | ||
"iconColor": "red", | ||
"name": "annotation_2", | ||
"target": { | ||
"adHocFilters": [], | ||
"adHocValuesQuery": "", | ||
"add_metadata": true, | ||
"contextWindowSize": "10", | ||
"editorMode": "builder", | ||
"extrapolate": true, | ||
"format": "ANNOTATION", | ||
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | ||
"interval": "", | ||
"intervalFactor": 1, | ||
"query": "SELECT \n toUInt64(event_time) * 1000 AS time,\n (toUInt64(event_time) + (random % 600)) * 1000 AS time_end,\n if(random % 2 = 1, '[alert] title', '[annotation] title') AS title,\n if(random % 2 = 1, '[alert] description', '[annotation] description') AS text,\n arrayStringConcat(['test1', 'test2', service_name],',') AS tags\nFROM default.test_grafana_random\nWHERE\n random % 100 IN (1,50) AND\n toUInt64(event_time) >= $from AND toUInt64(event_time) < $to", | ||
"rawQuery": "/* grafana dashboard=Annotation event_time, user=1 */\nSELECT \n toUInt64(event_time) * 1000 AS time,\n (toUInt64(event_time ) + (random % 600)) * 1000 AS time_end,\n if(random % 2 = 1, '[alert] title', '[annotation] title') AS title,\n if(random % 2 = 1, '[alert] description', '[annotation] description') AS text,\n arrayStringConcat(['test1', 'test2', service_name],',') AS tags\nFROM default.test_grafana_random\nWHERE\n random % 100 IN (1,50) AND\n toUInt64(event_time) >= 1735290823 AND toUInt64(event_time) < 1735312423", | ||
"refId": "Anno", | ||
"round": "0s", | ||
"skip_comments": true, | ||
"useWindowFuncForMacros": true | ||
} | ||
}, | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"enable": true, | ||
"filter": { | ||
"exclude": false, | ||
"ids": [ | ||
1 | ||
] | ||
}, | ||
"hide": false, | ||
"iconColor": "red", | ||
"name": "annotation_1", | ||
"target": { | ||
"adHocFilters": [], | ||
"adHocValuesQuery": "", | ||
"add_metadata": true, | ||
"contextWindowSize": "10", | ||
"editorMode": "builder", | ||
"extrapolate": true, | ||
"format": "ANNOTATION", | ||
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | ||
"interval": "", | ||
"intervalFactor": 1, | ||
"query": "SELECT \n event_time AS time,\n event_time + INTERVAL (random % 600) SECONDS AS time_end,\n if(random % 2 = 1, '[alert] title', '[annotation] title') AS title,\n if(random % 2 = 1, '[alert] description', '[annotation] description') AS text,\n arrayStringConcat(['test1', 'test2', service_name],',') AS tags\nFROM default.test_grafana_random\nWHERE\n random % 100 IN (1,50) AND\n toUInt64(event_time) >= $from AND toUInt64(event_time) < $to", | ||
"rawQuery": "/* grafana dashboard=Annotation event_time, user=1 */\nSELECT \n event_time AS time,\n event_time + INTERVAL (random % 600) SECONDS AS time_end,\n if(random % 2 = 1, '[alert] title', '[annotation] title') AS title,\n if(random % 2 = 1, '[alert] description', '[annotation] description') AS text,\n arrayStringConcat(['test1', 'test2', service_name],',') AS tags\nFROM default.test_grafana_random\nWHERE\n random % 100 IN (1,50) AND\n toUInt64(event_time) >= 1735287755 AND toUInt64(event_time) < 1735309355", | ||
"refId": "Anno", | ||
"round": "0s", | ||
"skip_comments": true, | ||
"useWindowFuncForMacros": true | ||
} | ||
} | ||
] | ||
}, | ||
"editable": true, | ||
"fiscalYearStartMonth": 0, | ||
"graphTooltip": 0, | ||
"id": 15, | ||
"links": [], | ||
"panels": [ | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "palette-classic" | ||
}, | ||
"custom": { | ||
"axisBorderShow": false, | ||
"axisCenteredZero": false, | ||
"axisColorMode": "text", | ||
"axisLabel": "", | ||
"axisPlacement": "auto", | ||
"barAlignment": 0, | ||
"barWidthFactor": 0.6, | ||
"drawStyle": "line", | ||
"fillOpacity": 0, | ||
"gradientMode": "none", | ||
"hideFrom": { | ||
"legend": false, | ||
"tooltip": false, | ||
"viz": false | ||
}, | ||
"insertNulls": false, | ||
"lineInterpolation": "linear", | ||
"lineWidth": 1, | ||
"pointSize": 5, | ||
"scaleDistribution": { | ||
"type": "linear" | ||
}, | ||
"showPoints": "auto", | ||
"spanNulls": false, | ||
"stacking": { | ||
"group": "A", | ||
"mode": "none" | ||
}, | ||
"thresholdsStyle": { | ||
"mode": "off" | ||
} | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
}, | ||
{ | ||
"color": "red", | ||
"value": 80 | ||
} | ||
] | ||
} | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 8, | ||
"w": 12, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 1, | ||
"options": { | ||
"legend": { | ||
"calcs": [], | ||
"displayMode": "list", | ||
"placement": "bottom", | ||
"showLegend": true | ||
}, | ||
"tooltip": { | ||
"mode": "single", | ||
"sort": "none" | ||
} | ||
}, | ||
"pluginVersion": "11.4.0", | ||
"targets": [ | ||
{ | ||
"adHocFilters": [], | ||
"adHocValuesQuery": "", | ||
"add_metadata": true, | ||
"contextWindowSize": "10", | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"editorMode": "builder", | ||
"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": "select now(), 1", | ||
"rawQuery": "/* grafana dashboard=Annotation event_time, user=1 */\nselect now(), 1", | ||
"refId": "A", | ||
"round": "0s", | ||
"skip_comments": true, | ||
"useWindowFuncForMacros": true | ||
} | ||
], | ||
"title": "event_time", | ||
"type": "timeseries" | ||
}, | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "palette-classic" | ||
}, | ||
"custom": { | ||
"axisBorderShow": false, | ||
"axisCenteredZero": false, | ||
"axisColorMode": "text", | ||
"axisLabel": "", | ||
"axisPlacement": "auto", | ||
"barAlignment": 0, | ||
"barWidthFactor": 0.6, | ||
"drawStyle": "line", | ||
"fillOpacity": 0, | ||
"gradientMode": "none", | ||
"hideFrom": { | ||
"legend": false, | ||
"tooltip": false, | ||
"viz": false | ||
}, | ||
"insertNulls": false, | ||
"lineInterpolation": "linear", | ||
"lineWidth": 1, | ||
"pointSize": 5, | ||
"scaleDistribution": { | ||
"type": "linear" | ||
}, | ||
"showPoints": "auto", | ||
"spanNulls": false, | ||
"stacking": { | ||
"group": "A", | ||
"mode": "none" | ||
}, | ||
"thresholdsStyle": { | ||
"mode": "off" | ||
} | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
}, | ||
{ | ||
"color": "red", | ||
"value": 80 | ||
} | ||
] | ||
} | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 8, | ||
"w": 12, | ||
"x": 12, | ||
"y": 0 | ||
}, | ||
"id": 2, | ||
"options": { | ||
"legend": { | ||
"calcs": [], | ||
"displayMode": "list", | ||
"placement": "bottom", | ||
"showLegend": true | ||
}, | ||
"tooltip": { | ||
"mode": "single", | ||
"sort": "none" | ||
} | ||
}, | ||
"pluginVersion": "11.4.0", | ||
"targets": [ | ||
{ | ||
"adHocFilters": [], | ||
"adHocValuesQuery": "", | ||
"add_metadata": true, | ||
"contextWindowSize": "10", | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"editorMode": "builder", | ||
"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": "select now(), 1", | ||
"rawQuery": "/* grafana dashboard=Annotation event_time, user=1 */\nselect now(), 1", | ||
"refId": "A", | ||
"round": "0s", | ||
"skip_comments": true, | ||
"useWindowFuncForMacros": true | ||
} | ||
], | ||
"title": "toUInt64", | ||
"type": "timeseries" | ||
} | ||
], | ||
"preload": false, | ||
"schemaVersion": 40, | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-6h", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "browser", | ||
"title": "Annotation event_time", | ||
"uid": "be86tq72ew3k0d", | ||
"version": 1, | ||
"weekStart": "" | ||
} |
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.