Skip to content

Commit

Permalink
fix: fix handling of 3 number backrest version (#421)
Browse files Browse the repository at this point in the history
* fix: fix handling of 3 number backrest version

* fix: fix handling of 3 number backrest version
  • Loading branch information
keithf4 authored Jul 31, 2024
1 parent c4f878a commit 9e6399a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/420.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- postgres_exporter - Fix query for pgBackRest monitoring to handle 3 number versions
2 changes: 1 addition & 1 deletion postgres_exporter/linux/queries_backrest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ccp_backrest_last_info:
)
SELECT a.config_file
, a.stanza
, a.backup_data->'backrest'->>'version' AS backrest_repo_version
, split_part(a.backup_data->'backrest'->>'version', '.', 1) || lpad(split_part(a.backup_data->'backrest'->>'version', '.', 2), 2, '0') || lpad(coalesce(nullif(split_part(a.backup_data->'backrest'->>'version', '.', 3), ''), '00'), 2, '0') AS backrest_repo_version
, a.backup_data->'database'->>'repo-key' AS repo
, a.backup_data->>'type' AS backup_type
, a.backup_data->'info'->'repository'->>'delta' AS repo_backup_size_bytes
Expand Down

0 comments on commit 9e6399a

Please sign in to comment.