-
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.
Add support for the float timestamps
- Loading branch information
1 parent
aa7cb45
commit f905351
Showing
11 changed files
with
610 additions
and
14 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
307 changes: 307 additions & 0 deletions
307
docker/grafana/dashboards/float_timestamps_support_issue_626.json
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,307 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": { | ||
"type": "grafana", | ||
"uid": "-- Grafana --" | ||
}, | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"target": { | ||
"limit": 100, | ||
"matchAny": false, | ||
"tags": [], | ||
"type": "dashboard" | ||
}, | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"editable": true, | ||
"fiscalYearStartMonth": 0, | ||
"graphTooltip": 0, | ||
"id": 13, | ||
"links": [], | ||
"panels": [ | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"description": "Float timestamps without MS https://github.com/Altinity/clickhouse-grafana/issues/626", | ||
"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": 9, | ||
"w": 12, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 2, | ||
"options": { | ||
"legend": { | ||
"calcs": [], | ||
"displayMode": "list", | ||
"placement": "bottom", | ||
"showLegend": true | ||
}, | ||
"tooltip": { | ||
"mode": "single", | ||
"sort": "none" | ||
} | ||
}, | ||
"pluginVersion": "11.3.0+security-01", | ||
"targets": [ | ||
{ | ||
"adHocFilters": [], | ||
"add_metadata": true, | ||
"contextWindowSize": 10, | ||
"database": "default", | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"dateColDataType": "", | ||
"dateLoading": false, | ||
"dateTimeColDataType": "tFloat", | ||
"dateTimeType": "FLOAT", | ||
"datetimeLoading": false, | ||
"editorMode": "sql", | ||
"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\n $timeSeries as t,\n count()\nFROM $table\n\nWHERE $timeFilter\nGROUP BY t\n\nORDER BY t", | ||
"rawQuery": "/* grafana dashboard=Float timestamps issue 626, user=0 */\nSELECT\n round(too_big_value * 1000) as t,\n count()\nFROM default.test_timestamp_formats\n\nWHERE too_big_value >= 1732444676 AND too_big_value <= 1732445576\nGROUP BY t\n\nORDER BY t", | ||
"refId": "A", | ||
"round": "0s", | ||
"showFormattedSQL": true, | ||
"skip_comments": true, | ||
"table": "test_timestamp_formats", | ||
"tableLoading": false | ||
} | ||
], | ||
"title": "Float Timestamps", | ||
"type": "timeseries" | ||
}, | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"description": "Float timestamps https://github.com/Altinity/clickhouse-grafana/issues/626", | ||
"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": 9, | ||
"w": 12, | ||
"x": 12, | ||
"y": 0 | ||
}, | ||
"id": 3, | ||
"options": { | ||
"legend": { | ||
"calcs": [], | ||
"displayMode": "list", | ||
"placement": "bottom", | ||
"showLegend": true | ||
}, | ||
"tooltip": { | ||
"mode": "single", | ||
"sort": "none" | ||
} | ||
}, | ||
"pluginVersion": "11.3.0+security-01", | ||
"targets": [ | ||
{ | ||
"adHocFilters": [], | ||
"add_metadata": true, | ||
"contextWindowSize": 10, | ||
"database": "default", | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"dateColDataType": "", | ||
"dateLoading": false, | ||
"dateTimeColDataType": "tFloat", | ||
"dateTimeType": "FLOAT", | ||
"datetimeLoading": false, | ||
"editorMode": "sql", | ||
"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\n $timeSeriesMs as t,\n count()\nFROM $table\n\nWHERE $timeFilterMs\nGROUP BY t\n\nORDER BY t\n\n", | ||
"rawQuery": "/* grafana dashboard=Float timestamps issue 626, user=0 */\nSELECT\n (intDiv(tFloat * 1000, 1000) * 1000) as t,\n count()\nFROM default.test_timestamp_formats\n\nWHERE tFloat >= toFloat64(1732444676627/1000) AND tFloat <= toFloat64(1732445576627/1000)\nGROUP BY t\n\nORDER BY t", | ||
"refId": "A", | ||
"round": "0s", | ||
"showFormattedSQL": true, | ||
"skip_comments": true, | ||
"table": "test_timestamp_formats", | ||
"tableLoading": false | ||
} | ||
], | ||
"title": "Float Timestamps with MS", | ||
"type": "timeseries" | ||
} | ||
], | ||
"preload": false, | ||
"refresh": "", | ||
"schemaVersion": 40, | ||
"tags": [], | ||
"templating": { | ||
"list": [ | ||
{ | ||
"baseFilters": [], | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"filters": [], | ||
"name": "adhoc_variable", | ||
"type": "adhoc" | ||
}, | ||
{ | ||
"current": { | ||
"text": "service_name", | ||
"value": "service_name" | ||
}, | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"definition": "SELECT name FROM system.columns WHERE database='default' AND table='test_grafana' AND type ILIKE '%String%'", | ||
"includeAll": false, | ||
"name": "split", | ||
"options": [], | ||
"query": "SELECT name FROM system.columns WHERE database='default' AND table='test_grafana' AND type ILIKE '%String%'", | ||
"refresh": 1, | ||
"regex": "", | ||
"type": "query" | ||
} | ||
] | ||
}, | ||
"time": { | ||
"from": "now-30m", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "", | ||
"title": "Float timestamps issue 626", | ||
"uid": "de4e7cr8tkdtse", | ||
"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
Oops, something went wrong.