Skip to content

Commit c03e6b2

Browse files
Fixed up table stat metrics
1 parent e34a010 commit c03e6b2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

config/pgwatch-prometheus/metrics.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ metrics:
541541
select * from (
542542
select
543543
epoch_ns,
544+
tag_datname,
544545
quote_ident(qr.root_schema) as tag_schema,
545546
quote_ident(qr.root_relname) as tag_table_name,
546547
quote_ident(qr.root_schema) || '.' || quote_ident(qr.root_relname) as tag_table_full_name,
@@ -573,7 +574,7 @@ metrics:
573574
join q_parts qp on qp.relid = ts.relid
574575
join q_root_part qr on qr.oid = qp.root
575576
group by
576-
1, 2, 3, 4, 5
577+
1, 2, 3, 4, 5, 6
577578
) x
578579
order by table_size_b desc nulls last limit 300
579580
16: |-
@@ -602,6 +603,7 @@ metrics:
602603
),
603604
q_tstats as (
604605
select (extract(epoch from now()) * 1e9)::int8 as epoch_ns,
606+
current_database() as tag_datname,
605607
relid, -- not sent to final output
606608
quote_ident(schemaname) as tag_schema,
607609
quote_ident(ut.relname) as tag_table_name,
@@ -645,6 +647,7 @@ metrics:
645647
646648
select /* pgwatch_generated */
647649
epoch_ns,
650+
tag_datname,
648651
tag_schema,
649652
tag_table_name,
650653
tag_table_full_name,
@@ -681,6 +684,7 @@ metrics:
681684
select * from (
682685
select
683686
epoch_ns,
687+
tag_datname,
684688
quote_ident(qr.root_schema) as tag_schema,
685689
quote_ident(qr.root_relname) as tag_table_name,
686690
quote_ident(qr.root_schema) || '.' || quote_ident(qr.root_relname) as tag_table_full_name,
@@ -714,7 +718,7 @@ metrics:
714718
join q_parts qp on qp.relid = ts.relid
715719
join q_root_part qr on qr.oid = qp.root
716720
group by
717-
1, 2, 3, 4
721+
1, 2, 3, 4, 5
718722
) x
719723
order by table_size_b desc nulls last limit 300
720724
gauges:
@@ -1097,7 +1101,7 @@ metrics:
10971101
select
10981102
'tail_dummy_user' as tag_user,
10991103
current_database() as tag_datname,
1100-
-1 as tag_qqueryid,
1104+
-1 as tag_queryid,
11011105
sum(calls)::int8 as calls,
11021106
sum(plans_total)::int8 as plans_total,
11031107
sum(exec_time_total)::int8 as exec_time_total,
@@ -1169,7 +1173,7 @@ metrics:
11691173
select
11701174
'tail_dummy_user' as tag_user,
11711175
current_database() as tag_datname,
1172-
-1 as tag_qqueryid,
1176+
-1 as tag_queryid,
11731177
sum(calls)::int8 as calls,
11741178
sum(plans_total)::int8 as plans_total,
11751179
sum(exec_time_total)::int8 as exec_time_total,

0 commit comments

Comments
 (0)