{ "__inputs": [ { "name": "DS_GRAFANA-CLICKHOUSE-DATASOURCE", "label": "grafana-clickhouse-datasource", "description": "", "type": "datasource", "pluginId": "grafana-clickhouse-datasource", "pluginName": "ClickHouse" } ], "__elements": {}, "__requires": [ { "type": "panel", "id": "bargauge", "name": "Bar gauge", "version": "" }, { "type": "panel", "id": "gauge", "name": "Gauge", "version": "" }, { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "11.1.3" }, { "type": "datasource", "id": "grafana-clickhouse-datasource", "name": "ClickHouse", "version": "4.10.1" }, { "type": "panel", "id": "piechart", "name": "Pie chart", "version": "" }, { "type": "panel", "id": "table", "name": "Table", "version": "" }, { "type": "panel", "id": "timeseries", "name": "Time series", "version": "" } ], "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [], "liveNow": true, "panels": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "fieldMinMax": false, "mappings": [], "max": 41943040, "min": 0, "thresholds": { "mode": "percentage", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 70 }, { "color": "red", "value": 85 } ] }, "unit": "binBps" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 0, "y": 0 }, "id": 29, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n sum(bytes_sent) / (($__toTime) - ($__fromTime)) AS bytes_per_second\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\n", "refId": "A" } ], "title": "Average KB per second", "type": "gauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "percentage", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 70 }, { "color": "red", "value": 85 } ] }, "unit": "reqps" }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 3, "y": 0 }, "id": 30, "options": { "minVizHeight": 75, "minVizWidth": 75, "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true, "sizing": "auto" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n count() / dateDiff('second', $__fromTime, $__toTime) AS avg_requests_per_second\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\n", "refId": "A" } ], "title": "Average Throughput", "type": "gauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 6, "y": 0 }, "id": 26, "options": { "displayLabels": [ "name" ], "legend": { "displayMode": "list", "placement": "bottom", "showLegend": false }, "pieType": "donut", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^request_count$/", "values": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n toString(status) AS status,\n count() AS request_count\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY status\nORDER BY request_count DESC\n", "refId": "A" } ], "title": "Status Code Distribution", "type": "piechart" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-GrYlRd" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 3, "x": 9, "y": 0 }, "id": 21, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [], "fields": "", "values": true }, "showUnfilled": false, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n method AS method,\n count() AS request_count\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY method\nORDER BY request_count DESC\n", "refId": "A" } ], "title": "Method Distribution", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 500, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 190 } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 2, "w": 3, "x": 12, "y": 0 }, "id": 31, "options": { "displayMode": "lcd", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n quantile(0.95)(duration_ms) AS current_p95_response_time_ms\nFROM logs.caddy_requests\nWHERE ts BETWEEN $__fromTime AND $__toTime\n AND status != '101'\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\n", "refId": "A" } ], "title": "P95 Latancy", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-YlRd" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "hue", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "displayName": "Count", "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1000 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 9, "x": 15, "y": 0 }, "id": 27, "options": { "legend": { "calcs": [], "displayMode": "table", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT $__timeInterval(ts) as \"time\", count(ts) FROM \"logs\".\"caddy_requests\"\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip like '%${IP}%'\n GROUP BY time", "refId": "A" } ], "title": "Requests Trend", "type": "timeseries" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 30 } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 2, "w": 3, "x": 12, "y": 2 }, "id": 34, "options": { "displayMode": "lcd", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n quantile(0.80)(duration_ms) AS current_p95_response_time_ms\nFROM logs.caddy_requests\nWHERE ts BETWEEN $__fromTime AND $__toTime\n AND status != '101'\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\n", "refId": "A" } ], "title": "P80 Latancy", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 19, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 5 } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 2, "w": 3, "x": 12, "y": 4 }, "id": 33, "options": { "displayMode": "lcd", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n quantile(0.5)(duration_ms) AS current_median_response_time_ms\nFROM logs.caddy_requests\nWHERE ts BETWEEN $__fromTime AND $__toTime\n AND status != '101'\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\n", "refId": "A" } ], "title": "Middle Latancy", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-GrYlRd" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 5, "x": 0, "y": 6 }, "id": 5, "options": { "displayMode": "lcd", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [], "fields": "/^requests$/", "limit": 10, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n host as Application,\n count() AS requests\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip like '%${IP}%'\nGROUP BY Application\nORDER BY requests DESC\n\n", "refId": "A" } ], "title": "Requests By Count", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-GrYlRd" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 5, "x": 5, "y": 6 }, "id": 6, "options": { "displayMode": "lcd", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [], "fields": "", "limit": 10, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n host AS Application,\n uniqExact(remote_ip) AS unique_ip_count\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY Application\nORDER BY unique_ip_count DESC\n\n", "refId": "A" } ], "title": "Requests By Unique IP Count (IPs)", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-GrYlRd" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 8, "w": 5, "x": 10, "y": 6 }, "id": 7, "options": { "displayMode": "lcd", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [], "fields": "", "limit": 10, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n host AS Application,\n sum(duration_ms)/1000 AS total_duration_seconds\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND status != '101'\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY Application\nORDER BY total_duration_seconds DESC", "refId": "A" } ], "title": "Total Time costs (Seconds)", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-GrYlRd" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 8, "w": 5, "x": 15, "y": 6 }, "id": 28, "options": { "displayMode": "lcd", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [], "fields": "", "limit": 10, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n host AS Application,\n sum(bytes_sent) AS total_duration_seconds\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND status != '101'\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY Application\nORDER BY total_duration_seconds DESC", "refId": "A" } ], "title": "Total Bytes Sent (MB)", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-GrYlRd" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 4, "x": 20, "y": 6 }, "id": 9, "options": { "displayMode": "lcd", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [], "fields": "", "limit": 10, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n host AS Application,\n round(countIf(status >= 500) / count() * 100, 2) AS failure_rate_percent\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY Application\nORDER BY failure_rate_percent DESC\n", "refId": "A" } ], "title": "500 Failure Rate%", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "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": "percentage", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 70 }, { "color": "red", "value": 85 } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 6, "w": 5, "x": 0, "y": 14 }, "id": 3, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n $__timeInterval(ts) AS \"time\",\n quantile(0.95)(duration_ms) AS p95_response_time_ms\nFROM \"logs\".\"caddy_requests\"\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND status != '101'\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY time\nORDER BY time", "refId": "A" } ], "title": "Requests Latancy P95", "type": "timeseries" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "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": 6, "w": 5, "x": 5, "y": 14 }, "id": 10, "options": { "legend": { "calcs": [], "displayMode": "table", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n $__timeInterval(ts) AS \"time\",\n uniqExact(remote_ip) AS unique_ip_count\nFROM \"logs\".\"caddy_requests\"\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY time\nORDER BY time;", "refId": "A" } ], "title": "Incoming Unique IPs Count", "type": "timeseries" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "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 } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 6, "w": 5, "x": 10, "y": 14 }, "id": 11, "options": { "legend": { "calcs": [], "displayMode": "table", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n $__timeInterval(ts) AS \"time\",\n sum(duration_ms) AS total_duration_ms\nFROM \"logs\".\"caddy_requests\"\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY time\nORDER BY time;", "refId": "A" } ], "title": "Processing Requests Total Time Costs", "type": "timeseries" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "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 } ] }, "unit": "binBps" }, "overrides": [] }, "gridPos": { "h": 6, "w": 5, "x": 15, "y": 14 }, "id": 12, "options": { "legend": { "calcs": [], "displayMode": "table", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n $__timeInterval(ts) AS time,\n sum(bytes_sent) / $__interval_s AS bytes_per_second\nFROM logs.caddy_requests\nWHERE\n $__timeFilter(ts)\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY\n time\nORDER BY\n time ASC", "refId": "A" } ], "title": "Upload Bandwidth", "type": "timeseries" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "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": 6, "w": 4, "x": 20, "y": 14 }, "id": 13, "options": { "legend": { "calcs": [], "displayMode": "table", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n $__timeInterval(ts) AS \"time\",\n countIf(status >= 500) AS failure_count\nFROM \"logs\".\"caddy_requests\"\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY time\nORDER BY time;", "refId": "A" } ], "title": "Requests 500 Count", "type": "timeseries" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 9, "x": 0, "y": 20 }, "id": 15, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^requests$/", "limit": 25, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n concat(host, splitByChar('?', uri)[1]) AS Path,\n count() AS requests\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY Path\nORDER BY requests DESC\n", "refId": "A" } ], "title": "Hot Interfaces", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 8, "w": 9, "x": 9, "y": 20 }, "id": 18, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^avg_response_time_ms$/", "limit": 25, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n concat(host, splitByChar('?', uri)[1]) AS Path,\n avg(duration_ms) AS avg_response_time_ms\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\n AND status != '101'\nGROUP BY Path\nORDER BY avg_response_time_ms DESC\n", "refId": "A" } ], "title": "Slow Interface", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 18, "y": 20 }, "id": 14, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^count$/", "limit": 20, "values": true }, "showUnfilled": false, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT remote_ip, COUNT(*) AS count\nFROM \"logs\".\"caddy_requests\"\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY remote_ip\nORDER BY count DESC;", "refId": "A" } ], "title": "Incoming IPs", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 9, "x": 0, "y": 28 }, "id": 16, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^requests$/", "limit": 25, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n concat(host, splitByChar('?', uri)[1]) AS Path,\n count() AS requests\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\n AND status >= 500\nGROUP BY Path\nORDER BY requests DESC\n", "refId": "A" } ], "title": "Error Interface", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 8, "w": 9, "x": 9, "y": 28 }, "id": 17, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^failure_rate_percent$/", "limit": 25, "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n concat(host, splitByChar('?', uri)[1]) AS Path,\n round(countIf(status >= 500) / count() * 100, 2) AS failure_rate_percent\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY Path\nORDER BY failure_rate_percent DESC\n", "refId": "A" } ], "title": "Error Rate Interface", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 8, "w": 6, "x": 18, "y": 28 }, "id": 32, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 16, "minVizWidth": 8, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^total_bytes_sent$/", "limit": 20, "values": true }, "showUnfilled": false, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "columns": [], "database": "", "limit": 1000, "mode": "list", "queryType": "table", "table": "" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n remote_ip,\n sum(bytes_sent) AS total_bytes_sent\nFROM \"logs\".\"caddy_requests\"\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nGROUP BY remote_ip\nORDER BY total_bytes_sent DESC;\n", "refId": "A" } ], "title": "Sent data to IPs", "type": "bargauge" }, { "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 9, "w": 24, "x": 0, "y": 36 }, "id": 1, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true, "sortBy": [ { "desc": false, "displayName": "status" } ] }, "pluginVersion": "11.1.3", "targets": [ { "builderOptions": { "aggregates": [], "columns": [ { "alias": "level", "custom": false, "name": "level", "type": "LowCardinality(String)" }, { "alias": "remote_ip", "custom": false, "name": "remote_ip", "type": "String" } ], "database": "logs", "filters": [], "groupBy": [], "limit": 1000, "meta": {}, "mode": "list", "orderBy": [], "queryType": "table", "table": "caddy_requests" }, "datasource": { "type": "grafana-clickhouse-datasource", "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" }, "editorType": "sql", "format": 1, "meta": { "builderOptions": { "aggregates": [], "columns": [ { "alias": "level", "custom": false, "name": "level", "type": "LowCardinality(String)" }, { "alias": "remote_ip", "custom": false, "name": "remote_ip", "type": "String" } ], "database": "logs", "filters": [], "groupBy": [], "limit": 1000, "meta": {}, "mode": "list", "orderBy": [], "queryType": "table", "table": "caddy_requests" } }, "pluginVersion": "4.10.1", "queryType": "table", "rawSql": "SELECT\n remote_ip, method, host, uri, status, bytes_sent, duration_ms\t\nFROM logs.caddy_requests\nWHERE ( ts >= $__fromTime AND ts <= $__toTime )\n AND host LIKE '%${Application}%'\n AND remote_ip LIKE '%${IP}%'\nORDER BY ts DESC\nLIMIT 200", "refId": "Hot Application" } ], "title": "RAW", "type": "table" } ], "refresh": "", "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "", "value": "" }, "description": "Application", "hide": 0, "label": "Application", "name": "Application", "options": [ { "selected": true, "text": "", "value": "" } ], "query": "", "skipUrlSync": false, "type": "textbox" }, { "current": { "selected": false, "text": "", "value": "" }, "description": "IP", "hide": 0, "label": "IP", "name": "IP", "options": [ { "selected": true, "text": "", "value": "" } ], "query": "", "skipUrlSync": false, "type": "textbox" } ] }, "time": { "from": "now-6h", "to": "now" }, "timepicker": {}, "timezone": "browser", "title": "Caddy", "uid": "eet9bprvewlq8e", "version": 46, "weekStart": "" }