Skip to content

Commit a636b7c

Browse files
Added comments to explain usage of query_to_xml
1 parent b6b49c8 commit a636b7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

config/pgwatch-prometheus/metrics.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,6 +2220,9 @@ metrics:
22202220
can_local as (
22212221
select (has_ls and has_stat and (has_read_files or is_super)) as ok from env
22222222
),
2223+
-- Use query_to_xml to safely execute RDS-specific multixact directory listing query.
2224+
-- The XML wrapper allows the query to fail gracefully if rds_tools.pg_ls_multixactdir()
2225+
-- is unavailable or returns errors, preventing the entire metric from failing.
22232226
rds_probe_xml as (
22242227
select query_to_xml($q$
22252228
with files as (
@@ -2242,6 +2245,9 @@ metrics:
22422245
$q$, true, true, '') as x
22432246
where (select has_rds_fn from env)
22442247
),
2248+
-- Use query_to_xml to safely execute standard Postgres multixact directory listing query.
2249+
-- The XML wrapper allows the query to fail gracefully if pg_stat_file() or pg_ls_dir()
2250+
-- are unavailable or return permission errors, preventing the entire metric from failing.
22452251
local_probe_xml as (
22462252
select query_to_xml($q$
22472253
with dirs as (

0 commit comments

Comments
 (0)