Skip to content

Commit 361decb

Browse files
author
r.khavronenko
committed
handle multiple instances in grafana's dashboard
1 parent 49b8d76 commit 361decb

File tree

1 file changed

+64
-58
lines changed

1 file changed

+64
-58
lines changed

chproxy_overview.json

Lines changed: 64 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@
8787
"intervalFactor": 2,
8888
"legendFormat": "request_sum",
8989
"refId": "A",
90-
"step": 10
90+
"step": 60
9191
},
9292
{
9393
"expr": "sum(rate(request_success_total{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}[$interval])) ",
9494
"format": "time_series",
9595
"intervalFactor": 2,
9696
"legendFormat": "request_success",
9797
"refId": "B",
98-
"step": 10
98+
"step": 60
9999
}
100100
],
101101
"thresholds": [],
@@ -152,6 +152,7 @@
152152
"min": false,
153153
"rightSide": true,
154154
"show": true,
155+
"sortDesc": true,
155156
"total": false,
156157
"values": true
157158
},
@@ -170,13 +171,13 @@
170171
"steppedLine": false,
171172
"targets": [
172173
{
173-
"expr": "avg(request_duration_seconds{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}) by (quantile)",
174+
"expr": "avg(request_duration_seconds{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}) by (user, quantile)",
174175
"format": "time_series",
175176
"interval": "",
176177
"intervalFactor": 10,
177-
"legendFormat": "{{quantile}}",
178+
"legendFormat": "{{user}} - {{quantile}}",
178179
"refId": "A",
179-
"step": 50
180+
"step": 300
180181
}
181182
],
182183
"thresholds": [],
@@ -258,12 +259,12 @@
258259
"steppedLine": false,
259260
"targets": [
260261
{
261-
"expr": "sum(rate(status_codes_total{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}[$interval])) by (code)",
262+
"expr": "sum(rate(status_codes_total{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster=~\"$cluster\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}[$interval])) by (code)",
262263
"format": "time_series",
263264
"intervalFactor": 2,
264265
"legendFormat": "{{code}}",
265266
"refId": "A",
266-
"step": 10
267+
"step": 60
267268
}
268269
],
269270
"thresholds": [],
@@ -334,12 +335,12 @@
334335
"steppedLine": false,
335336
"targets": [
336337
{
337-
"expr": "sum(\n rate(\n concurrent_limit_excess_total{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}[$interval])) \nby (cluster_node)",
338+
"expr": "sum(\n rate(\n concurrent_limit_excess_total{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster=~\"$cluster\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}[$interval])) \nby (cluster_node)",
338339
"format": "time_series",
339340
"intervalFactor": 2,
340341
"legendFormat": "{{cluster_node}}",
341342
"refId": "A",
342-
"step": 10
343+
"step": 60
343344
}
344345
],
345346
"thresholds": [],
@@ -415,17 +416,17 @@
415416
"expr": "sum(\n concurrent_queries{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}) \nby (cluster_user)",
416417
"format": "time_series",
417418
"intervalFactor": 2,
418-
"legendFormat": "cluster-{{cluster_user}}",
419+
"legendFormat": "cu-{{cluster_user}}",
419420
"refId": "A",
420-
"step": 4
421+
"step": 30
421422
},
422423
{
423424
"expr": "sum(\n concurrent_queries{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}) \nby (user)",
424425
"format": "time_series",
425426
"intervalFactor": 2,
426-
"legendFormat": "{{user}}",
427+
"legendFormat": "u-{{user}}",
427428
"refId": "B",
428-
"step": 4
429+
"step": 30
429430
}
430431
],
431432
"thresholds": [],
@@ -508,15 +509,15 @@
508509
"intervalFactor": 2,
509510
"legendFormat": "request",
510511
"refId": "A",
511-
"step": 4
512+
"step": 30
512513
},
513514
{
514515
"expr": "sum(rate(response_body_bytes_total{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}[$interval]))\n",
515516
"format": "time_series",
516517
"intervalFactor": 2,
517518
"legendFormat": "response",
518519
"refId": "B",
519-
"step": 4
520+
"step": 30
520521
}
521522
],
522523
"thresholds": [],
@@ -578,10 +579,10 @@
578579
"legend": {
579580
"alignAsTable": true,
580581
"avg": false,
581-
"current": false,
582+
"current": true,
582583
"hideEmpty": false,
583584
"hideZero": false,
584-
"max": true,
585+
"max": false,
585586
"min": false,
586587
"rightSide": true,
587588
"show": true,
@@ -609,10 +610,10 @@
609610
"expr": "sum by (cluster_node) (request_sum_total{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}) \n / \nscalar(sum(request_sum_total{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}))",
610611
"format": "time_series",
611612
"interval": "",
612-
"intervalFactor": 2,
613+
"intervalFactor": 1,
613614
"legendFormat": "{{cluster_node}}",
614615
"refId": "A",
615-
"step": 4
616+
"step": 15
616617
}
617618
],
618619
"thresholds": [],
@@ -685,17 +686,17 @@
685686
"seriesOverrides": [],
686687
"spaceLength": 10,
687688
"span": 12,
688-
"stack": false,
689+
"stack": true,
689690
"steppedLine": false,
690691
"targets": [
691692
{
692693
"expr": "sum(\n concurrent_queries{job=~\"$job-chproxy\",instance=~\"$instance\",user=~\"$user\",cluster=~\"$cluster\", cluster_user=~\"$cluster_user\",cluster_node=~\"$cluster_node\"}) \nby (cluster_node)",
693694
"format": "time_series",
694695
"interval": "",
695-
"intervalFactor": 2,
696+
"intervalFactor": 4,
696697
"legendFormat": "{{cluster_node}}",
697698
"refId": "A",
698-
"step": 4
699+
"step": 60
699700
}
700701
],
701702
"thresholds": [],
@@ -704,7 +705,7 @@
704705
"title": "Cluster \"$cluster\" concurrent queries by node",
705706
"tooltip": {
706707
"shared": true,
707-
"sort": 0,
708+
"sort": 2,
708709
"value_type": "individual"
709710
},
710711
"type": "graph",
@@ -756,7 +757,7 @@
756757
"id": 9,
757758
"interval": null,
758759
"links": [],
759-
"mappingType": 1,
760+
"mappingType": 2,
760761
"mappingTypes": [
761762
{
762763
"name": "value to text",
@@ -777,9 +778,14 @@
777778
"prefixFontSize": "50%",
778779
"rangeMaps": [
779780
{
780-
"from": "null",
781-
"text": "N/A",
782-
"to": "null"
781+
"from": "0",
782+
"text": "down",
783+
"to": "0"
784+
},
785+
{
786+
"from": "1",
787+
"text": "up",
788+
"to": "500"
783789
}
784790
],
785791
"repeat": "cluster_node",
@@ -793,12 +799,12 @@
793799
"tableColumn": "",
794800
"targets": [
795801
{
796-
"expr": "host_health{job=~\"$job-chproxy\",instance=~\"$instance\",cluster=~\"$cluster\",cluster_node=~\"$cluster_node\"}",
802+
"expr": "sum(host_health{job=~\"$job-chproxy\",instance=~\"$instance\",cluster=~\"$cluster\",cluster_node=~\"$cluster_node\"})",
797803
"format": "time_series",
798804
"intervalFactor": 2,
799805
"legendFormat": "{{cluster_node}}",
800806
"refId": "A",
801-
"step": 60
807+
"step": 600
802808
}
803809
],
804810
"thresholds": "0,1",
@@ -809,7 +815,7 @@
809815
{
810816
"op": "=",
811817
"text": "Ok",
812-
"value": "1"
818+
"value": ">1"
813819
},
814820
{
815821
"op": "=",
@@ -893,6 +899,26 @@
893899
"type": "query",
894900
"useTags": false
895901
},
902+
{
903+
"allValue": null,
904+
"current": {},
905+
"datasource": "${DS_PROMETHEUS}",
906+
"hide": 0,
907+
"includeAll": true,
908+
"label": "cluster",
909+
"multi": false,
910+
"name": "cluster",
911+
"options": [],
912+
"query": "label_values(host_health{job=~\"$job-chproxy\",instance=~\"$instance\"},cluster)",
913+
"refresh": 1,
914+
"regex": "",
915+
"sort": 0,
916+
"tagValuesQuery": "",
917+
"tags": [],
918+
"tagsQuery": "",
919+
"type": "query",
920+
"useTags": false
921+
},
896922
{
897923
"allValue": null,
898924
"current": {},
@@ -903,7 +929,7 @@
903929
"multi": false,
904930
"name": "cluster_user",
905931
"options": [],
906-
"query": "label_values(request_sum_total{job=~\"$job-chproxy\",instance=~\"$instance\"},cluster_user)",
932+
"query": "label_values(request_sum_total{job=~\"$job-chproxy\",instance=~\"$instance\", cluster=~\"$cluster\"},cluster_user)",
907933
"refresh": 1,
908934
"regex": "",
909935
"sort": 0,
@@ -923,7 +949,7 @@
923949
"multi": false,
924950
"name": "cluster_node",
925951
"options": [],
926-
"query": "label_values(request_sum_total{job=~\"$job-chproxy\",instance=~\"$instance\"},cluster_node)",
952+
"query": "label_values(request_sum_total{job=~\"$job-chproxy\",instance=~\"$instance\", cluster=~\"$cluster\"},cluster_node)",
927953
"refresh": 1,
928954
"regex": "",
929955
"sort": 3,
@@ -938,8 +964,8 @@
938964
"auto_count": 30,
939965
"auto_min": "10s",
940966
"current": {
941-
"text": "5m",
942-
"value": "5m"
967+
"text": "10m",
968+
"value": "10m"
943969
},
944970
"hide": 0,
945971
"label": null,
@@ -951,12 +977,12 @@
951977
"value": "1m"
952978
},
953979
{
954-
"selected": true,
980+
"selected": false,
955981
"text": "5m",
956982
"value": "5m"
957983
},
958984
{
959-
"selected": false,
985+
"selected": true,
960986
"text": "10m",
961987
"value": "10m"
962988
},
@@ -989,31 +1015,11 @@
9891015
"query": "1m,5m,10m,30m,1h,6h,12h,1d",
9901016
"refresh": 2,
9911017
"type": "interval"
992-
},
993-
{
994-
"allValue": null,
995-
"current": {},
996-
"datasource": "${DS_PROMETHEUS}",
997-
"hide": 2,
998-
"includeAll": true,
999-
"label": "cluster",
1000-
"multi": false,
1001-
"name": "cluster",
1002-
"options": [],
1003-
"query": "label_values(host_health{job=~\"$job-chproxy\"},cluster)",
1004-
"refresh": 1,
1005-
"regex": "",
1006-
"sort": 0,
1007-
"tagValuesQuery": "",
1008-
"tags": [],
1009-
"tagsQuery": "",
1010-
"type": "query",
1011-
"useTags": false
10121018
}
10131019
]
10141020
},
10151021
"time": {
1016-
"from": "now-1h",
1022+
"from": "now-6h",
10171023
"to": "now"
10181024
},
10191025
"timepicker": {
@@ -1043,5 +1049,5 @@
10431049
},
10441050
"timezone": "browser",
10451051
"title": "ClickHouse Proxy overview",
1046-
"version": 47
1052+
"version": 51
10471053
}

0 commit comments

Comments
 (0)