Skip to content

Commit 095cced

Browse files
author
Test
committed
fix: use seriesToColumns transform for table panels and improve layout
1 parent ebd8ac4 commit 095cced

2 files changed

Lines changed: 68 additions & 28 deletions

File tree

charts/pgpulse/dashboards/pgpulse.json

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
]
331331
},
332332
"gridPos": {
333-
"h": 10,
333+
"h": 12,
334334
"w": 24,
335335
"x": 0,
336336
"y": 1
@@ -427,7 +427,7 @@
427427
"refId": "G"
428428
},
429429
{
430-
"expr": "pg_node_role{instance=~\"$instance\"} == 1",
430+
"expr": "label_replace(pg_node_role{instance=~\"$instance\"} == 1, \"__value__\", \"$1\", \"role\", \"(.+)\")",
431431
"legendFormat": "",
432432
"datasource": {
433433
"type": "prometheus",
@@ -451,21 +451,36 @@
451451
],
452452
"transformations": [
453453
{
454-
"id": "merge",
455-
"options": {}
454+
"id": "seriesToColumns",
455+
"options": {
456+
"byField": "instance"
457+
}
456458
},
457459
{
458460
"id": "organize",
459461
"options": {
460462
"excludeByName": {
461463
"Time": true,
464+
"Time 1": true,
465+
"Time 2": true,
466+
"Time 3": true,
467+
"Time 4": true,
468+
"Time 5": true,
469+
"Time 6": true,
470+
"Time 7": true,
471+
"Time 8": true,
472+
"Time 9": true,
462473
"__name__": true,
463474
"job": true,
464475
"container": true,
465476
"endpoint": true,
466477
"namespace": true,
467478
"pod": true,
468-
"service": true
479+
"service": true,
480+
"role": true,
481+
"datname": true,
482+
"state": true,
483+
"usename": true
469484
},
470485
"renameByName": {
471486
"instance": "Instance",
@@ -477,8 +492,7 @@
477492
"Value #F": "Conn %",
478493
"Value #G": "Max Conn",
479494
"Value #H": "Role",
480-
"Value #I": "Scrape (ms)",
481-
"role": "Role"
495+
"Value #I": "Scrape (ms)"
482496
},
483497
"indexByName": {
484498
"Instance": 0,
@@ -1586,7 +1600,8 @@
15861600
"uid": ""
15871601
}
15881602
}
1589-
]
1603+
],
1604+
"description": "Seconds since last manual VACUUM per table. Shows 'No data' if no manual VACUUM has ever been run \u2014 this is normal if autovacuum is handling everything (see Time Since Last Autovacuum). Only investigate if autovacuum is also lagging."
15901605
},
15911606
{
15921607
"datasource": {
@@ -2429,8 +2444,8 @@
24292444
]
24302445
},
24312446
"gridPos": {
2432-
"h": 8,
2433-
"w": 12,
2447+
"h": 10,
2448+
"w": 24,
24342449
"x": 0,
24352450
"y": 167
24362451
},
@@ -2481,14 +2496,19 @@
24812496
],
24822497
"transformations": [
24832498
{
2484-
"id": "merge",
2485-
"options": {}
2499+
"id": "seriesToColumns",
2500+
"options": {
2501+
"byField": "instance"
2502+
}
24862503
},
24872504
{
24882505
"id": "organize",
24892506
"options": {
24902507
"excludeByName": {
24912508
"Time": true,
2509+
"Time 1": true,
2510+
"Time 2": true,
2511+
"Time 3": true,
24922512
"__name__": true,
24932513
"job": true,
24942514
"container": true,
@@ -2524,7 +2544,7 @@
25242544
"gridPos": {
25252545
"h": 8,
25262546
"w": 12,
2527-
"x": 12,
2547+
"x": 0,
25282548
"y": 167
25292549
},
25302550
"id": 97,
@@ -2856,5 +2876,5 @@
28562876
"timezone": "browser",
28572877
"title": "pgpulse \u2014 PostgreSQL Pulse",
28582878
"uid": "pgpulse-main",
2859-
"version": 10
2879+
"version": 11
28602880
}

grafana/pgpulse-dashboard.json

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@
384384
]
385385
},
386386
"gridPos": {
387-
"h": 10,
387+
"h": 12,
388388
"w": 24,
389389
"x": 0,
390390
"y": 1
@@ -481,7 +481,7 @@
481481
"refId": "G"
482482
},
483483
{
484-
"expr": "pg_node_role{instance=~\"$instance\"} == 1",
484+
"expr": "label_replace(pg_node_role{instance=~\"$instance\"} == 1, \"__value__\", \"$1\", \"role\", \"(.+)\")",
485485
"legendFormat": "",
486486
"datasource": {
487487
"type": "prometheus",
@@ -505,21 +505,36 @@
505505
],
506506
"transformations": [
507507
{
508-
"id": "merge",
509-
"options": {}
508+
"id": "seriesToColumns",
509+
"options": {
510+
"byField": "instance"
511+
}
510512
},
511513
{
512514
"id": "organize",
513515
"options": {
514516
"excludeByName": {
515517
"Time": true,
518+
"Time 1": true,
519+
"Time 2": true,
520+
"Time 3": true,
521+
"Time 4": true,
522+
"Time 5": true,
523+
"Time 6": true,
524+
"Time 7": true,
525+
"Time 8": true,
526+
"Time 9": true,
516527
"__name__": true,
517528
"job": true,
518529
"container": true,
519530
"endpoint": true,
520531
"namespace": true,
521532
"pod": true,
522-
"service": true
533+
"service": true,
534+
"role": true,
535+
"datname": true,
536+
"state": true,
537+
"usename": true
523538
},
524539
"renameByName": {
525540
"instance": "Instance",
@@ -531,8 +546,7 @@
531546
"Value #F": "Conn %",
532547
"Value #G": "Max Conn",
533548
"Value #H": "Role",
534-
"Value #I": "Scrape (ms)",
535-
"role": "Role"
549+
"Value #I": "Scrape (ms)"
536550
},
537551
"indexByName": {
538552
"Instance": 0,
@@ -1640,7 +1654,8 @@
16401654
"uid": "${DS_PROMETHEUS}"
16411655
}
16421656
}
1643-
]
1657+
],
1658+
"description": "Seconds since last manual VACUUM per table. Shows 'No data' if no manual VACUUM has ever been run \u2014 this is normal if autovacuum is handling everything (see Time Since Last Autovacuum). Only investigate if autovacuum is also lagging."
16441659
},
16451660
{
16461661
"datasource": {
@@ -2483,8 +2498,8 @@
24832498
]
24842499
},
24852500
"gridPos": {
2486-
"h": 8,
2487-
"w": 12,
2501+
"h": 10,
2502+
"w": 24,
24882503
"x": 0,
24892504
"y": 167
24902505
},
@@ -2535,14 +2550,19 @@
25352550
],
25362551
"transformations": [
25372552
{
2538-
"id": "merge",
2539-
"options": {}
2553+
"id": "seriesToColumns",
2554+
"options": {
2555+
"byField": "instance"
2556+
}
25402557
},
25412558
{
25422559
"id": "organize",
25432560
"options": {
25442561
"excludeByName": {
25452562
"Time": true,
2563+
"Time 1": true,
2564+
"Time 2": true,
2565+
"Time 3": true,
25462566
"__name__": true,
25472567
"job": true,
25482568
"container": true,
@@ -2578,7 +2598,7 @@
25782598
"gridPos": {
25792599
"h": 8,
25802600
"w": 12,
2581-
"x": 12,
2601+
"x": 0,
25822602
"y": 167
25832603
},
25842604
"id": 97,
@@ -2910,5 +2930,5 @@
29102930
"timezone": "browser",
29112931
"title": "pgpulse \u2014 PostgreSQL Pulse",
29122932
"uid": "pgpulse-main",
2913-
"version": 10
2933+
"version": 11
29142934
}

0 commit comments

Comments
 (0)