clickhouse.json
· 4.9 KiB · JSON
原始文件
{
"params": {
"rounding": "60",
"seconds": "600"
},
"queries": [
{
"title": "Request rate",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n count() AS requests\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "Unique Request IP",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n uniqExact(remote_ip) AS unique_ips\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "Average request bytes",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n avg(bytes_sent) AS avg_bytes_sent\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "Average response time costs",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n avg(duration_ms) AS avg_response_time_ms\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "Gitea Crawler Percentage",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n countIf(\n host = 'git.aiursoft.cn' \n AND uri LIKE '/PublicVault%' \n AND uri LIKE '%commit%'\n ) / count() AS crawler_ratio\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "HTTP Code distribution",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n countIf(status >= 100 AND status < 200) / count() AS ratio_1xx,\n countIf(status >= 200 AND status < 300) / count() AS ratio_2xx,\n countIf(status >= 300 AND status < 400) / count() AS ratio_3xx,\n countIf(status >= 400 AND status < 500) / count() AS ratio_4xx,\n countIf(status >= 500 AND status < 600) / count() AS ratio_5xx\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "Requests by host distribution",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n sumIf(1, host = 'git.aiursoft.cn') AS Gitea,\n sumIf(1, host = 'nextcloud.aiursoft.cn') AS Nextcloud,\n sumIf(1, host = 'stathub.aiursoft.cn') AS Stathub,\n sumIf(1, host = 'hub.aiursoft.cn') AS DockerHub,\n sumIf(1, host = 'gitlab.aiursoft.cn') AS GitLab,\n sumIf(1, host = 'auth.aiursoft.cn') AS Auth,\n sumIf(1, host = 'wiki.aiursoft.cn') AS Wiki,\n sumIf(1, host = 'remotely.aiursoft.cn') AS Remotely,\n -- Others:统计 host 不在上述列表中的所有请求\n sumIf(\n 1,\n host NOT IN (\n 'git.aiursoft.cn',\n 'nextcloud.aiursoft.cn',\n 'stathub.aiursoft.cn',\n 'hub.aiursoft.cn',\n 'gitlab.aiursoft.cn',\n 'auth.aiursoft.cn',\n 'wiki.aiursoft.cn',\n 'remotely.aiursoft.cn'\n )\n ) AS Others\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "Methods distribution",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n sumIf(1, method = 'GET') AS GET,\n sumIf(1, method = 'POST') AS POST,\n sumIf(1, method = 'OPTIONS') AS OPTIONS,\n sumIf(1, method = 'PROPFIND') AS PROPFIND,\n sumIf(\n 1,\n method NOT IN ('GET','POST','OPTIONS', 'PROPFIND')\n ) AS Others\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "Request Size P50 P95",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n quantile(0.5)(bytes_sent) AS p50_bytes,\n quantile(0.95)(bytes_sent) AS p95_bytes\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
},
{
"title": "Requst Latancy P95 P99",
"query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n quantile(0.95)(duration_ms) AS p95_latency_ms,\n quantile(0.99)(duration_ms) AS p99_latency_ms\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n"
}
]
}
1 | { |
2 | "params": { |
3 | "rounding": "60", |
4 | "seconds": "600" |
5 | }, |
6 | "queries": [ |
7 | { |
8 | "title": "Request rate", |
9 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n count() AS requests\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
10 | }, |
11 | { |
12 | "title": "Unique Request IP", |
13 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n uniqExact(remote_ip) AS unique_ips\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
14 | }, |
15 | { |
16 | "title": "Average request bytes", |
17 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n avg(bytes_sent) AS avg_bytes_sent\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
18 | }, |
19 | { |
20 | "title": "Average response time costs", |
21 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n avg(duration_ms) AS avg_response_time_ms\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
22 | }, |
23 | { |
24 | "title": "Gitea Crawler Percentage", |
25 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n countIf(\n host = 'git.aiursoft.cn' \n AND uri LIKE '/PublicVault%' \n AND uri LIKE '%commit%'\n ) / count() AS crawler_ratio\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
26 | }, |
27 | { |
28 | "title": "HTTP Code distribution", |
29 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n countIf(status >= 100 AND status < 200) / count() AS ratio_1xx,\n countIf(status >= 200 AND status < 300) / count() AS ratio_2xx,\n countIf(status >= 300 AND status < 400) / count() AS ratio_3xx,\n countIf(status >= 400 AND status < 500) / count() AS ratio_4xx,\n countIf(status >= 500 AND status < 600) / count() AS ratio_5xx\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
30 | }, |
31 | { |
32 | "title": "Requests by host distribution", |
33 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n sumIf(1, host = 'git.aiursoft.cn') AS Gitea,\n sumIf(1, host = 'nextcloud.aiursoft.cn') AS Nextcloud,\n sumIf(1, host = 'stathub.aiursoft.cn') AS Stathub,\n sumIf(1, host = 'hub.aiursoft.cn') AS DockerHub,\n sumIf(1, host = 'gitlab.aiursoft.cn') AS GitLab,\n sumIf(1, host = 'auth.aiursoft.cn') AS Auth,\n sumIf(1, host = 'wiki.aiursoft.cn') AS Wiki,\n sumIf(1, host = 'remotely.aiursoft.cn') AS Remotely,\n -- Others:统计 host 不在上述列表中的所有请求\n sumIf(\n 1,\n host NOT IN (\n 'git.aiursoft.cn',\n 'nextcloud.aiursoft.cn',\n 'stathub.aiursoft.cn',\n 'hub.aiursoft.cn',\n 'gitlab.aiursoft.cn',\n 'auth.aiursoft.cn',\n 'wiki.aiursoft.cn',\n 'remotely.aiursoft.cn'\n )\n ) AS Others\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
34 | }, |
35 | { |
36 | "title": "Methods distribution", |
37 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n sumIf(1, method = 'GET') AS GET,\n sumIf(1, method = 'POST') AS POST,\n sumIf(1, method = 'OPTIONS') AS OPTIONS,\n sumIf(1, method = 'PROPFIND') AS PROPFIND,\n sumIf(\n 1,\n method NOT IN ('GET','POST','OPTIONS', 'PROPFIND')\n ) AS Others\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
38 | }, |
39 | { |
40 | "title": "Request Size P50 P95", |
41 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n quantile(0.5)(bytes_sent) AS p50_bytes,\n quantile(0.95)(bytes_sent) AS p95_bytes\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
42 | }, |
43 | { |
44 | "title": "Requst Latancy P95 P99", |
45 | "query": "SELECT\n toStartOfInterval(ts, INTERVAL {rounding:UInt32} SECOND)::Int64 AS t,\n quantile(0.95)(duration_ms) AS p95_latency_ms,\n quantile(0.99)(duration_ms) AS p99_latency_ms\nFROM logs.caddy_requests\nWHERE ts >= now() - {seconds:UInt32}\nGROUP BY t\nORDER BY t\nWITH FILL STEP {rounding:UInt32}\n" |
46 | } |
47 | ] |
48 | } |
grafana.json
· 62 KiB · JSON
原始文件
{
"__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": ""
}
1 | { |
2 | "__inputs": [ |
3 | { |
4 | "name": "DS_GRAFANA-CLICKHOUSE-DATASOURCE", |
5 | "label": "grafana-clickhouse-datasource", |
6 | "description": "", |
7 | "type": "datasource", |
8 | "pluginId": "grafana-clickhouse-datasource", |
9 | "pluginName": "ClickHouse" |
10 | } |
11 | ], |
12 | "__elements": {}, |
13 | "__requires": [ |
14 | { |
15 | "type": "panel", |
16 | "id": "bargauge", |
17 | "name": "Bar gauge", |
18 | "version": "" |
19 | }, |
20 | { |
21 | "type": "panel", |
22 | "id": "gauge", |
23 | "name": "Gauge", |
24 | "version": "" |
25 | }, |
26 | { |
27 | "type": "grafana", |
28 | "id": "grafana", |
29 | "name": "Grafana", |
30 | "version": "11.1.3" |
31 | }, |
32 | { |
33 | "type": "datasource", |
34 | "id": "grafana-clickhouse-datasource", |
35 | "name": "ClickHouse", |
36 | "version": "4.10.1" |
37 | }, |
38 | { |
39 | "type": "panel", |
40 | "id": "piechart", |
41 | "name": "Pie chart", |
42 | "version": "" |
43 | }, |
44 | { |
45 | "type": "panel", |
46 | "id": "table", |
47 | "name": "Table", |
48 | "version": "" |
49 | }, |
50 | { |
51 | "type": "panel", |
52 | "id": "timeseries", |
53 | "name": "Time series", |
54 | "version": "" |
55 | } |
56 | ], |
57 | "annotations": { |
58 | "list": [ |
59 | { |
60 | "builtIn": 1, |
61 | "datasource": { |
62 | "type": "grafana", |
63 | "uid": "-- Grafana --" |
64 | }, |
65 | "enable": true, |
66 | "hide": true, |
67 | "iconColor": "rgba(0, 211, 255, 1)", |
68 | "name": "Annotations & Alerts", |
69 | "type": "dashboard" |
70 | } |
71 | ] |
72 | }, |
73 | "editable": true, |
74 | "fiscalYearStartMonth": 0, |
75 | "graphTooltip": 0, |
76 | "id": null, |
77 | "links": [], |
78 | "liveNow": true, |
79 | "panels": [ |
80 | { |
81 | "datasource": { |
82 | "type": "grafana-clickhouse-datasource", |
83 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
84 | }, |
85 | "fieldConfig": { |
86 | "defaults": { |
87 | "fieldMinMax": false, |
88 | "mappings": [], |
89 | "max": 41943040, |
90 | "min": 0, |
91 | "thresholds": { |
92 | "mode": "percentage", |
93 | "steps": [ |
94 | { |
95 | "color": "green", |
96 | "value": null |
97 | }, |
98 | { |
99 | "color": "orange", |
100 | "value": 70 |
101 | }, |
102 | { |
103 | "color": "red", |
104 | "value": 85 |
105 | } |
106 | ] |
107 | }, |
108 | "unit": "binBps" |
109 | }, |
110 | "overrides": [] |
111 | }, |
112 | "gridPos": { |
113 | "h": 6, |
114 | "w": 3, |
115 | "x": 0, |
116 | "y": 0 |
117 | }, |
118 | "id": 29, |
119 | "options": { |
120 | "minVizHeight": 75, |
121 | "minVizWidth": 75, |
122 | "orientation": "auto", |
123 | "reduceOptions": { |
124 | "calcs": [ |
125 | "lastNotNull" |
126 | ], |
127 | "fields": "", |
128 | "values": false |
129 | }, |
130 | "showThresholdLabels": false, |
131 | "showThresholdMarkers": true, |
132 | "sizing": "auto" |
133 | }, |
134 | "pluginVersion": "11.1.3", |
135 | "targets": [ |
136 | { |
137 | "datasource": { |
138 | "type": "grafana-clickhouse-datasource", |
139 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
140 | }, |
141 | "editorType": "sql", |
142 | "format": 1, |
143 | "meta": { |
144 | "builderOptions": { |
145 | "columns": [], |
146 | "database": "", |
147 | "limit": 1000, |
148 | "mode": "list", |
149 | "queryType": "table", |
150 | "table": "" |
151 | } |
152 | }, |
153 | "pluginVersion": "4.10.1", |
154 | "queryType": "table", |
155 | "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", |
156 | "refId": "A" |
157 | } |
158 | ], |
159 | "title": "Average KB per second", |
160 | "type": "gauge" |
161 | }, |
162 | { |
163 | "datasource": { |
164 | "type": "grafana-clickhouse-datasource", |
165 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
166 | }, |
167 | "fieldConfig": { |
168 | "defaults": { |
169 | "mappings": [], |
170 | "max": 100, |
171 | "min": 0, |
172 | "thresholds": { |
173 | "mode": "percentage", |
174 | "steps": [ |
175 | { |
176 | "color": "green", |
177 | "value": null |
178 | }, |
179 | { |
180 | "color": "orange", |
181 | "value": 70 |
182 | }, |
183 | { |
184 | "color": "red", |
185 | "value": 85 |
186 | } |
187 | ] |
188 | }, |
189 | "unit": "reqps" |
190 | }, |
191 | "overrides": [] |
192 | }, |
193 | "gridPos": { |
194 | "h": 6, |
195 | "w": 3, |
196 | "x": 3, |
197 | "y": 0 |
198 | }, |
199 | "id": 30, |
200 | "options": { |
201 | "minVizHeight": 75, |
202 | "minVizWidth": 75, |
203 | "orientation": "auto", |
204 | "reduceOptions": { |
205 | "calcs": [ |
206 | "lastNotNull" |
207 | ], |
208 | "fields": "", |
209 | "values": false |
210 | }, |
211 | "showThresholdLabels": false, |
212 | "showThresholdMarkers": true, |
213 | "sizing": "auto" |
214 | }, |
215 | "pluginVersion": "11.1.3", |
216 | "targets": [ |
217 | { |
218 | "datasource": { |
219 | "type": "grafana-clickhouse-datasource", |
220 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
221 | }, |
222 | "editorType": "sql", |
223 | "format": 1, |
224 | "meta": { |
225 | "builderOptions": { |
226 | "columns": [], |
227 | "database": "", |
228 | "limit": 1000, |
229 | "mode": "list", |
230 | "queryType": "table", |
231 | "table": "" |
232 | } |
233 | }, |
234 | "pluginVersion": "4.10.1", |
235 | "queryType": "table", |
236 | "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", |
237 | "refId": "A" |
238 | } |
239 | ], |
240 | "title": "Average Throughput", |
241 | "type": "gauge" |
242 | }, |
243 | { |
244 | "datasource": { |
245 | "type": "grafana-clickhouse-datasource", |
246 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
247 | }, |
248 | "fieldConfig": { |
249 | "defaults": { |
250 | "color": { |
251 | "mode": "palette-classic" |
252 | }, |
253 | "custom": { |
254 | "hideFrom": { |
255 | "legend": false, |
256 | "tooltip": false, |
257 | "viz": false |
258 | } |
259 | }, |
260 | "mappings": [] |
261 | }, |
262 | "overrides": [] |
263 | }, |
264 | "gridPos": { |
265 | "h": 6, |
266 | "w": 3, |
267 | "x": 6, |
268 | "y": 0 |
269 | }, |
270 | "id": 26, |
271 | "options": { |
272 | "displayLabels": [ |
273 | "name" |
274 | ], |
275 | "legend": { |
276 | "displayMode": "list", |
277 | "placement": "bottom", |
278 | "showLegend": false |
279 | }, |
280 | "pieType": "donut", |
281 | "reduceOptions": { |
282 | "calcs": [ |
283 | "lastNotNull" |
284 | ], |
285 | "fields": "/^request_count$/", |
286 | "values": true |
287 | }, |
288 | "tooltip": { |
289 | "mode": "single", |
290 | "sort": "none" |
291 | } |
292 | }, |
293 | "pluginVersion": "11.1.3", |
294 | "targets": [ |
295 | { |
296 | "datasource": { |
297 | "type": "grafana-clickhouse-datasource", |
298 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
299 | }, |
300 | "editorType": "sql", |
301 | "format": 1, |
302 | "meta": { |
303 | "builderOptions": { |
304 | "columns": [], |
305 | "database": "", |
306 | "limit": 1000, |
307 | "mode": "list", |
308 | "queryType": "table", |
309 | "table": "" |
310 | } |
311 | }, |
312 | "pluginVersion": "4.10.1", |
313 | "queryType": "table", |
314 | "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", |
315 | "refId": "A" |
316 | } |
317 | ], |
318 | "title": "Status Code Distribution", |
319 | "type": "piechart" |
320 | }, |
321 | { |
322 | "datasource": { |
323 | "type": "grafana-clickhouse-datasource", |
324 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
325 | }, |
326 | "fieldConfig": { |
327 | "defaults": { |
328 | "color": { |
329 | "mode": "continuous-GrYlRd" |
330 | }, |
331 | "mappings": [], |
332 | "thresholds": { |
333 | "mode": "absolute", |
334 | "steps": [ |
335 | { |
336 | "color": "green", |
337 | "value": null |
338 | }, |
339 | { |
340 | "color": "red", |
341 | "value": 80 |
342 | } |
343 | ] |
344 | } |
345 | }, |
346 | "overrides": [] |
347 | }, |
348 | "gridPos": { |
349 | "h": 6, |
350 | "w": 3, |
351 | "x": 9, |
352 | "y": 0 |
353 | }, |
354 | "id": 21, |
355 | "options": { |
356 | "displayMode": "gradient", |
357 | "maxVizHeight": 300, |
358 | "minVizHeight": 16, |
359 | "minVizWidth": 8, |
360 | "namePlacement": "auto", |
361 | "orientation": "horizontal", |
362 | "reduceOptions": { |
363 | "calcs": [], |
364 | "fields": "", |
365 | "values": true |
366 | }, |
367 | "showUnfilled": false, |
368 | "sizing": "auto", |
369 | "valueMode": "color" |
370 | }, |
371 | "pluginVersion": "11.1.3", |
372 | "targets": [ |
373 | { |
374 | "datasource": { |
375 | "type": "grafana-clickhouse-datasource", |
376 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
377 | }, |
378 | "editorType": "sql", |
379 | "format": 1, |
380 | "meta": { |
381 | "builderOptions": { |
382 | "columns": [], |
383 | "database": "", |
384 | "limit": 1000, |
385 | "mode": "list", |
386 | "queryType": "table", |
387 | "table": "" |
388 | } |
389 | }, |
390 | "pluginVersion": "4.10.1", |
391 | "queryType": "table", |
392 | "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", |
393 | "refId": "A" |
394 | } |
395 | ], |
396 | "title": "Method Distribution", |
397 | "type": "bargauge" |
398 | }, |
399 | { |
400 | "datasource": { |
401 | "type": "grafana-clickhouse-datasource", |
402 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
403 | }, |
404 | "fieldConfig": { |
405 | "defaults": { |
406 | "color": { |
407 | "mode": "thresholds" |
408 | }, |
409 | "mappings": [], |
410 | "max": 500, |
411 | "min": 0, |
412 | "thresholds": { |
413 | "mode": "absolute", |
414 | "steps": [ |
415 | { |
416 | "color": "green", |
417 | "value": null |
418 | }, |
419 | { |
420 | "color": "red", |
421 | "value": 190 |
422 | } |
423 | ] |
424 | }, |
425 | "unit": "ms" |
426 | }, |
427 | "overrides": [] |
428 | }, |
429 | "gridPos": { |
430 | "h": 2, |
431 | "w": 3, |
432 | "x": 12, |
433 | "y": 0 |
434 | }, |
435 | "id": 31, |
436 | "options": { |
437 | "displayMode": "lcd", |
438 | "maxVizHeight": 300, |
439 | "minVizHeight": 16, |
440 | "minVizWidth": 8, |
441 | "namePlacement": "auto", |
442 | "orientation": "horizontal", |
443 | "reduceOptions": { |
444 | "calcs": [ |
445 | "lastNotNull" |
446 | ], |
447 | "fields": "", |
448 | "values": false |
449 | }, |
450 | "showUnfilled": true, |
451 | "sizing": "auto", |
452 | "valueMode": "color" |
453 | }, |
454 | "pluginVersion": "11.1.3", |
455 | "targets": [ |
456 | { |
457 | "datasource": { |
458 | "type": "grafana-clickhouse-datasource", |
459 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
460 | }, |
461 | "editorType": "sql", |
462 | "format": 1, |
463 | "meta": { |
464 | "builderOptions": { |
465 | "columns": [], |
466 | "database": "", |
467 | "limit": 1000, |
468 | "mode": "list", |
469 | "queryType": "table", |
470 | "table": "" |
471 | } |
472 | }, |
473 | "pluginVersion": "4.10.1", |
474 | "queryType": "table", |
475 | "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", |
476 | "refId": "A" |
477 | } |
478 | ], |
479 | "title": "P95 Latancy", |
480 | "type": "bargauge" |
481 | }, |
482 | { |
483 | "datasource": { |
484 | "type": "grafana-clickhouse-datasource", |
485 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
486 | }, |
487 | "fieldConfig": { |
488 | "defaults": { |
489 | "color": { |
490 | "mode": "continuous-YlRd" |
491 | }, |
492 | "custom": { |
493 | "axisBorderShow": false, |
494 | "axisCenteredZero": false, |
495 | "axisColorMode": "text", |
496 | "axisLabel": "", |
497 | "axisPlacement": "auto", |
498 | "barAlignment": 0, |
499 | "drawStyle": "line", |
500 | "fillOpacity": 0, |
501 | "gradientMode": "hue", |
502 | "hideFrom": { |
503 | "legend": false, |
504 | "tooltip": false, |
505 | "viz": false |
506 | }, |
507 | "insertNulls": false, |
508 | "lineInterpolation": "linear", |
509 | "lineStyle": { |
510 | "fill": "solid" |
511 | }, |
512 | "lineWidth": 1, |
513 | "pointSize": 5, |
514 | "scaleDistribution": { |
515 | "type": "linear" |
516 | }, |
517 | "showPoints": "auto", |
518 | "spanNulls": false, |
519 | "stacking": { |
520 | "group": "A", |
521 | "mode": "none" |
522 | }, |
523 | "thresholdsStyle": { |
524 | "mode": "off" |
525 | } |
526 | }, |
527 | "displayName": "Count", |
528 | "mappings": [], |
529 | "thresholds": { |
530 | "mode": "absolute", |
531 | "steps": [ |
532 | { |
533 | "color": "green", |
534 | "value": null |
535 | }, |
536 | { |
537 | "color": "red", |
538 | "value": 1000 |
539 | } |
540 | ] |
541 | } |
542 | }, |
543 | "overrides": [] |
544 | }, |
545 | "gridPos": { |
546 | "h": 6, |
547 | "w": 9, |
548 | "x": 15, |
549 | "y": 0 |
550 | }, |
551 | "id": 27, |
552 | "options": { |
553 | "legend": { |
554 | "calcs": [], |
555 | "displayMode": "table", |
556 | "placement": "bottom", |
557 | "showLegend": false |
558 | }, |
559 | "tooltip": { |
560 | "mode": "single", |
561 | "sort": "none" |
562 | } |
563 | }, |
564 | "targets": [ |
565 | { |
566 | "datasource": { |
567 | "type": "grafana-clickhouse-datasource", |
568 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
569 | }, |
570 | "editorType": "sql", |
571 | "format": 1, |
572 | "meta": { |
573 | "builderOptions": { |
574 | "columns": [], |
575 | "database": "", |
576 | "limit": 1000, |
577 | "mode": "list", |
578 | "queryType": "table", |
579 | "table": "" |
580 | } |
581 | }, |
582 | "pluginVersion": "4.10.1", |
583 | "queryType": "table", |
584 | "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", |
585 | "refId": "A" |
586 | } |
587 | ], |
588 | "title": "Requests Trend", |
589 | "type": "timeseries" |
590 | }, |
591 | { |
592 | "datasource": { |
593 | "type": "grafana-clickhouse-datasource", |
594 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
595 | }, |
596 | "fieldConfig": { |
597 | "defaults": { |
598 | "color": { |
599 | "mode": "thresholds" |
600 | }, |
601 | "mappings": [], |
602 | "max": 100, |
603 | "min": 0, |
604 | "thresholds": { |
605 | "mode": "absolute", |
606 | "steps": [ |
607 | { |
608 | "color": "green", |
609 | "value": null |
610 | }, |
611 | { |
612 | "color": "red", |
613 | "value": 30 |
614 | } |
615 | ] |
616 | }, |
617 | "unit": "ms" |
618 | }, |
619 | "overrides": [] |
620 | }, |
621 | "gridPos": { |
622 | "h": 2, |
623 | "w": 3, |
624 | "x": 12, |
625 | "y": 2 |
626 | }, |
627 | "id": 34, |
628 | "options": { |
629 | "displayMode": "lcd", |
630 | "maxVizHeight": 300, |
631 | "minVizHeight": 16, |
632 | "minVizWidth": 8, |
633 | "namePlacement": "auto", |
634 | "orientation": "horizontal", |
635 | "reduceOptions": { |
636 | "calcs": [ |
637 | "lastNotNull" |
638 | ], |
639 | "fields": "", |
640 | "values": false |
641 | }, |
642 | "showUnfilled": true, |
643 | "sizing": "auto", |
644 | "valueMode": "color" |
645 | }, |
646 | "pluginVersion": "11.1.3", |
647 | "targets": [ |
648 | { |
649 | "datasource": { |
650 | "type": "grafana-clickhouse-datasource", |
651 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
652 | }, |
653 | "editorType": "sql", |
654 | "format": 1, |
655 | "meta": { |
656 | "builderOptions": { |
657 | "columns": [], |
658 | "database": "", |
659 | "limit": 1000, |
660 | "mode": "list", |
661 | "queryType": "table", |
662 | "table": "" |
663 | } |
664 | }, |
665 | "pluginVersion": "4.10.1", |
666 | "queryType": "table", |
667 | "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", |
668 | "refId": "A" |
669 | } |
670 | ], |
671 | "title": "P80 Latancy", |
672 | "type": "bargauge" |
673 | }, |
674 | { |
675 | "datasource": { |
676 | "type": "grafana-clickhouse-datasource", |
677 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
678 | }, |
679 | "fieldConfig": { |
680 | "defaults": { |
681 | "color": { |
682 | "mode": "thresholds" |
683 | }, |
684 | "mappings": [], |
685 | "max": 19, |
686 | "min": 0, |
687 | "thresholds": { |
688 | "mode": "absolute", |
689 | "steps": [ |
690 | { |
691 | "color": "green", |
692 | "value": null |
693 | }, |
694 | { |
695 | "color": "red", |
696 | "value": 5 |
697 | } |
698 | ] |
699 | }, |
700 | "unit": "ms" |
701 | }, |
702 | "overrides": [] |
703 | }, |
704 | "gridPos": { |
705 | "h": 2, |
706 | "w": 3, |
707 | "x": 12, |
708 | "y": 4 |
709 | }, |
710 | "id": 33, |
711 | "options": { |
712 | "displayMode": "lcd", |
713 | "maxVizHeight": 300, |
714 | "minVizHeight": 16, |
715 | "minVizWidth": 8, |
716 | "namePlacement": "auto", |
717 | "orientation": "horizontal", |
718 | "reduceOptions": { |
719 | "calcs": [ |
720 | "lastNotNull" |
721 | ], |
722 | "fields": "", |
723 | "values": false |
724 | }, |
725 | "showUnfilled": true, |
726 | "sizing": "auto", |
727 | "valueMode": "color" |
728 | }, |
729 | "pluginVersion": "11.1.3", |
730 | "targets": [ |
731 | { |
732 | "datasource": { |
733 | "type": "grafana-clickhouse-datasource", |
734 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
735 | }, |
736 | "editorType": "sql", |
737 | "format": 1, |
738 | "meta": { |
739 | "builderOptions": { |
740 | "columns": [], |
741 | "database": "", |
742 | "limit": 1000, |
743 | "mode": "list", |
744 | "queryType": "table", |
745 | "table": "" |
746 | } |
747 | }, |
748 | "pluginVersion": "4.10.1", |
749 | "queryType": "table", |
750 | "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", |
751 | "refId": "A" |
752 | } |
753 | ], |
754 | "title": "Middle Latancy", |
755 | "type": "bargauge" |
756 | }, |
757 | { |
758 | "datasource": { |
759 | "type": "grafana-clickhouse-datasource", |
760 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
761 | }, |
762 | "fieldConfig": { |
763 | "defaults": { |
764 | "color": { |
765 | "mode": "continuous-GrYlRd" |
766 | }, |
767 | "mappings": [], |
768 | "thresholds": { |
769 | "mode": "absolute", |
770 | "steps": [ |
771 | { |
772 | "color": "green", |
773 | "value": null |
774 | }, |
775 | { |
776 | "color": "red", |
777 | "value": 80 |
778 | } |
779 | ] |
780 | } |
781 | }, |
782 | "overrides": [] |
783 | }, |
784 | "gridPos": { |
785 | "h": 8, |
786 | "w": 5, |
787 | "x": 0, |
788 | "y": 6 |
789 | }, |
790 | "id": 5, |
791 | "options": { |
792 | "displayMode": "lcd", |
793 | "maxVizHeight": 300, |
794 | "minVizHeight": 16, |
795 | "minVizWidth": 8, |
796 | "namePlacement": "auto", |
797 | "orientation": "horizontal", |
798 | "reduceOptions": { |
799 | "calcs": [], |
800 | "fields": "/^requests$/", |
801 | "limit": 10, |
802 | "values": true |
803 | }, |
804 | "showUnfilled": true, |
805 | "sizing": "auto", |
806 | "valueMode": "color" |
807 | }, |
808 | "pluginVersion": "11.1.3", |
809 | "targets": [ |
810 | { |
811 | "datasource": { |
812 | "type": "grafana-clickhouse-datasource", |
813 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
814 | }, |
815 | "editorType": "sql", |
816 | "format": 1, |
817 | "meta": { |
818 | "builderOptions": { |
819 | "columns": [], |
820 | "database": "", |
821 | "limit": 1000, |
822 | "mode": "list", |
823 | "queryType": "table", |
824 | "table": "" |
825 | } |
826 | }, |
827 | "pluginVersion": "4.10.1", |
828 | "queryType": "table", |
829 | "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", |
830 | "refId": "A" |
831 | } |
832 | ], |
833 | "title": "Requests By Count", |
834 | "type": "bargauge" |
835 | }, |
836 | { |
837 | "datasource": { |
838 | "type": "grafana-clickhouse-datasource", |
839 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
840 | }, |
841 | "fieldConfig": { |
842 | "defaults": { |
843 | "color": { |
844 | "mode": "continuous-GrYlRd" |
845 | }, |
846 | "mappings": [], |
847 | "thresholds": { |
848 | "mode": "absolute", |
849 | "steps": [ |
850 | { |
851 | "color": "green", |
852 | "value": null |
853 | }, |
854 | { |
855 | "color": "red", |
856 | "value": 80 |
857 | } |
858 | ] |
859 | } |
860 | }, |
861 | "overrides": [] |
862 | }, |
863 | "gridPos": { |
864 | "h": 8, |
865 | "w": 5, |
866 | "x": 5, |
867 | "y": 6 |
868 | }, |
869 | "id": 6, |
870 | "options": { |
871 | "displayMode": "lcd", |
872 | "maxVizHeight": 300, |
873 | "minVizHeight": 16, |
874 | "minVizWidth": 8, |
875 | "namePlacement": "auto", |
876 | "orientation": "horizontal", |
877 | "reduceOptions": { |
878 | "calcs": [], |
879 | "fields": "", |
880 | "limit": 10, |
881 | "values": true |
882 | }, |
883 | "showUnfilled": true, |
884 | "sizing": "auto", |
885 | "valueMode": "color" |
886 | }, |
887 | "pluginVersion": "11.1.3", |
888 | "targets": [ |
889 | { |
890 | "datasource": { |
891 | "type": "grafana-clickhouse-datasource", |
892 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
893 | }, |
894 | "editorType": "sql", |
895 | "format": 1, |
896 | "meta": { |
897 | "builderOptions": { |
898 | "columns": [], |
899 | "database": "", |
900 | "limit": 1000, |
901 | "mode": "list", |
902 | "queryType": "table", |
903 | "table": "" |
904 | } |
905 | }, |
906 | "pluginVersion": "4.10.1", |
907 | "queryType": "table", |
908 | "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", |
909 | "refId": "A" |
910 | } |
911 | ], |
912 | "title": "Requests By Unique IP Count (IPs)", |
913 | "type": "bargauge" |
914 | }, |
915 | { |
916 | "datasource": { |
917 | "type": "grafana-clickhouse-datasource", |
918 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
919 | }, |
920 | "fieldConfig": { |
921 | "defaults": { |
922 | "color": { |
923 | "mode": "continuous-GrYlRd" |
924 | }, |
925 | "mappings": [], |
926 | "thresholds": { |
927 | "mode": "absolute", |
928 | "steps": [ |
929 | { |
930 | "color": "green", |
931 | "value": null |
932 | }, |
933 | { |
934 | "color": "red", |
935 | "value": 80 |
936 | } |
937 | ] |
938 | }, |
939 | "unit": "s" |
940 | }, |
941 | "overrides": [] |
942 | }, |
943 | "gridPos": { |
944 | "h": 8, |
945 | "w": 5, |
946 | "x": 10, |
947 | "y": 6 |
948 | }, |
949 | "id": 7, |
950 | "options": { |
951 | "displayMode": "lcd", |
952 | "maxVizHeight": 300, |
953 | "minVizHeight": 16, |
954 | "minVizWidth": 8, |
955 | "namePlacement": "auto", |
956 | "orientation": "horizontal", |
957 | "reduceOptions": { |
958 | "calcs": [], |
959 | "fields": "", |
960 | "limit": 10, |
961 | "values": true |
962 | }, |
963 | "showUnfilled": true, |
964 | "sizing": "auto", |
965 | "valueMode": "color" |
966 | }, |
967 | "pluginVersion": "11.1.3", |
968 | "targets": [ |
969 | { |
970 | "datasource": { |
971 | "type": "grafana-clickhouse-datasource", |
972 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
973 | }, |
974 | "editorType": "sql", |
975 | "format": 1, |
976 | "meta": { |
977 | "builderOptions": { |
978 | "columns": [], |
979 | "database": "", |
980 | "limit": 1000, |
981 | "mode": "list", |
982 | "queryType": "table", |
983 | "table": "" |
984 | } |
985 | }, |
986 | "pluginVersion": "4.10.1", |
987 | "queryType": "table", |
988 | "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", |
989 | "refId": "A" |
990 | } |
991 | ], |
992 | "title": "Total Time costs (Seconds)", |
993 | "type": "bargauge" |
994 | }, |
995 | { |
996 | "datasource": { |
997 | "type": "grafana-clickhouse-datasource", |
998 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
999 | }, |
1000 | "fieldConfig": { |
1001 | "defaults": { |
1002 | "color": { |
1003 | "mode": "continuous-GrYlRd" |
1004 | }, |
1005 | "mappings": [], |
1006 | "thresholds": { |
1007 | "mode": "absolute", |
1008 | "steps": [ |
1009 | { |
1010 | "color": "green", |
1011 | "value": null |
1012 | }, |
1013 | { |
1014 | "color": "red", |
1015 | "value": 80 |
1016 | } |
1017 | ] |
1018 | }, |
1019 | "unit": "bytes" |
1020 | }, |
1021 | "overrides": [] |
1022 | }, |
1023 | "gridPos": { |
1024 | "h": 8, |
1025 | "w": 5, |
1026 | "x": 15, |
1027 | "y": 6 |
1028 | }, |
1029 | "id": 28, |
1030 | "options": { |
1031 | "displayMode": "lcd", |
1032 | "maxVizHeight": 300, |
1033 | "minVizHeight": 16, |
1034 | "minVizWidth": 8, |
1035 | "namePlacement": "auto", |
1036 | "orientation": "horizontal", |
1037 | "reduceOptions": { |
1038 | "calcs": [], |
1039 | "fields": "", |
1040 | "limit": 10, |
1041 | "values": true |
1042 | }, |
1043 | "showUnfilled": true, |
1044 | "sizing": "auto", |
1045 | "valueMode": "color" |
1046 | }, |
1047 | "pluginVersion": "11.1.3", |
1048 | "targets": [ |
1049 | { |
1050 | "datasource": { |
1051 | "type": "grafana-clickhouse-datasource", |
1052 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1053 | }, |
1054 | "editorType": "sql", |
1055 | "format": 1, |
1056 | "meta": { |
1057 | "builderOptions": { |
1058 | "columns": [], |
1059 | "database": "", |
1060 | "limit": 1000, |
1061 | "mode": "list", |
1062 | "queryType": "table", |
1063 | "table": "" |
1064 | } |
1065 | }, |
1066 | "pluginVersion": "4.10.1", |
1067 | "queryType": "table", |
1068 | "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", |
1069 | "refId": "A" |
1070 | } |
1071 | ], |
1072 | "title": "Total Bytes Sent (MB)", |
1073 | "type": "bargauge" |
1074 | }, |
1075 | { |
1076 | "datasource": { |
1077 | "type": "grafana-clickhouse-datasource", |
1078 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1079 | }, |
1080 | "fieldConfig": { |
1081 | "defaults": { |
1082 | "color": { |
1083 | "mode": "continuous-GrYlRd" |
1084 | }, |
1085 | "mappings": [], |
1086 | "thresholds": { |
1087 | "mode": "absolute", |
1088 | "steps": [ |
1089 | { |
1090 | "color": "green", |
1091 | "value": null |
1092 | }, |
1093 | { |
1094 | "color": "red", |
1095 | "value": 80 |
1096 | } |
1097 | ] |
1098 | } |
1099 | }, |
1100 | "overrides": [] |
1101 | }, |
1102 | "gridPos": { |
1103 | "h": 8, |
1104 | "w": 4, |
1105 | "x": 20, |
1106 | "y": 6 |
1107 | }, |
1108 | "id": 9, |
1109 | "options": { |
1110 | "displayMode": "lcd", |
1111 | "maxVizHeight": 300, |
1112 | "minVizHeight": 16, |
1113 | "minVizWidth": 8, |
1114 | "namePlacement": "auto", |
1115 | "orientation": "horizontal", |
1116 | "reduceOptions": { |
1117 | "calcs": [], |
1118 | "fields": "", |
1119 | "limit": 10, |
1120 | "values": true |
1121 | }, |
1122 | "showUnfilled": true, |
1123 | "sizing": "auto", |
1124 | "valueMode": "color" |
1125 | }, |
1126 | "pluginVersion": "11.1.3", |
1127 | "targets": [ |
1128 | { |
1129 | "datasource": { |
1130 | "type": "grafana-clickhouse-datasource", |
1131 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1132 | }, |
1133 | "editorType": "sql", |
1134 | "format": 1, |
1135 | "meta": { |
1136 | "builderOptions": { |
1137 | "columns": [], |
1138 | "database": "", |
1139 | "limit": 1000, |
1140 | "mode": "list", |
1141 | "queryType": "table", |
1142 | "table": "" |
1143 | } |
1144 | }, |
1145 | "pluginVersion": "4.10.1", |
1146 | "queryType": "table", |
1147 | "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", |
1148 | "refId": "A" |
1149 | } |
1150 | ], |
1151 | "title": "500 Failure Rate%", |
1152 | "type": "bargauge" |
1153 | }, |
1154 | { |
1155 | "datasource": { |
1156 | "type": "grafana-clickhouse-datasource", |
1157 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1158 | }, |
1159 | "fieldConfig": { |
1160 | "defaults": { |
1161 | "color": { |
1162 | "mode": "palette-classic" |
1163 | }, |
1164 | "custom": { |
1165 | "axisBorderShow": false, |
1166 | "axisCenteredZero": false, |
1167 | "axisColorMode": "text", |
1168 | "axisLabel": "", |
1169 | "axisPlacement": "auto", |
1170 | "barAlignment": 0, |
1171 | "drawStyle": "line", |
1172 | "fillOpacity": 0, |
1173 | "gradientMode": "none", |
1174 | "hideFrom": { |
1175 | "legend": false, |
1176 | "tooltip": false, |
1177 | "viz": false |
1178 | }, |
1179 | "insertNulls": false, |
1180 | "lineInterpolation": "linear", |
1181 | "lineWidth": 1, |
1182 | "pointSize": 5, |
1183 | "scaleDistribution": { |
1184 | "type": "linear" |
1185 | }, |
1186 | "showPoints": "auto", |
1187 | "spanNulls": false, |
1188 | "stacking": { |
1189 | "group": "A", |
1190 | "mode": "none" |
1191 | }, |
1192 | "thresholdsStyle": { |
1193 | "mode": "off" |
1194 | } |
1195 | }, |
1196 | "mappings": [], |
1197 | "thresholds": { |
1198 | "mode": "percentage", |
1199 | "steps": [ |
1200 | { |
1201 | "color": "green", |
1202 | "value": null |
1203 | }, |
1204 | { |
1205 | "color": "orange", |
1206 | "value": 70 |
1207 | }, |
1208 | { |
1209 | "color": "red", |
1210 | "value": 85 |
1211 | } |
1212 | ] |
1213 | }, |
1214 | "unit": "ms" |
1215 | }, |
1216 | "overrides": [] |
1217 | }, |
1218 | "gridPos": { |
1219 | "h": 6, |
1220 | "w": 5, |
1221 | "x": 0, |
1222 | "y": 14 |
1223 | }, |
1224 | "id": 3, |
1225 | "options": { |
1226 | "legend": { |
1227 | "calcs": [], |
1228 | "displayMode": "list", |
1229 | "placement": "bottom", |
1230 | "showLegend": false |
1231 | }, |
1232 | "tooltip": { |
1233 | "mode": "single", |
1234 | "sort": "none" |
1235 | } |
1236 | }, |
1237 | "pluginVersion": "11.1.3", |
1238 | "targets": [ |
1239 | { |
1240 | "datasource": { |
1241 | "type": "grafana-clickhouse-datasource", |
1242 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1243 | }, |
1244 | "editorType": "sql", |
1245 | "format": 1, |
1246 | "meta": { |
1247 | "builderOptions": { |
1248 | "columns": [], |
1249 | "database": "", |
1250 | "limit": 1000, |
1251 | "mode": "list", |
1252 | "queryType": "table", |
1253 | "table": "" |
1254 | } |
1255 | }, |
1256 | "pluginVersion": "4.10.1", |
1257 | "queryType": "table", |
1258 | "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", |
1259 | "refId": "A" |
1260 | } |
1261 | ], |
1262 | "title": "Requests Latancy P95", |
1263 | "type": "timeseries" |
1264 | }, |
1265 | { |
1266 | "datasource": { |
1267 | "type": "grafana-clickhouse-datasource", |
1268 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1269 | }, |
1270 | "fieldConfig": { |
1271 | "defaults": { |
1272 | "color": { |
1273 | "mode": "palette-classic" |
1274 | }, |
1275 | "custom": { |
1276 | "axisBorderShow": false, |
1277 | "axisCenteredZero": false, |
1278 | "axisColorMode": "text", |
1279 | "axisLabel": "", |
1280 | "axisPlacement": "auto", |
1281 | "barAlignment": 0, |
1282 | "drawStyle": "line", |
1283 | "fillOpacity": 0, |
1284 | "gradientMode": "none", |
1285 | "hideFrom": { |
1286 | "legend": false, |
1287 | "tooltip": false, |
1288 | "viz": false |
1289 | }, |
1290 | "insertNulls": false, |
1291 | "lineInterpolation": "linear", |
1292 | "lineWidth": 1, |
1293 | "pointSize": 5, |
1294 | "scaleDistribution": { |
1295 | "type": "linear" |
1296 | }, |
1297 | "showPoints": "auto", |
1298 | "spanNulls": false, |
1299 | "stacking": { |
1300 | "group": "A", |
1301 | "mode": "none" |
1302 | }, |
1303 | "thresholdsStyle": { |
1304 | "mode": "off" |
1305 | } |
1306 | }, |
1307 | "mappings": [], |
1308 | "thresholds": { |
1309 | "mode": "absolute", |
1310 | "steps": [ |
1311 | { |
1312 | "color": "green", |
1313 | "value": null |
1314 | }, |
1315 | { |
1316 | "color": "red", |
1317 | "value": 80 |
1318 | } |
1319 | ] |
1320 | } |
1321 | }, |
1322 | "overrides": [] |
1323 | }, |
1324 | "gridPos": { |
1325 | "h": 6, |
1326 | "w": 5, |
1327 | "x": 5, |
1328 | "y": 14 |
1329 | }, |
1330 | "id": 10, |
1331 | "options": { |
1332 | "legend": { |
1333 | "calcs": [], |
1334 | "displayMode": "table", |
1335 | "placement": "bottom", |
1336 | "showLegend": false |
1337 | }, |
1338 | "tooltip": { |
1339 | "mode": "single", |
1340 | "sort": "none" |
1341 | } |
1342 | }, |
1343 | "targets": [ |
1344 | { |
1345 | "datasource": { |
1346 | "type": "grafana-clickhouse-datasource", |
1347 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1348 | }, |
1349 | "editorType": "sql", |
1350 | "format": 1, |
1351 | "meta": { |
1352 | "builderOptions": { |
1353 | "columns": [], |
1354 | "database": "", |
1355 | "limit": 1000, |
1356 | "mode": "list", |
1357 | "queryType": "table", |
1358 | "table": "" |
1359 | } |
1360 | }, |
1361 | "pluginVersion": "4.10.1", |
1362 | "queryType": "table", |
1363 | "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;", |
1364 | "refId": "A" |
1365 | } |
1366 | ], |
1367 | "title": "Incoming Unique IPs Count", |
1368 | "type": "timeseries" |
1369 | }, |
1370 | { |
1371 | "datasource": { |
1372 | "type": "grafana-clickhouse-datasource", |
1373 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1374 | }, |
1375 | "fieldConfig": { |
1376 | "defaults": { |
1377 | "color": { |
1378 | "mode": "palette-classic" |
1379 | }, |
1380 | "custom": { |
1381 | "axisBorderShow": false, |
1382 | "axisCenteredZero": false, |
1383 | "axisColorMode": "text", |
1384 | "axisLabel": "", |
1385 | "axisPlacement": "auto", |
1386 | "barAlignment": 0, |
1387 | "drawStyle": "line", |
1388 | "fillOpacity": 0, |
1389 | "gradientMode": "none", |
1390 | "hideFrom": { |
1391 | "legend": false, |
1392 | "tooltip": false, |
1393 | "viz": false |
1394 | }, |
1395 | "insertNulls": false, |
1396 | "lineInterpolation": "linear", |
1397 | "lineWidth": 1, |
1398 | "pointSize": 5, |
1399 | "scaleDistribution": { |
1400 | "type": "linear" |
1401 | }, |
1402 | "showPoints": "auto", |
1403 | "spanNulls": false, |
1404 | "stacking": { |
1405 | "group": "A", |
1406 | "mode": "none" |
1407 | }, |
1408 | "thresholdsStyle": { |
1409 | "mode": "off" |
1410 | } |
1411 | }, |
1412 | "mappings": [], |
1413 | "thresholds": { |
1414 | "mode": "absolute", |
1415 | "steps": [ |
1416 | { |
1417 | "color": "green", |
1418 | "value": null |
1419 | }, |
1420 | { |
1421 | "color": "red", |
1422 | "value": 80 |
1423 | } |
1424 | ] |
1425 | }, |
1426 | "unit": "ms" |
1427 | }, |
1428 | "overrides": [] |
1429 | }, |
1430 | "gridPos": { |
1431 | "h": 6, |
1432 | "w": 5, |
1433 | "x": 10, |
1434 | "y": 14 |
1435 | }, |
1436 | "id": 11, |
1437 | "options": { |
1438 | "legend": { |
1439 | "calcs": [], |
1440 | "displayMode": "table", |
1441 | "placement": "bottom", |
1442 | "showLegend": false |
1443 | }, |
1444 | "tooltip": { |
1445 | "mode": "single", |
1446 | "sort": "none" |
1447 | } |
1448 | }, |
1449 | "targets": [ |
1450 | { |
1451 | "datasource": { |
1452 | "type": "grafana-clickhouse-datasource", |
1453 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1454 | }, |
1455 | "editorType": "sql", |
1456 | "format": 1, |
1457 | "meta": { |
1458 | "builderOptions": { |
1459 | "columns": [], |
1460 | "database": "", |
1461 | "limit": 1000, |
1462 | "mode": "list", |
1463 | "queryType": "table", |
1464 | "table": "" |
1465 | } |
1466 | }, |
1467 | "pluginVersion": "4.10.1", |
1468 | "queryType": "table", |
1469 | "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;", |
1470 | "refId": "A" |
1471 | } |
1472 | ], |
1473 | "title": "Processing Requests Total Time Costs", |
1474 | "type": "timeseries" |
1475 | }, |
1476 | { |
1477 | "datasource": { |
1478 | "type": "grafana-clickhouse-datasource", |
1479 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1480 | }, |
1481 | "fieldConfig": { |
1482 | "defaults": { |
1483 | "color": { |
1484 | "mode": "palette-classic" |
1485 | }, |
1486 | "custom": { |
1487 | "axisBorderShow": false, |
1488 | "axisCenteredZero": false, |
1489 | "axisColorMode": "text", |
1490 | "axisLabel": "", |
1491 | "axisPlacement": "auto", |
1492 | "barAlignment": 0, |
1493 | "drawStyle": "line", |
1494 | "fillOpacity": 0, |
1495 | "gradientMode": "none", |
1496 | "hideFrom": { |
1497 | "legend": false, |
1498 | "tooltip": false, |
1499 | "viz": false |
1500 | }, |
1501 | "insertNulls": false, |
1502 | "lineInterpolation": "linear", |
1503 | "lineWidth": 1, |
1504 | "pointSize": 5, |
1505 | "scaleDistribution": { |
1506 | "type": "linear" |
1507 | }, |
1508 | "showPoints": "auto", |
1509 | "spanNulls": false, |
1510 | "stacking": { |
1511 | "group": "A", |
1512 | "mode": "none" |
1513 | }, |
1514 | "thresholdsStyle": { |
1515 | "mode": "off" |
1516 | } |
1517 | }, |
1518 | "mappings": [], |
1519 | "thresholds": { |
1520 | "mode": "absolute", |
1521 | "steps": [ |
1522 | { |
1523 | "color": "green", |
1524 | "value": null |
1525 | }, |
1526 | { |
1527 | "color": "red", |
1528 | "value": 80 |
1529 | } |
1530 | ] |
1531 | }, |
1532 | "unit": "binBps" |
1533 | }, |
1534 | "overrides": [] |
1535 | }, |
1536 | "gridPos": { |
1537 | "h": 6, |
1538 | "w": 5, |
1539 | "x": 15, |
1540 | "y": 14 |
1541 | }, |
1542 | "id": 12, |
1543 | "options": { |
1544 | "legend": { |
1545 | "calcs": [], |
1546 | "displayMode": "table", |
1547 | "placement": "bottom", |
1548 | "showLegend": false |
1549 | }, |
1550 | "tooltip": { |
1551 | "mode": "single", |
1552 | "sort": "none" |
1553 | } |
1554 | }, |
1555 | "targets": [ |
1556 | { |
1557 | "datasource": { |
1558 | "type": "grafana-clickhouse-datasource", |
1559 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1560 | }, |
1561 | "editorType": "sql", |
1562 | "format": 1, |
1563 | "meta": { |
1564 | "builderOptions": { |
1565 | "columns": [], |
1566 | "database": "", |
1567 | "limit": 1000, |
1568 | "mode": "list", |
1569 | "queryType": "table", |
1570 | "table": "" |
1571 | } |
1572 | }, |
1573 | "pluginVersion": "4.10.1", |
1574 | "queryType": "table", |
1575 | "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", |
1576 | "refId": "A" |
1577 | } |
1578 | ], |
1579 | "title": "Upload Bandwidth", |
1580 | "type": "timeseries" |
1581 | }, |
1582 | { |
1583 | "datasource": { |
1584 | "type": "grafana-clickhouse-datasource", |
1585 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1586 | }, |
1587 | "fieldConfig": { |
1588 | "defaults": { |
1589 | "color": { |
1590 | "mode": "palette-classic" |
1591 | }, |
1592 | "custom": { |
1593 | "axisBorderShow": false, |
1594 | "axisCenteredZero": false, |
1595 | "axisColorMode": "text", |
1596 | "axisLabel": "", |
1597 | "axisPlacement": "auto", |
1598 | "barAlignment": 0, |
1599 | "drawStyle": "line", |
1600 | "fillOpacity": 0, |
1601 | "gradientMode": "none", |
1602 | "hideFrom": { |
1603 | "legend": false, |
1604 | "tooltip": false, |
1605 | "viz": false |
1606 | }, |
1607 | "insertNulls": false, |
1608 | "lineInterpolation": "linear", |
1609 | "lineWidth": 1, |
1610 | "pointSize": 5, |
1611 | "scaleDistribution": { |
1612 | "type": "linear" |
1613 | }, |
1614 | "showPoints": "auto", |
1615 | "spanNulls": false, |
1616 | "stacking": { |
1617 | "group": "A", |
1618 | "mode": "none" |
1619 | }, |
1620 | "thresholdsStyle": { |
1621 | "mode": "off" |
1622 | } |
1623 | }, |
1624 | "mappings": [], |
1625 | "thresholds": { |
1626 | "mode": "absolute", |
1627 | "steps": [ |
1628 | { |
1629 | "color": "green", |
1630 | "value": null |
1631 | }, |
1632 | { |
1633 | "color": "red", |
1634 | "value": 80 |
1635 | } |
1636 | ] |
1637 | } |
1638 | }, |
1639 | "overrides": [] |
1640 | }, |
1641 | "gridPos": { |
1642 | "h": 6, |
1643 | "w": 4, |
1644 | "x": 20, |
1645 | "y": 14 |
1646 | }, |
1647 | "id": 13, |
1648 | "options": { |
1649 | "legend": { |
1650 | "calcs": [], |
1651 | "displayMode": "table", |
1652 | "placement": "bottom", |
1653 | "showLegend": false |
1654 | }, |
1655 | "tooltip": { |
1656 | "mode": "single", |
1657 | "sort": "none" |
1658 | } |
1659 | }, |
1660 | "targets": [ |
1661 | { |
1662 | "datasource": { |
1663 | "type": "grafana-clickhouse-datasource", |
1664 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1665 | }, |
1666 | "editorType": "sql", |
1667 | "format": 1, |
1668 | "meta": { |
1669 | "builderOptions": { |
1670 | "columns": [], |
1671 | "database": "", |
1672 | "limit": 1000, |
1673 | "mode": "list", |
1674 | "queryType": "table", |
1675 | "table": "" |
1676 | } |
1677 | }, |
1678 | "pluginVersion": "4.10.1", |
1679 | "queryType": "table", |
1680 | "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;", |
1681 | "refId": "A" |
1682 | } |
1683 | ], |
1684 | "title": "Requests 500 Count", |
1685 | "type": "timeseries" |
1686 | }, |
1687 | { |
1688 | "datasource": { |
1689 | "type": "grafana-clickhouse-datasource", |
1690 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1691 | }, |
1692 | "fieldConfig": { |
1693 | "defaults": { |
1694 | "color": { |
1695 | "mode": "thresholds" |
1696 | }, |
1697 | "mappings": [], |
1698 | "thresholds": { |
1699 | "mode": "absolute", |
1700 | "steps": [ |
1701 | { |
1702 | "color": "green", |
1703 | "value": null |
1704 | }, |
1705 | { |
1706 | "color": "red", |
1707 | "value": 80 |
1708 | } |
1709 | ] |
1710 | } |
1711 | }, |
1712 | "overrides": [] |
1713 | }, |
1714 | "gridPos": { |
1715 | "h": 8, |
1716 | "w": 9, |
1717 | "x": 0, |
1718 | "y": 20 |
1719 | }, |
1720 | "id": 15, |
1721 | "options": { |
1722 | "displayMode": "gradient", |
1723 | "maxVizHeight": 300, |
1724 | "minVizHeight": 16, |
1725 | "minVizWidth": 8, |
1726 | "namePlacement": "auto", |
1727 | "orientation": "horizontal", |
1728 | "reduceOptions": { |
1729 | "calcs": [ |
1730 | "lastNotNull" |
1731 | ], |
1732 | "fields": "/^requests$/", |
1733 | "limit": 25, |
1734 | "values": true |
1735 | }, |
1736 | "showUnfilled": true, |
1737 | "sizing": "auto", |
1738 | "valueMode": "color" |
1739 | }, |
1740 | "pluginVersion": "11.1.3", |
1741 | "targets": [ |
1742 | { |
1743 | "datasource": { |
1744 | "type": "grafana-clickhouse-datasource", |
1745 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1746 | }, |
1747 | "editorType": "sql", |
1748 | "format": 1, |
1749 | "meta": { |
1750 | "builderOptions": { |
1751 | "columns": [], |
1752 | "database": "", |
1753 | "limit": 1000, |
1754 | "mode": "list", |
1755 | "queryType": "table", |
1756 | "table": "" |
1757 | } |
1758 | }, |
1759 | "pluginVersion": "4.10.1", |
1760 | "queryType": "table", |
1761 | "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", |
1762 | "refId": "A" |
1763 | } |
1764 | ], |
1765 | "title": "Hot Interfaces", |
1766 | "type": "bargauge" |
1767 | }, |
1768 | { |
1769 | "datasource": { |
1770 | "type": "grafana-clickhouse-datasource", |
1771 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1772 | }, |
1773 | "fieldConfig": { |
1774 | "defaults": { |
1775 | "color": { |
1776 | "mode": "thresholds" |
1777 | }, |
1778 | "mappings": [], |
1779 | "thresholds": { |
1780 | "mode": "absolute", |
1781 | "steps": [ |
1782 | { |
1783 | "color": "green", |
1784 | "value": null |
1785 | }, |
1786 | { |
1787 | "color": "red", |
1788 | "value": 80 |
1789 | } |
1790 | ] |
1791 | }, |
1792 | "unit": "ms" |
1793 | }, |
1794 | "overrides": [] |
1795 | }, |
1796 | "gridPos": { |
1797 | "h": 8, |
1798 | "w": 9, |
1799 | "x": 9, |
1800 | "y": 20 |
1801 | }, |
1802 | "id": 18, |
1803 | "options": { |
1804 | "displayMode": "gradient", |
1805 | "maxVizHeight": 300, |
1806 | "minVizHeight": 16, |
1807 | "minVizWidth": 8, |
1808 | "namePlacement": "auto", |
1809 | "orientation": "horizontal", |
1810 | "reduceOptions": { |
1811 | "calcs": [ |
1812 | "lastNotNull" |
1813 | ], |
1814 | "fields": "/^avg_response_time_ms$/", |
1815 | "limit": 25, |
1816 | "values": true |
1817 | }, |
1818 | "showUnfilled": true, |
1819 | "sizing": "auto", |
1820 | "valueMode": "color" |
1821 | }, |
1822 | "pluginVersion": "11.1.3", |
1823 | "targets": [ |
1824 | { |
1825 | "datasource": { |
1826 | "type": "grafana-clickhouse-datasource", |
1827 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1828 | }, |
1829 | "editorType": "sql", |
1830 | "format": 1, |
1831 | "meta": { |
1832 | "builderOptions": { |
1833 | "columns": [], |
1834 | "database": "", |
1835 | "limit": 1000, |
1836 | "mode": "list", |
1837 | "queryType": "table", |
1838 | "table": "" |
1839 | } |
1840 | }, |
1841 | "pluginVersion": "4.10.1", |
1842 | "queryType": "table", |
1843 | "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", |
1844 | "refId": "A" |
1845 | } |
1846 | ], |
1847 | "title": "Slow Interface", |
1848 | "type": "bargauge" |
1849 | }, |
1850 | { |
1851 | "datasource": { |
1852 | "type": "grafana-clickhouse-datasource", |
1853 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1854 | }, |
1855 | "fieldConfig": { |
1856 | "defaults": { |
1857 | "color": { |
1858 | "mode": "thresholds" |
1859 | }, |
1860 | "mappings": [], |
1861 | "thresholds": { |
1862 | "mode": "absolute", |
1863 | "steps": [ |
1864 | { |
1865 | "color": "green", |
1866 | "value": null |
1867 | }, |
1868 | { |
1869 | "color": "red", |
1870 | "value": 80 |
1871 | } |
1872 | ] |
1873 | } |
1874 | }, |
1875 | "overrides": [] |
1876 | }, |
1877 | "gridPos": { |
1878 | "h": 8, |
1879 | "w": 6, |
1880 | "x": 18, |
1881 | "y": 20 |
1882 | }, |
1883 | "id": 14, |
1884 | "options": { |
1885 | "displayMode": "gradient", |
1886 | "maxVizHeight": 300, |
1887 | "minVizHeight": 16, |
1888 | "minVizWidth": 8, |
1889 | "namePlacement": "auto", |
1890 | "orientation": "horizontal", |
1891 | "reduceOptions": { |
1892 | "calcs": [ |
1893 | "lastNotNull" |
1894 | ], |
1895 | "fields": "/^count$/", |
1896 | "limit": 20, |
1897 | "values": true |
1898 | }, |
1899 | "showUnfilled": false, |
1900 | "sizing": "auto", |
1901 | "valueMode": "color" |
1902 | }, |
1903 | "pluginVersion": "11.1.3", |
1904 | "targets": [ |
1905 | { |
1906 | "datasource": { |
1907 | "type": "grafana-clickhouse-datasource", |
1908 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1909 | }, |
1910 | "editorType": "sql", |
1911 | "format": 1, |
1912 | "meta": { |
1913 | "builderOptions": { |
1914 | "columns": [], |
1915 | "database": "", |
1916 | "limit": 1000, |
1917 | "mode": "list", |
1918 | "queryType": "table", |
1919 | "table": "" |
1920 | } |
1921 | }, |
1922 | "pluginVersion": "4.10.1", |
1923 | "queryType": "table", |
1924 | "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;", |
1925 | "refId": "A" |
1926 | } |
1927 | ], |
1928 | "title": "Incoming IPs", |
1929 | "type": "bargauge" |
1930 | }, |
1931 | { |
1932 | "datasource": { |
1933 | "type": "grafana-clickhouse-datasource", |
1934 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1935 | }, |
1936 | "fieldConfig": { |
1937 | "defaults": { |
1938 | "color": { |
1939 | "mode": "thresholds" |
1940 | }, |
1941 | "mappings": [], |
1942 | "thresholds": { |
1943 | "mode": "absolute", |
1944 | "steps": [ |
1945 | { |
1946 | "color": "green", |
1947 | "value": null |
1948 | }, |
1949 | { |
1950 | "color": "red", |
1951 | "value": 80 |
1952 | } |
1953 | ] |
1954 | } |
1955 | }, |
1956 | "overrides": [] |
1957 | }, |
1958 | "gridPos": { |
1959 | "h": 8, |
1960 | "w": 9, |
1961 | "x": 0, |
1962 | "y": 28 |
1963 | }, |
1964 | "id": 16, |
1965 | "options": { |
1966 | "displayMode": "gradient", |
1967 | "maxVizHeight": 300, |
1968 | "minVizHeight": 16, |
1969 | "minVizWidth": 8, |
1970 | "namePlacement": "auto", |
1971 | "orientation": "horizontal", |
1972 | "reduceOptions": { |
1973 | "calcs": [ |
1974 | "lastNotNull" |
1975 | ], |
1976 | "fields": "/^requests$/", |
1977 | "limit": 25, |
1978 | "values": true |
1979 | }, |
1980 | "showUnfilled": true, |
1981 | "sizing": "auto", |
1982 | "valueMode": "color" |
1983 | }, |
1984 | "pluginVersion": "11.1.3", |
1985 | "targets": [ |
1986 | { |
1987 | "datasource": { |
1988 | "type": "grafana-clickhouse-datasource", |
1989 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
1990 | }, |
1991 | "editorType": "sql", |
1992 | "format": 1, |
1993 | "meta": { |
1994 | "builderOptions": { |
1995 | "columns": [], |
1996 | "database": "", |
1997 | "limit": 1000, |
1998 | "mode": "list", |
1999 | "queryType": "table", |
2000 | "table": "" |
2001 | } |
2002 | }, |
2003 | "pluginVersion": "4.10.1", |
2004 | "queryType": "table", |
2005 | "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", |
2006 | "refId": "A" |
2007 | } |
2008 | ], |
2009 | "title": "Error Interface", |
2010 | "type": "bargauge" |
2011 | }, |
2012 | { |
2013 | "datasource": { |
2014 | "type": "grafana-clickhouse-datasource", |
2015 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
2016 | }, |
2017 | "fieldConfig": { |
2018 | "defaults": { |
2019 | "color": { |
2020 | "mode": "thresholds" |
2021 | }, |
2022 | "mappings": [], |
2023 | "thresholds": { |
2024 | "mode": "absolute", |
2025 | "steps": [ |
2026 | { |
2027 | "color": "green", |
2028 | "value": null |
2029 | }, |
2030 | { |
2031 | "color": "red", |
2032 | "value": 80 |
2033 | } |
2034 | ] |
2035 | } |
2036 | }, |
2037 | "overrides": [] |
2038 | }, |
2039 | "gridPos": { |
2040 | "h": 8, |
2041 | "w": 9, |
2042 | "x": 9, |
2043 | "y": 28 |
2044 | }, |
2045 | "id": 17, |
2046 | "options": { |
2047 | "displayMode": "gradient", |
2048 | "maxVizHeight": 300, |
2049 | "minVizHeight": 16, |
2050 | "minVizWidth": 8, |
2051 | "namePlacement": "auto", |
2052 | "orientation": "horizontal", |
2053 | "reduceOptions": { |
2054 | "calcs": [ |
2055 | "lastNotNull" |
2056 | ], |
2057 | "fields": "/^failure_rate_percent$/", |
2058 | "limit": 25, |
2059 | "values": true |
2060 | }, |
2061 | "showUnfilled": true, |
2062 | "sizing": "auto", |
2063 | "valueMode": "color" |
2064 | }, |
2065 | "pluginVersion": "11.1.3", |
2066 | "targets": [ |
2067 | { |
2068 | "datasource": { |
2069 | "type": "grafana-clickhouse-datasource", |
2070 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
2071 | }, |
2072 | "editorType": "sql", |
2073 | "format": 1, |
2074 | "meta": { |
2075 | "builderOptions": { |
2076 | "columns": [], |
2077 | "database": "", |
2078 | "limit": 1000, |
2079 | "mode": "list", |
2080 | "queryType": "table", |
2081 | "table": "" |
2082 | } |
2083 | }, |
2084 | "pluginVersion": "4.10.1", |
2085 | "queryType": "table", |
2086 | "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", |
2087 | "refId": "A" |
2088 | } |
2089 | ], |
2090 | "title": "Error Rate Interface", |
2091 | "type": "bargauge" |
2092 | }, |
2093 | { |
2094 | "datasource": { |
2095 | "type": "grafana-clickhouse-datasource", |
2096 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
2097 | }, |
2098 | "fieldConfig": { |
2099 | "defaults": { |
2100 | "color": { |
2101 | "mode": "thresholds" |
2102 | }, |
2103 | "mappings": [], |
2104 | "thresholds": { |
2105 | "mode": "absolute", |
2106 | "steps": [ |
2107 | { |
2108 | "color": "green", |
2109 | "value": null |
2110 | }, |
2111 | { |
2112 | "color": "red", |
2113 | "value": 80 |
2114 | } |
2115 | ] |
2116 | }, |
2117 | "unit": "bytes" |
2118 | }, |
2119 | "overrides": [] |
2120 | }, |
2121 | "gridPos": { |
2122 | "h": 8, |
2123 | "w": 6, |
2124 | "x": 18, |
2125 | "y": 28 |
2126 | }, |
2127 | "id": 32, |
2128 | "options": { |
2129 | "displayMode": "gradient", |
2130 | "maxVizHeight": 300, |
2131 | "minVizHeight": 16, |
2132 | "minVizWidth": 8, |
2133 | "namePlacement": "auto", |
2134 | "orientation": "horizontal", |
2135 | "reduceOptions": { |
2136 | "calcs": [ |
2137 | "lastNotNull" |
2138 | ], |
2139 | "fields": "/^total_bytes_sent$/", |
2140 | "limit": 20, |
2141 | "values": true |
2142 | }, |
2143 | "showUnfilled": false, |
2144 | "sizing": "auto", |
2145 | "valueMode": "color" |
2146 | }, |
2147 | "pluginVersion": "11.1.3", |
2148 | "targets": [ |
2149 | { |
2150 | "datasource": { |
2151 | "type": "grafana-clickhouse-datasource", |
2152 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
2153 | }, |
2154 | "editorType": "sql", |
2155 | "format": 1, |
2156 | "meta": { |
2157 | "builderOptions": { |
2158 | "columns": [], |
2159 | "database": "", |
2160 | "limit": 1000, |
2161 | "mode": "list", |
2162 | "queryType": "table", |
2163 | "table": "" |
2164 | } |
2165 | }, |
2166 | "pluginVersion": "4.10.1", |
2167 | "queryType": "table", |
2168 | "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", |
2169 | "refId": "A" |
2170 | } |
2171 | ], |
2172 | "title": "Sent data to IPs", |
2173 | "type": "bargauge" |
2174 | }, |
2175 | { |
2176 | "datasource": { |
2177 | "type": "grafana-clickhouse-datasource", |
2178 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
2179 | }, |
2180 | "fieldConfig": { |
2181 | "defaults": { |
2182 | "color": { |
2183 | "mode": "thresholds" |
2184 | }, |
2185 | "custom": { |
2186 | "align": "auto", |
2187 | "cellOptions": { |
2188 | "type": "auto" |
2189 | }, |
2190 | "inspect": false |
2191 | }, |
2192 | "mappings": [], |
2193 | "thresholds": { |
2194 | "mode": "absolute", |
2195 | "steps": [ |
2196 | { |
2197 | "color": "green", |
2198 | "value": null |
2199 | }, |
2200 | { |
2201 | "color": "red", |
2202 | "value": 80 |
2203 | } |
2204 | ] |
2205 | } |
2206 | }, |
2207 | "overrides": [] |
2208 | }, |
2209 | "gridPos": { |
2210 | "h": 9, |
2211 | "w": 24, |
2212 | "x": 0, |
2213 | "y": 36 |
2214 | }, |
2215 | "id": 1, |
2216 | "options": { |
2217 | "cellHeight": "sm", |
2218 | "footer": { |
2219 | "countRows": false, |
2220 | "fields": "", |
2221 | "reducer": [ |
2222 | "sum" |
2223 | ], |
2224 | "show": false |
2225 | }, |
2226 | "showHeader": true, |
2227 | "sortBy": [ |
2228 | { |
2229 | "desc": false, |
2230 | "displayName": "status" |
2231 | } |
2232 | ] |
2233 | }, |
2234 | "pluginVersion": "11.1.3", |
2235 | "targets": [ |
2236 | { |
2237 | "builderOptions": { |
2238 | "aggregates": [], |
2239 | "columns": [ |
2240 | { |
2241 | "alias": "level", |
2242 | "custom": false, |
2243 | "name": "level", |
2244 | "type": "LowCardinality(String)" |
2245 | }, |
2246 | { |
2247 | "alias": "remote_ip", |
2248 | "custom": false, |
2249 | "name": "remote_ip", |
2250 | "type": "String" |
2251 | } |
2252 | ], |
2253 | "database": "logs", |
2254 | "filters": [], |
2255 | "groupBy": [], |
2256 | "limit": 1000, |
2257 | "meta": {}, |
2258 | "mode": "list", |
2259 | "orderBy": [], |
2260 | "queryType": "table", |
2261 | "table": "caddy_requests" |
2262 | }, |
2263 | "datasource": { |
2264 | "type": "grafana-clickhouse-datasource", |
2265 | "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}" |
2266 | }, |
2267 | "editorType": "sql", |
2268 | "format": 1, |
2269 | "meta": { |
2270 | "builderOptions": { |
2271 | "aggregates": [], |
2272 | "columns": [ |
2273 | { |
2274 | "alias": "level", |
2275 | "custom": false, |
2276 | "name": "level", |
2277 | "type": "LowCardinality(String)" |
2278 | }, |
2279 | { |
2280 | "alias": "remote_ip", |
2281 | "custom": false, |
2282 | "name": "remote_ip", |
2283 | "type": "String" |
2284 | } |
2285 | ], |
2286 | "database": "logs", |
2287 | "filters": [], |
2288 | "groupBy": [], |
2289 | "limit": 1000, |
2290 | "meta": {}, |
2291 | "mode": "list", |
2292 | "orderBy": [], |
2293 | "queryType": "table", |
2294 | "table": "caddy_requests" |
2295 | } |
2296 | }, |
2297 | "pluginVersion": "4.10.1", |
2298 | "queryType": "table", |
2299 | "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", |
2300 | "refId": "Hot Application" |
2301 | } |
2302 | ], |
2303 | "title": "RAW", |
2304 | "type": "table" |
2305 | } |
2306 | ], |
2307 | "refresh": "", |
2308 | "schemaVersion": 39, |
2309 | "tags": [], |
2310 | "templating": { |
2311 | "list": [ |
2312 | { |
2313 | "current": { |
2314 | "selected": false, |
2315 | "text": "", |
2316 | "value": "" |
2317 | }, |
2318 | "description": "Application", |
2319 | "hide": 0, |
2320 | "label": "Application", |
2321 | "name": "Application", |
2322 | "options": [ |
2323 | { |
2324 | "selected": true, |
2325 | "text": "", |
2326 | "value": "" |
2327 | } |
2328 | ], |
2329 | "query": "", |
2330 | "skipUrlSync": false, |
2331 | "type": "textbox" |
2332 | }, |
2333 | { |
2334 | "current": { |
2335 | "selected": false, |
2336 | "text": "", |
2337 | "value": "" |
2338 | }, |
2339 | "description": "IP", |
2340 | "hide": 0, |
2341 | "label": "IP", |
2342 | "name": "IP", |
2343 | "options": [ |
2344 | { |
2345 | "selected": true, |
2346 | "text": "", |
2347 | "value": "" |
2348 | } |
2349 | ], |
2350 | "query": "", |
2351 | "skipUrlSync": false, |
2352 | "type": "textbox" |
2353 | } |
2354 | ] |
2355 | }, |
2356 | "time": { |
2357 | "from": "now-6h", |
2358 | "to": "now" |
2359 | }, |
2360 | "timepicker": {}, |
2361 | "timezone": "browser", |
2362 | "title": "Caddy", |
2363 | "uid": "eet9bprvewlq8e", |
2364 | "version": 46, |
2365 | "weekStart": "" |
2366 | } |