Skip to content

Commit 5cd10e6

Browse files
0xgoudaCopilot
andauthored
Fix panels' queries
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c91c75f commit 5cd10e6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

grafana/postgres/v12/index-overview.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@
431431
"orderByTime": "ASC",
432432
"policy": "default",
433433
"rawQuery": true,
434-
"rawSql": "WITH last_fetch_time(time) AS (\n SELECT time\n FROM btree_bloat\n WHERE time <= $__timeTo()\n ORDER BY time DESC\n LIMIT 1\n)\n\nSELECT\n dbname AS \"Source Name\",\n tag_data->>'tblname' AS \"Table Name\",\n tag_data->>'idxname' AS \"Index Name\",\n data->>'real_size' AS \"Index Size\",\n data->>'bloat_pct' AS \"Estimated Bloat %\",\n data->>'bloat_size' AS \"Estimated Bloat size\"\nFROM\n btree_bloat\nWHERE time = (SELECT time FROM last_fetch_time)\nORDER BY (data->>'bloat_pct')::float8 DESC\nLIMIT $top\n",
434+
"rawSql": "WITH last_fetch_time(time) AS (\n SELECT time\n FROM btree_bloat\n WHERE time <= $__timeTo()\n ORDER BY time DESC\n LIMIT 1\n)\n\nSELECT\n dbname AS \"Source Name\",\n tag_data->>'tblname' AS \"Table Name\",\n tag_data->>'idxname' AS \"Index Name\",\n data->>'real_size' AS \"Index Size\",\n data->>'bloat_pct' AS \"Estimated Bloat %\",\n data->>'bloat_size' AS \"Estimated Bloat size\"\nFROM\n btree_bloat\nWHERE time = (SELECT time FROM last_fetch_time)\n AND dbname IN ($dbname)\nORDER BY (data->>'bloat_pct')::float8 DESC\nLIMIT $top\n",
435435
"refId": "A",
436436
"resultFormat": "table",
437437
"select": [

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@
545545
"pluginVersion": "12.3.1",
546546
"targets": [
547547
{
548-
"expr": "topk(10, pgwatch_btree_bloat_bloat_pct{dbname=\"$dbname\"})",
548+
"expr": "topk(10, pgwatch_btree_bloat_bloat_pct{dbname=~\"$dbname\"})",
549549
"legendFormat": "{{dbname}}: {{schemaname}}.{{tblname}}.{{idxname}}",
550550
"range": true,
551551
"refId": "A"
@@ -647,7 +647,7 @@
647647
"targets": [
648648
{
649649
"editorMode": "code",
650-
"expr": "topk(10, pgwatch_btree_bloat_bloat_size{dbname=\"$dbname\"})",
650+
"expr": "topk(10, pgwatch_btree_bloat_bloat_size{dbname=~\"$dbname\"})",
651651
"legendFormat": "{{dbname}}: {{schemaname}}.{{tblname}}.{{idxname}}",
652652
"range": true,
653653
"refId": "A"

0 commit comments

Comments
 (0)