Skip to content

Commit 9d02107

Browse files
committed
Add Top $n indexes by estimated bloat % panel to prom index overview dashboard
1 parent 202c720 commit 9d02107

1 file changed

Lines changed: 126 additions & 22 deletions

File tree

grafana/prometheus/v12/index-overview-prometheus.json

Lines changed: 126 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"editable": true,
2020
"fiscalYearStartMonth": 0,
2121
"graphTooltip": 0,
22-
"id": 22,
22+
"id": 34,
2323
"links": [],
2424
"panels": [
2525
{
@@ -70,6 +70,7 @@
7070
"type": "linear"
7171
},
7272
"showPoints": "never",
73+
"showValues": false,
7374
"spanNulls": true,
7475
"stacking": {
7576
"group": "A",
@@ -121,6 +122,7 @@
121122
"sort": "none"
122123
}
123124
},
125+
"pluginVersion": "12.3.1",
124126
"targets": [
125127
{
126128
"expr": "topk(10, sum by (index_name, dbname) (rate(pgwatch_index_stats_idx_scan{dbname=~\"$dbname\"}[$agg_interval])))",
@@ -166,6 +168,7 @@
166168
"type": "linear"
167169
},
168170
"showPoints": "never",
171+
"showValues": false,
169172
"spanNulls": true,
170173
"stacking": {
171174
"group": "A",
@@ -217,6 +220,7 @@
217220
"sort": "none"
218221
}
219222
},
223+
"pluginVersion": "12.3.1",
220224
"targets": [
221225
{
222226
"expr": "topk(10, sum by (index_name, dbname) (rate(pgwatch_index_stats_idx_tup_fetch{dbname=~\"$dbname\"}[$agg_interval])))",
@@ -275,6 +279,7 @@
275279
"type": "linear"
276280
},
277281
"showPoints": "never",
282+
"showValues": false,
278283
"spanNulls": true,
279284
"stacking": {
280285
"group": "A",
@@ -326,6 +331,7 @@
326331
"sort": "none"
327332
}
328333
},
334+
"pluginVersion": "12.3.1",
329335
"targets": [
330336
{
331337
"expr": "topk(10, sum by (index_name, dbname) (pgwatch_index_stats_idx_tup_read{dbname=~\"$dbname\"}) / sum by (index_name, dbname) (pgwatch_index_stats_idx_tup_fetch{dbname=~\"$dbname\"} > 0))",
@@ -371,6 +377,7 @@
371377
"type": "linear"
372378
},
373379
"showPoints": "never",
380+
"showValues": false,
374381
"spanNulls": true,
375382
"stacking": {
376383
"group": "A",
@@ -422,6 +429,7 @@
422429
"sort": "none"
423430
}
424431
},
432+
"pluginVersion": "12.3.1",
425433
"targets": [
426434
{
427435
"expr": "topk(10, sum by (index_name, dbname) (pgwatch_index_stats_index_size_b{dbname=~\"$dbname\"}))",
@@ -445,6 +453,107 @@
445453
"title": "Index Health and Issues",
446454
"type": "row"
447455
},
456+
{
457+
"datasource": {
458+
"type": "prometheus",
459+
"uid": "pgwatch-prometheus"
460+
},
461+
"description": "",
462+
"fieldConfig": {
463+
"defaults": {
464+
"color": {
465+
"mode": "palette-classic"
466+
},
467+
"custom": {
468+
"axisBorderShow": false,
469+
"axisCenteredZero": false,
470+
"axisColorMode": "text",
471+
"axisLabel": "",
472+
"axisPlacement": "auto",
473+
"barAlignment": 0,
474+
"barWidthFactor": 0.6,
475+
"drawStyle": "line",
476+
"fillOpacity": 20,
477+
"gradientMode": "none",
478+
"hideFrom": {
479+
"legend": false,
480+
"tooltip": false,
481+
"viz": false
482+
},
483+
"insertNulls": false,
484+
"lineInterpolation": "linear",
485+
"lineWidth": 1,
486+
"pointSize": 5,
487+
"scaleDistribution": {
488+
"type": "linear"
489+
},
490+
"showPoints": "never",
491+
"showValues": false,
492+
"spanNulls": true,
493+
"stacking": {
494+
"group": "A",
495+
"mode": "none"
496+
},
497+
"thresholdsStyle": {
498+
"mode": "off"
499+
}
500+
},
501+
"decimals": 2,
502+
"mappings": [],
503+
"thresholds": {
504+
"mode": "absolute",
505+
"steps": [
506+
{
507+
"color": "green",
508+
"value": 0
509+
},
510+
{
511+
"color": "red",
512+
"value": 80
513+
}
514+
]
515+
},
516+
"unit": "percent"
517+
},
518+
"overrides": []
519+
},
520+
"gridPos": {
521+
"h": 9,
522+
"w": 24,
523+
"x": 0,
524+
"y": 19
525+
},
526+
"id": 12,
527+
"options": {
528+
"legend": {
529+
"calcs": [
530+
"lastNotNull",
531+
"max"
532+
],
533+
"displayMode": "table",
534+
"placement": "bottom",
535+
"showLegend": true,
536+
"sortBy": "Max",
537+
"sortDesc": true
538+
},
539+
"tooltip": {
540+
"hideZeros": false,
541+
"mode": "single",
542+
"sort": "none"
543+
}
544+
},
545+
"pluginVersion": "12.3.1",
546+
"targets": [
547+
{
548+
"expr": "topk(10, pgwatch_btree_bloat_bloat_pct{dbname=\"$dbname\"})",
549+
"legendFormat": "{{dbname}}: {{schemaname}}.{{tblname}}.{{idxname}}",
550+
"range": true,
551+
"refId": "A"
552+
}
553+
],
554+
"title": "Top 10 indexes by estimated bloat %",
555+
"type": "timeseries"
556+
},
448557
{
449558
"datasource": {
450559
"type": "prometheus",
@@ -491,7 +600,7 @@
491600
"h": 8,
492601
"w": 12,
493602
"x": 0,
494-
"y": 19
603+
"y": 28
495604
},
496605
"id": 8,
497606
"options": {
@@ -511,7 +620,7 @@
511620
"textMode": "auto",
512621
"wideLayout": true
513622
},
514-
"pluginVersion": "12.1.0",
623+
"pluginVersion": "12.3.1",
515624
"targets": [
516625
{
517626
"expr": "sum by (object_name, dbname) (metrics_recommendations_index_size_b{dbname=~\"$dbname\", issue_type=\"invalid\"})",
@@ -557,6 +666,7 @@
557666
"type": "linear"
558667
},
559668
"showPoints": "never",
669+
"showValues": false,
560670
"spanNulls": true,
561671
"stacking": {
562672
"group": "A",
@@ -589,7 +699,7 @@
589699
"h": 8,
590700
"w": 12,
591701
"x": 12,
592-
"y": 19
702+
"y": 28
593703
},
594704
"id": 9,
595705
"options": {
@@ -607,6 +717,7 @@
607717
"sort": "none"
608718
}
609719
},
720+
"pluginVersion": "12.3.1",
610721
"targets": [
611722
{
612723
"expr": "topk(10, sum by (object_name, dbname) (metrics_recommendations_index_size_b{dbname=~\"$dbname\", issue_type=\"unused\"}))",
@@ -623,7 +734,7 @@
623734
"h": 1,
624735
"w": 24,
625736
"x": 0,
626-
"y": 27
737+
"y": 36
627738
},
628739
"id": 10,
629740
"panels": [],
@@ -659,7 +770,7 @@
659770
"h": 8,
660771
"w": 24,
661772
"x": 0,
662-
"y": 28
773+
"y": 37
663774
},
664775
"id": 11,
665776
"options": {
@@ -679,7 +790,7 @@
679790
"textMode": "auto",
680791
"wideLayout": true
681792
},
682-
"pluginVersion": "12.1.0",
793+
"pluginVersion": "12.3.1",
683794
"targets": [
684795
{
685796
"expr": "count by (dbname) (pgwatch_index_stats_is_pk_int{dbname=~\"$dbname\"} == 1)",
@@ -706,8 +817,9 @@
706817
"type": "stat"
707818
}
708819
],
820+
"preload": false,
709821
"refresh": "30s",
710-
"schemaVersion": 39,
822+
"schemaVersion": 42,
711823
"tags": [
712824
"pgwatch",
713825
"prometheus"
@@ -724,7 +836,6 @@
724836
"type": "prometheus"
725837
},
726838
"definition": "label_values(pgwatch_instance_up, dbname)",
727-
"hide": 0,
728839
"includeAll": true,
729840
"label": "Database",
730841
"multi": true,
@@ -733,20 +844,16 @@
733844
"query": "label_values(pgwatch_instance_up, dbname)",
734845
"refresh": 1,
735846
"regex": "",
736-
"skipUrlSync": false,
737847
"sort": 1,
738848
"type": "query"
739849
},
740850
{
741851
"current": {
742-
"selected": false,
743-
"text": "5m",
744-
"value": "5m"
852+
"text": "1h",
853+
"value": "1h"
745854
},
746-
"hide": 0,
747855
"includeAll": false,
748856
"label": "Aggregation interval",
749-
"multi": false,
750857
"name": "agg_interval",
751858
"options": [
752859
{
@@ -755,7 +862,7 @@
755862
"value": "1m"
756863
},
757864
{
758-
"selected": true,
865+
"selected": false,
759866
"text": "5m",
760867
"value": "5m"
761868
},
@@ -770,14 +877,12 @@
770877
"value": "30m"
771878
},
772879
{
773-
"selected": false,
880+
"selected": true,
774881
"text": "1h",
775882
"value": "1h"
776883
}
777884
],
778885
"query": "1m,5m,10m,30m,1h",
779-
"queryValue": "",
780-
"skipUrlSync": false,
781886
"type": "custom"
782887
}
783888
]
@@ -790,6 +895,5 @@
790895
"timezone": "",
791896
"title": "Index Overview (Prometheus)",
792897
"uid": "index-overview-prometheus",
793-
"version": 1,
794-
"weekStart": ""
795-
}
898+
"version": 4
899+
}

0 commit comments

Comments
 (0)