最終更新 1754238419

anduin's Avatar anduin revised this gist 1754238419. Go to revision

1 file changed, 2297 insertions, 25 deletions

clickhouse.json

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

anduin's Avatar anduin revised this gist 1753708357. Go to revision

1 file changed, 86 insertions, 135 deletions

grafana.json

@@ -1,59 +1,4 @@
1 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 2 "annotations": {
58 3 "list": [
59 4 {
@@ -73,14 +18,14 @@
73 18 "editable": true,
74 19 "fiscalYearStartMonth": 0,
75 20 "graphTooltip": 0,
76 - "id": null,
21 + "id": 3,
77 22 "links": [],
78 23 "liveNow": true,
79 24 "panels": [
80 25 {
81 26 "datasource": {
82 27 "type": "grafana-clickhouse-datasource",
83 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
28 + "uid": "fet9b6miuomwwf"
84 29 },
85 30 "fieldConfig": {
86 31 "defaults": {
@@ -136,7 +81,7 @@
136 81 {
137 82 "datasource": {
138 83 "type": "grafana-clickhouse-datasource",
139 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
84 + "uid": "fet9b6miuomwwf"
140 85 },
141 86 "editorType": "sql",
142 87 "format": 1,
@@ -162,7 +107,7 @@
162 107 {
163 108 "datasource": {
164 109 "type": "grafana-clickhouse-datasource",
165 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
110 + "uid": "fet9b6miuomwwf"
166 111 },
167 112 "fieldConfig": {
168 113 "defaults": {
@@ -217,7 +162,7 @@
217 162 {
218 163 "datasource": {
219 164 "type": "grafana-clickhouse-datasource",
220 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
165 + "uid": "fet9b6miuomwwf"
221 166 },
222 167 "editorType": "sql",
223 168 "format": 1,
@@ -243,7 +188,7 @@
243 188 {
244 189 "datasource": {
245 190 "type": "grafana-clickhouse-datasource",
246 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
191 + "uid": "fet9b6miuomwwf"
247 192 },
248 193 "fieldConfig": {
249 194 "defaults": {
@@ -295,7 +240,7 @@
295 240 {
296 241 "datasource": {
297 242 "type": "grafana-clickhouse-datasource",
298 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
243 + "uid": "fet9b6miuomwwf"
299 244 },
300 245 "editorType": "sql",
301 246 "format": 1,
@@ -321,12 +266,12 @@
321 266 {
322 267 "datasource": {
323 268 "type": "grafana-clickhouse-datasource",
324 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
269 + "uid": "fet9b6miuomwwf"
325 270 },
326 271 "fieldConfig": {
327 272 "defaults": {
328 273 "color": {
329 - "mode": "continuous-GrYlRd"
274 + "mode": "palette-classic"
330 275 },
331 276 "mappings": [],
332 277 "thresholds": {
@@ -341,7 +286,8 @@
341 286 "value": 80
342 287 }
343 288 ]
344 - }
289 + },
290 + "unit": "short"
345 291 },
346 292 "overrides": []
347 293 },
@@ -373,7 +319,7 @@
373 319 {
374 320 "datasource": {
375 321 "type": "grafana-clickhouse-datasource",
376 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
322 + "uid": "fet9b6miuomwwf"
377 323 },
378 324 "editorType": "sql",
379 325 "format": 1,
@@ -399,7 +345,7 @@
399 345 {
400 346 "datasource": {
401 347 "type": "grafana-clickhouse-datasource",
402 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
348 + "uid": "fet9b6miuomwwf"
403 349 },
404 350 "fieldConfig": {
405 351 "defaults": {
@@ -407,7 +353,7 @@
407 353 "mode": "thresholds"
408 354 },
409 355 "mappings": [],
410 - "max": 500,
356 + "max": 700,
411 357 "min": 0,
412 358 "thresholds": {
413 359 "mode": "absolute",
@@ -418,7 +364,7 @@
418 364 },
419 365 {
420 366 "color": "red",
421 - "value": 190
367 + "value": 240
422 368 }
423 369 ]
424 370 },
@@ -456,7 +402,7 @@
456 402 {
457 403 "datasource": {
458 404 "type": "grafana-clickhouse-datasource",
459 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
405 + "uid": "fet9b6miuomwwf"
460 406 },
461 407 "editorType": "sql",
462 408 "format": 1,
@@ -482,7 +428,7 @@
482 428 {
483 429 "datasource": {
484 430 "type": "grafana-clickhouse-datasource",
485 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
431 + "uid": "fet9b6miuomwwf"
486 432 },
487 433 "fieldConfig": {
488 434 "defaults": {
@@ -565,7 +511,7 @@
565 511 {
566 512 "datasource": {
567 513 "type": "grafana-clickhouse-datasource",
568 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
514 + "uid": "fet9b6miuomwwf"
569 515 },
570 516 "editorType": "sql",
571 517 "format": 1,
@@ -591,7 +537,7 @@
591 537 {
592 538 "datasource": {
593 539 "type": "grafana-clickhouse-datasource",
594 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
540 + "uid": "fet9b6miuomwwf"
595 541 },
596 542 "fieldConfig": {
597 543 "defaults": {
@@ -648,7 +594,7 @@
648 594 {
649 595 "datasource": {
650 596 "type": "grafana-clickhouse-datasource",
651 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
597 + "uid": "fet9b6miuomwwf"
652 598 },
653 599 "editorType": "sql",
654 600 "format": 1,
@@ -674,7 +620,7 @@
674 620 {
675 621 "datasource": {
676 622 "type": "grafana-clickhouse-datasource",
677 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
623 + "uid": "fet9b6miuomwwf"
678 624 },
679 625 "fieldConfig": {
680 626 "defaults": {
@@ -682,7 +628,7 @@
682 628 "mode": "thresholds"
683 629 },
684 630 "mappings": [],
685 - "max": 19,
631 + "max": 16,
686 632 "min": 0,
687 633 "thresholds": {
688 634 "mode": "absolute",
@@ -731,7 +677,7 @@
731 677 {
732 678 "datasource": {
733 679 "type": "grafana-clickhouse-datasource",
734 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
680 + "uid": "fet9b6miuomwwf"
735 681 },
736 682 "editorType": "sql",
737 683 "format": 1,
@@ -757,7 +703,7 @@
757 703 {
758 704 "datasource": {
759 705 "type": "grafana-clickhouse-datasource",
760 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
706 + "uid": "fet9b6miuomwwf"
761 707 },
762 708 "fieldConfig": {
763 709 "defaults": {
@@ -810,7 +756,7 @@
810 756 {
811 757 "datasource": {
812 758 "type": "grafana-clickhouse-datasource",
813 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
759 + "uid": "fet9b6miuomwwf"
814 760 },
815 761 "editorType": "sql",
816 762 "format": 1,
@@ -836,7 +782,7 @@
836 782 {
837 783 "datasource": {
838 784 "type": "grafana-clickhouse-datasource",
839 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
785 + "uid": "fet9b6miuomwwf"
840 786 },
841 787 "fieldConfig": {
842 788 "defaults": {
@@ -889,7 +835,7 @@
889 835 {
890 836 "datasource": {
891 837 "type": "grafana-clickhouse-datasource",
892 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
838 + "uid": "fet9b6miuomwwf"
893 839 },
894 840 "editorType": "sql",
895 841 "format": 1,
@@ -915,7 +861,7 @@
915 861 {
916 862 "datasource": {
917 863 "type": "grafana-clickhouse-datasource",
918 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
864 + "uid": "fet9b6miuomwwf"
919 865 },
920 866 "fieldConfig": {
921 867 "defaults": {
@@ -969,7 +915,7 @@
969 915 {
970 916 "datasource": {
971 917 "type": "grafana-clickhouse-datasource",
972 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
918 + "uid": "fet9b6miuomwwf"
973 919 },
974 920 "editorType": "sql",
975 921 "format": 1,
@@ -995,7 +941,7 @@
995 941 {
996 942 "datasource": {
997 943 "type": "grafana-clickhouse-datasource",
998 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
944 + "uid": "fet9b6miuomwwf"
999 945 },
1000 946 "fieldConfig": {
1001 947 "defaults": {
@@ -1049,7 +995,7 @@
1049 995 {
1050 996 "datasource": {
1051 997 "type": "grafana-clickhouse-datasource",
1052 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
998 + "uid": "fet9b6miuomwwf"
1053 999 },
1054 1000 "editorType": "sql",
1055 1001 "format": 1,
@@ -1075,7 +1021,7 @@
1075 1021 {
1076 1022 "datasource": {
1077 1023 "type": "grafana-clickhouse-datasource",
1078 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1024 + "uid": "fet9b6miuomwwf"
1079 1025 },
1080 1026 "fieldConfig": {
1081 1027 "defaults": {
@@ -1128,7 +1074,7 @@
1128 1074 {
1129 1075 "datasource": {
1130 1076 "type": "grafana-clickhouse-datasource",
1131 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1077 + "uid": "fet9b6miuomwwf"
1132 1078 },
1133 1079 "editorType": "sql",
1134 1080 "format": 1,
@@ -1154,7 +1100,7 @@
1154 1100 {
1155 1101 "datasource": {
1156 1102 "type": "grafana-clickhouse-datasource",
1157 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1103 + "uid": "fet9b6miuomwwf"
1158 1104 },
1159 1105 "fieldConfig": {
1160 1106 "defaults": {
@@ -1239,7 +1185,7 @@
1239 1185 {
1240 1186 "datasource": {
1241 1187 "type": "grafana-clickhouse-datasource",
1242 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1188 + "uid": "fet9b6miuomwwf"
1243 1189 },
1244 1190 "editorType": "sql",
1245 1191 "format": 1,
@@ -1265,7 +1211,7 @@
1265 1211 {
1266 1212 "datasource": {
1267 1213 "type": "grafana-clickhouse-datasource",
1268 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1214 + "uid": "fet9b6miuomwwf"
1269 1215 },
1270 1216 "fieldConfig": {
1271 1217 "defaults": {
@@ -1344,7 +1290,7 @@
1344 1290 {
1345 1291 "datasource": {
1346 1292 "type": "grafana-clickhouse-datasource",
1347 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1293 + "uid": "fet9b6miuomwwf"
1348 1294 },
1349 1295 "editorType": "sql",
1350 1296 "format": 1,
@@ -1370,7 +1316,7 @@
1370 1316 {
1371 1317 "datasource": {
1372 1318 "type": "grafana-clickhouse-datasource",
1373 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1319 + "uid": "fet9b6miuomwwf"
1374 1320 },
1375 1321 "fieldConfig": {
1376 1322 "defaults": {
@@ -1384,7 +1330,7 @@
1384 1330 "axisLabel": "",
1385 1331 "axisPlacement": "auto",
1386 1332 "barAlignment": 0,
1387 - "drawStyle": "line",
1333 + "drawStyle": "points",
1388 1334 "fillOpacity": 0,
1389 1335 "gradientMode": "none",
1390 1336 "hideFrom": {
@@ -1395,7 +1341,7 @@
1395 1341 "insertNulls": false,
1396 1342 "lineInterpolation": "linear",
1397 1343 "lineWidth": 1,
1398 - "pointSize": 5,
1344 + "pointSize": 3,
1399 1345 "scaleDistribution": {
1400 1346 "type": "linear"
1401 1347 },
@@ -1450,7 +1396,7 @@
1450 1396 {
1451 1397 "datasource": {
1452 1398 "type": "grafana-clickhouse-datasource",
1453 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1399 + "uid": "fet9b6miuomwwf"
1454 1400 },
1455 1401 "editorType": "sql",
1456 1402 "format": 1,
@@ -1476,7 +1422,7 @@
1476 1422 {
1477 1423 "datasource": {
1478 1424 "type": "grafana-clickhouse-datasource",
1479 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1425 + "uid": "fet9b6miuomwwf"
1480 1426 },
1481 1427 "fieldConfig": {
1482 1428 "defaults": {
@@ -1556,7 +1502,7 @@
1556 1502 {
1557 1503 "datasource": {
1558 1504 "type": "grafana-clickhouse-datasource",
1559 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1505 + "uid": "fet9b6miuomwwf"
1560 1506 },
1561 1507 "editorType": "sql",
1562 1508 "format": 1,
@@ -1582,21 +1528,22 @@
1582 1528 {
1583 1529 "datasource": {
1584 1530 "type": "grafana-clickhouse-datasource",
1585 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1531 + "uid": "fet9b6miuomwwf"
1586 1532 },
1587 1533 "fieldConfig": {
1588 1534 "defaults": {
1589 1535 "color": {
1590 - "mode": "palette-classic"
1536 + "fixedColor": "dark-red",
1537 + "mode": "fixed"
1591 1538 },
1592 1539 "custom": {
1593 1540 "axisBorderShow": false,
1594 1541 "axisCenteredZero": false,
1595 - "axisColorMode": "text",
1542 + "axisColorMode": "series",
1596 1543 "axisLabel": "",
1597 1544 "axisPlacement": "auto",
1598 1545 "barAlignment": 0,
1599 - "drawStyle": "line",
1546 + "drawStyle": "points",
1600 1547 "fillOpacity": 0,
1601 1548 "gradientMode": "none",
1602 1549 "hideFrom": {
@@ -1607,7 +1554,7 @@
1607 1554 "insertNulls": false,
1608 1555 "lineInterpolation": "linear",
1609 1556 "lineWidth": 1,
1610 - "pointSize": 5,
1557 + "pointSize": 2,
1611 1558 "scaleDistribution": {
1612 1559 "type": "linear"
1613 1560 },
@@ -1661,7 +1608,7 @@
1661 1608 {
1662 1609 "datasource": {
1663 1610 "type": "grafana-clickhouse-datasource",
1664 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1611 + "uid": "fet9b6miuomwwf"
1665 1612 },
1666 1613 "editorType": "sql",
1667 1614 "format": 1,
@@ -1687,12 +1634,12 @@
1687 1634 {
1688 1635 "datasource": {
1689 1636 "type": "grafana-clickhouse-datasource",
1690 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1637 + "uid": "fet9b6miuomwwf"
1691 1638 },
1692 1639 "fieldConfig": {
1693 1640 "defaults": {
1694 1641 "color": {
1695 - "mode": "thresholds"
1642 + "mode": "continuous-BlYlRd"
1696 1643 },
1697 1644 "mappings": [],
1698 1645 "thresholds": {
@@ -1707,7 +1654,8 @@
1707 1654 "value": 80
1708 1655 }
1709 1656 ]
1710 - }
1657 + },
1658 + "unit": "short"
1711 1659 },
1712 1660 "overrides": []
1713 1661 },
@@ -1733,7 +1681,7 @@
1733 1681 "limit": 25,
1734 1682 "values": true
1735 1683 },
1736 - "showUnfilled": true,
1684 + "showUnfilled": false,
1737 1685 "sizing": "auto",
1738 1686 "valueMode": "color"
1739 1687 },
@@ -1742,7 +1690,7 @@
1742 1690 {
1743 1691 "datasource": {
1744 1692 "type": "grafana-clickhouse-datasource",
1745 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1693 + "uid": "fet9b6miuomwwf"
1746 1694 },
1747 1695 "editorType": "sql",
1748 1696 "format": 1,
@@ -1768,12 +1716,12 @@
1768 1716 {
1769 1717 "datasource": {
1770 1718 "type": "grafana-clickhouse-datasource",
1771 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1719 + "uid": "fet9b6miuomwwf"
1772 1720 },
1773 1721 "fieldConfig": {
1774 1722 "defaults": {
1775 1723 "color": {
1776 - "mode": "thresholds"
1724 + "mode": "continuous-GrYlRd"
1777 1725 },
1778 1726 "mappings": [],
1779 1727 "thresholds": {
@@ -1815,7 +1763,7 @@
1815 1763 "limit": 25,
1816 1764 "values": true
1817 1765 },
1818 - "showUnfilled": true,
1766 + "showUnfilled": false,
1819 1767 "sizing": "auto",
1820 1768 "valueMode": "color"
1821 1769 },
@@ -1824,7 +1772,7 @@
1824 1772 {
1825 1773 "datasource": {
1826 1774 "type": "grafana-clickhouse-datasource",
1827 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1775 + "uid": "fet9b6miuomwwf"
1828 1776 },
1829 1777 "editorType": "sql",
1830 1778 "format": 1,
@@ -1850,12 +1798,12 @@
1850 1798 {
1851 1799 "datasource": {
1852 1800 "type": "grafana-clickhouse-datasource",
1853 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1801 + "uid": "fet9b6miuomwwf"
1854 1802 },
1855 1803 "fieldConfig": {
1856 1804 "defaults": {
1857 1805 "color": {
1858 - "mode": "thresholds"
1806 + "mode": "continuous-GrYlRd"
1859 1807 },
1860 1808 "mappings": [],
1861 1809 "thresholds": {
@@ -1870,7 +1818,8 @@
1870 1818 "value": 80
1871 1819 }
1872 1820 ]
1873 - }
1821 + },
1822 + "unit": "short"
1874 1823 },
1875 1824 "overrides": []
1876 1825 },
@@ -1905,7 +1854,7 @@
1905 1854 {
1906 1855 "datasource": {
1907 1856 "type": "grafana-clickhouse-datasource",
1908 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1857 + "uid": "fet9b6miuomwwf"
1909 1858 },
1910 1859 "editorType": "sql",
1911 1860 "format": 1,
@@ -1931,12 +1880,12 @@
1931 1880 {
1932 1881 "datasource": {
1933 1882 "type": "grafana-clickhouse-datasource",
1934 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1883 + "uid": "fet9b6miuomwwf"
1935 1884 },
1936 1885 "fieldConfig": {
1937 1886 "defaults": {
1938 1887 "color": {
1939 - "mode": "thresholds"
1888 + "mode": "continuous-GrYlRd"
1940 1889 },
1941 1890 "mappings": [],
1942 1891 "thresholds": {
@@ -1951,7 +1900,8 @@
1951 1900 "value": 80
1952 1901 }
1953 1902 ]
1954 - }
1903 + },
1904 + "unit": "short"
1955 1905 },
1956 1906 "overrides": []
1957 1907 },
@@ -1977,7 +1927,7 @@
1977 1927 "limit": 25,
1978 1928 "values": true
1979 1929 },
1980 - "showUnfilled": true,
1930 + "showUnfilled": false,
1981 1931 "sizing": "auto",
1982 1932 "valueMode": "color"
1983 1933 },
@@ -1986,7 +1936,7 @@
1986 1936 {
1987 1937 "datasource": {
1988 1938 "type": "grafana-clickhouse-datasource",
1989 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1939 + "uid": "fet9b6miuomwwf"
1990 1940 },
1991 1941 "editorType": "sql",
1992 1942 "format": 1,
@@ -2012,12 +1962,12 @@
2012 1962 {
2013 1963 "datasource": {
2014 1964 "type": "grafana-clickhouse-datasource",
2015 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
1965 + "uid": "fet9b6miuomwwf"
2016 1966 },
2017 1967 "fieldConfig": {
2018 1968 "defaults": {
2019 1969 "color": {
2020 - "mode": "thresholds"
1970 + "mode": "continuous-GrYlRd"
2021 1971 },
2022 1972 "mappings": [],
2023 1973 "thresholds": {
@@ -2032,7 +1982,8 @@
2032 1982 "value": 80
2033 1983 }
2034 1984 ]
2035 - }
1985 + },
1986 + "unit": "percent"
2036 1987 },
2037 1988 "overrides": []
2038 1989 },
@@ -2044,7 +1995,7 @@
2044 1995 },
2045 1996 "id": 17,
2046 1997 "options": {
2047 - "displayMode": "gradient",
1998 + "displayMode": "basic",
2048 1999 "maxVizHeight": 300,
2049 2000 "minVizHeight": 16,
2050 2001 "minVizWidth": 8,
@@ -2058,7 +2009,7 @@
2058 2009 "limit": 25,
2059 2010 "values": true
2060 2011 },
2061 - "showUnfilled": true,
2012 + "showUnfilled": false,
2062 2013 "sizing": "auto",
2063 2014 "valueMode": "color"
2064 2015 },
@@ -2067,7 +2018,7 @@
2067 2018 {
2068 2019 "datasource": {
2069 2020 "type": "grafana-clickhouse-datasource",
2070 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
2021 + "uid": "fet9b6miuomwwf"
2071 2022 },
2072 2023 "editorType": "sql",
2073 2024 "format": 1,
@@ -2093,12 +2044,12 @@
2093 2044 {
2094 2045 "datasource": {
2095 2046 "type": "grafana-clickhouse-datasource",
2096 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
2047 + "uid": "fet9b6miuomwwf"
2097 2048 },
2098 2049 "fieldConfig": {
2099 2050 "defaults": {
2100 2051 "color": {
2101 - "mode": "thresholds"
2052 + "mode": "continuous-GrYlRd"
2102 2053 },
2103 2054 "mappings": [],
2104 2055 "thresholds": {
@@ -2149,7 +2100,7 @@
2149 2100 {
2150 2101 "datasource": {
2151 2102 "type": "grafana-clickhouse-datasource",
2152 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
2103 + "uid": "fet9b6miuomwwf"
2153 2104 },
2154 2105 "editorType": "sql",
2155 2106 "format": 1,
@@ -2175,7 +2126,7 @@
2175 2126 {
2176 2127 "datasource": {
2177 2128 "type": "grafana-clickhouse-datasource",
2178 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
2129 + "uid": "fet9b6miuomwwf"
2179 2130 },
2180 2131 "fieldConfig": {
2181 2132 "defaults": {
@@ -2262,7 +2213,7 @@
2262 2213 },
2263 2214 "datasource": {
2264 2215 "type": "grafana-clickhouse-datasource",
2265 - "uid": "${DS_GRAFANA-CLICKHOUSE-DATASOURCE}"
2216 + "uid": "fet9b6miuomwwf"
2266 2217 },
2267 2218 "editorType": "sql",
2268 2219 "format": 1,
@@ -2304,7 +2255,7 @@
2304 2255 "type": "table"
2305 2256 }
2306 2257 ],
2307 - "refresh": "",
2258 + "refresh": "30s",
2308 2259 "schemaVersion": 39,
2309 2260 "tags": [],
2310 2261 "templating": {
@@ -2354,13 +2305,13 @@
2354 2305 ]
2355 2306 },
2356 2307 "time": {
2357 - "from": "now-6h",
2308 + "from": "now-1h",
2358 2309 "to": "now"
2359 2310 },
2360 2311 "timepicker": {},
2361 2312 "timezone": "browser",
2362 2313 "title": "Caddy",
2363 2314 "uid": "eet9bprvewlq8e",
2364 - "version": 46,
2315 + "version": 54,
2365 2316 "weekStart": ""
2366 2317 }

anduin's Avatar anduin revised this gist 1753707217. Go to revision

1 file changed, 2366 insertions

grafana.json(file created)

@@ -0,0 +1,2366 @@
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 + }

anduin's Avatar anduin revised this gist 1753628440. Go to revision

1 file changed, 9 insertions, 1 deletion

clickhouse.json

@@ -1,7 +1,7 @@
1 1 {
2 2 "params": {
3 3 "rounding": "60",
4 - "seconds": "3200"
4 + "seconds": "600"
5 5 },
6 6 "queries": [
7 7 {
@@ -35,6 +35,14 @@
35 35 {
36 36 "title": "Methods distribution",
37 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"
38 46 }
39 47 ]
40 48 }

anduin's Avatar anduin revised this gist 1753628264. Go to revision

1 file changed, 30 insertions, 2 deletions

clickhouse.json

@@ -1,12 +1,40 @@
1 1 {
2 2 "params": {
3 - "rounding": "120",
4 - "seconds": "7200"
3 + "rounding": "60",
4 + "seconds": "3200"
5 5 },
6 6 "queries": [
7 7 {
8 8 "title": "Request rate",
9 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"
10 38 }
11 39 ]
12 40 }

anduin's Avatar anduin revised this gist 1753626074. Go to revision

1 file changed, 12 insertions

clickhouse.json(file created)

@@ -0,0 +1,12 @@
1 + {
2 + "params": {
3 + "rounding": "120",
4 + "seconds": "7200"
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 + }
Newer Older