diff --git a/dashboards/Logs + Structured via Query.json b/dashboards/Logs + Structured via Query.json index 8479a28..e011654 100644 --- a/dashboards/Logs + Structured via Query.json +++ b/dashboards/Logs + Structured via Query.json @@ -18,7 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 3, + "id": 1, "links": [], "liveNow": false, "panels": [ @@ -38,7 +38,7 @@ { "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, "description": "", "fieldConfig": { @@ -47,6 +47,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "series", "axisLabel": "", @@ -156,6 +157,22 @@ "operator": "LIKE", "type": "String", "value": "$filter1" + }, + { + "condition": "AND", + "filterType": "custom", + "key": "message", + "operator": "LIKE", + "type": "String", + "value": "$filter2" + }, + { + "condition": "AND", + "filterType": "custom", + "key": "message", + "operator": "LIKE", + "type": "String", + "value": "$filter3" } ], "limit": 5000, @@ -174,10 +191,10 @@ }, "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, "queryType": "builder", - "rawSql": "SELECT $__timeInterval(logdatetime) as time, count() FROM \"default\".\"log_docker_raw\" WHERE $__timeFilter(logdatetime) AND ( logdatetime >= $__fromTime AND logdatetime <= $__toTime ) AND ( program = ${program:singlequote} ) AND ( message LIKE '%$filter1%' ) GROUP BY time ORDER BY time ASC LIMIT 5000", + "rawSql": "SELECT $__timeInterval(logdatetime) as time, count() FROM \"default\".\"log_docker_raw\" WHERE $__timeFilter(logdatetime) AND ( logdatetime >= $__fromTime AND logdatetime <= $__toTime ) AND ( program = ${program:singlequote} ) AND ( message LIKE '%$filter1%' ) AND ( message LIKE '%$filter2%' ) AND ( message LIKE '%$filter3%' ) GROUP BY time ORDER BY time ASC LIMIT 5000", "refId": "A" } ], @@ -187,14 +204,16 @@ { "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "fixedColor": "red", + "mode": "fixed" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -229,13 +248,9 @@ "thresholds": { "mode": "absolute", "steps": [ - { - "color": "green", - "value": null - }, { "color": "red", - "value": 80 + "value": null } ] } @@ -311,11 +326,61 @@ }, "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, - "queryType": "builder", - "rawSql": "SELECT $__timeInterval(logdatetime) as time FROM \"default\".\"log_docker_raw\" WHERE $__timeFilter(logdatetime) AND ( logdatetime >= $__fromTime AND logdatetime <= $__toTime ) AND ( priority = 'error' ) AND ( message LIKE '%$filter1%' ) GROUP BY time ORDER BY time ASC LIMIT 5000", - "refId": "A" + "format": 1, + "meta": { + "builderOptions": { + "database": "default", + "fields": [ + "priority" + ], + "filters": [ + { + "condition": "AND", + "filterType": "custom", + "key": "logdatetime", + "operator": "WITH IN DASHBOARD TIME RANGE", + "restrictToFields": [ + { + "label": "logdatetime", + "name": "logdatetime", + "picklistValues": [], + "type": "DateTime" + } + ], + "type": "datetime" + }, + { + "condition": "AND", + "filterType": "custom", + "key": "priority", + "operator": "=", + "type": "String", + "value": "error" + }, + { + "condition": "AND", + "filterType": "custom", + "key": "message", + "operator": "LIKE", + "type": "String", + "value": "$filter1" + } + ], + "limit": 5000, + "metrics": [], + "mode": "trend", + "orderBy": [], + "table": "log_docker_raw", + "timeField": "logdatetime", + "timeFieldType": "DateTime" + } + }, + "queryType": "sql", + "rawSql": "SELECT $__timeInterval(logdatetime) as time, count() FROM \"default\".\"log_docker_raw\" WHERE $__timeFilter(logdatetime) AND ( logdatetime >= $__fromTime AND logdatetime <= $__toTime ) AND ( visitParamExtractString(message, 'level') = 'ERROR' ) AND ( program = ${program:singlequote} ) AND ( message LIKE '%$filter1%' ) AND ( message LIKE '%$filter2%' ) AND ( message LIKE '%$filter3%' ) GROUP BY time ORDER BY time ASC LIMIT 5000\n\n", + "refId": "A", + "selectedFormat": 4 } ], "title": "Total errors", @@ -337,7 +402,7 @@ { "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, "fieldConfig": { "defaults": { @@ -622,7 +687,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "10.1.5", + "pluginVersion": "10.2.1", "targets": [ { "builderOptions": { @@ -674,7 +739,7 @@ }, "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, "format": 1, "meta": { @@ -766,7 +831,7 @@ { "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, "fieldConfig": { "defaults": { @@ -936,7 +1001,7 @@ }, "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, "format": 1, "meta": { @@ -962,7 +1027,6 @@ ], "refresh": "", "schemaVersion": 38, - "style": "dark", "tags": [], "templating": { "list": [ @@ -974,7 +1038,7 @@ }, "datasource": { "type": "grafana-clickhouse-datasource", - "uid": "f70e773b-26c3-4b74-9a45-291fab27524b" + "uid": "ef7b4f5b-7011-411b-88c2-4b2681b8ddbe" }, "definition": "SELECT DISTINCT program FROM default.log_docker_raw WHERE logdatetime > now() - interval 6 hours;", "hide": 0, @@ -1085,6 +1149,6 @@ "timezone": "", "title": "Logs + Structured via Query", "uid": "b445eb43-25d1-4112-b628-3b8acf037f10", - "version": 8, + "version": 6, "weekStart": "" } \ No newline at end of file