Skip to content

Commit

Permalink
[+] add usename to replication metric, closes #751 (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
pashagolub authored May 13, 2024
1 parent d8e4281 commit 02a4588
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pgwatch2/metrics/replication/10/metric.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
select /* pgwatch2_generated */
(extract(epoch from now()) * 1e9)::int8 as epoch_ns,
application_name as tag_application_name,
usename AS tag_usename,
concat(coalesce(client_addr::text, client_hostname), '_', client_port::text) as tag_client_info,
coalesce(pg_wal_lsn_diff(case when pg_is_in_recovery() then pg_last_wal_receive_lsn() else pg_current_wal_lsn() end, sent_lsn)::int8, 0) as sent_lag_b,
coalesce(pg_wal_lsn_diff(case when pg_is_in_recovery() then pg_last_wal_receive_lsn() else pg_current_wal_lsn() end, write_lsn)::int8, 0) as write_lag_b,
Expand Down
1 change: 1 addition & 0 deletions pgwatch2/sql/config_store/metric_definitions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,7 @@ $sql$
SELECT
(extract(epoch from now()) * 1e9)::int8 as epoch_ns,
application_name as tag_application_name,
usename AS tag_usename,
concat(coalesce(client_addr::text, client_hostname), '_', client_port::text) as tag_client_info,
coalesce(pg_wal_lsn_diff(case when pg_is_in_recovery() then pg_last_wal_receive_lsn() else pg_current_wal_lsn() end, sent_lsn)::int8, 0) as sent_lag_b,
coalesce(pg_wal_lsn_diff(case when pg_is_in_recovery() then pg_last_wal_receive_lsn() else pg_current_wal_lsn() end, write_lsn)::int8, 0) as write_lag_b,
Expand Down

0 comments on commit 02a4588

Please sign in to comment.