Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[-] fix timeline ID conversion in wal metric from hexadecimal to decimal #604

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pgwatch2/metrics/wal/10/metric.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ select /* pgwatch2_generated */
system_identifier::text as tag_sys_id,
case
when pg_is_in_recovery() = false then
ltrim(pg_walfile_name(pg_current_wal_lsn())::char(8), '0')::int
('x'||substr(pg_walfile_name(pg_current_wal_lsn()), 1, 8))::bit(32)::int
else
(select min_recovery_end_timeline::int from pg_control_recovery())
end as timeline
Expand Down
2 changes: 1 addition & 1 deletion pgwatch2/metrics/wal/10/metric_su.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ select /* pgwatch2_generated */
system_identifier::text as tag_sys_id,
case
when pg_is_in_recovery() = false then
ltrim(pg_walfile_name(pg_current_wal_lsn())::char(8), '0')::int
('x'||substr(pg_walfile_name(pg_current_wal_lsn()), 1, 8))::bit(32)::int
else
(select min_recovery_end_timeline::int from pg_control_recovery())
end as timeline
Expand Down
4 changes: 2 additions & 2 deletions pgwatch2/sql/config_store/metric_definitions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2720,7 +2720,7 @@ select
system_identifier::text as tag_sys_id,
case
when pg_is_in_recovery() = false then
ltrim(pg_walfile_name(pg_current_wal_lsn())::char(8), '0')::int
('x'||substr(pg_walfile_name(pg_current_wal_lsn()), 1, 8))::bit(32)::int
else
(select min_recovery_end_timeline::int from pg_control_recovery())
end as timeline
Expand All @@ -2740,7 +2740,7 @@ select
system_identifier::text as tag_sys_id,
case
when pg_is_in_recovery() = false then
ltrim(pg_walfile_name(pg_current_wal_lsn())::char(8), '0')::int
('x'||substr(pg_walfile_name(pg_current_wal_lsn()), 1, 8))::bit(32)::int
else
(select min_recovery_end_timeline::int from pg_control_recovery())
end as timeline
Expand Down