mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-04 23:29:30 +00:00
Signed-off-by: Steffen Zieger <github@saz.sh>
This commit is contained in:
parent
3c5ef40e2b
commit
98f75c7e7e
@ -51,9 +51,9 @@ var queryOverrides = map[string][]OverrideQuery{
|
|||||||
semver.MustParseRange(">=10.0.0"),
|
semver.MustParseRange(">=10.0.0"),
|
||||||
`
|
`
|
||||||
SELECT *,
|
SELECT *,
|
||||||
(case pg_is_in_recovery() when 't' then null else pg_current_wal_lsn() end) AS pg_current_wal_lsn,
|
(case pg_is_in_recovery() when 't' then pg_last_wal_receive_lsn() else pg_current_wal_lsn() end) AS pg_current_wal_lsn,
|
||||||
(case pg_is_in_recovery() when 't' then null else pg_wal_lsn_diff(pg_current_wal_lsn(), pg_lsn('0/0'))::float end) AS pg_current_wal_lsn_bytes,
|
(case pg_is_in_recovery() when 't' then pg_wal_lsn_diff(pg_last_wal_receive_lsn(), pg_lsn('0/0'))::float else pg_wal_lsn_diff(pg_current_wal_lsn(), pg_lsn('0/0'))::float end) AS pg_current_wal_lsn_bytes,
|
||||||
(case pg_is_in_recovery() when 't' then null else pg_wal_lsn_diff(pg_current_wal_lsn(), replay_lsn)::float end) AS pg_wal_lsn_diff
|
(case pg_is_in_recovery() when 't' then pg_wal_lsn_diff(pg_last_wal_receive_lsn(), replay_lsn)::float else pg_wal_lsn_diff(pg_current_wal_lsn(), replay_lsn)::float end) AS pg_wal_lsn_diff
|
||||||
FROM pg_stat_replication
|
FROM pg_stat_replication
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
@ -61,8 +61,8 @@ var queryOverrides = map[string][]OverrideQuery{
|
|||||||
semver.MustParseRange(">=9.2.0 <10.0.0"),
|
semver.MustParseRange(">=9.2.0 <10.0.0"),
|
||||||
`
|
`
|
||||||
SELECT *,
|
SELECT *,
|
||||||
(case pg_is_in_recovery() when 't' then null else pg_current_xlog_location() end) AS pg_current_xlog_location,
|
(case pg_is_in_recovery() when 't' then pg_last_xlog_receive_location() else pg_current_xlog_location() end) AS pg_current_xlog_location,
|
||||||
(case pg_is_in_recovery() when 't' then null else pg_xlog_location_diff(pg_current_xlog_location(), replay_location)::float end) AS pg_xlog_location_diff
|
(case pg_is_in_recovery() when 't' then pg_xlog_location_diff(pg_last_xlog_receive_location(), replay_location)::float else pg_xlog_location_diff(pg_current_xlog_location(), replay_location)::float end) AS pg_xlog_location_diff
|
||||||
FROM pg_stat_replication
|
FROM pg_stat_replication
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
@ -70,7 +70,7 @@ var queryOverrides = map[string][]OverrideQuery{
|
|||||||
semver.MustParseRange("<9.2.0"),
|
semver.MustParseRange("<9.2.0"),
|
||||||
`
|
`
|
||||||
SELECT *,
|
SELECT *,
|
||||||
(case pg_is_in_recovery() when 't' then null else pg_current_xlog_location() end) AS pg_current_xlog_location
|
(case pg_is_in_recovery() when 't' then pg_last_xlog_receive_location() else pg_current_xlog_location() end) AS pg_current_xlog_location
|
||||||
FROM pg_stat_replication
|
FROM pg_stat_replication
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
@ -80,14 +80,16 @@ var queryOverrides = map[string][]OverrideQuery{
|
|||||||
{
|
{
|
||||||
semver.MustParseRange(">=9.4.0 <10.0.0"),
|
semver.MustParseRange(">=9.4.0 <10.0.0"),
|
||||||
`
|
`
|
||||||
SELECT slot_name, database, active, pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn)
|
SELECT slot_name, database, active,
|
||||||
|
(case pg_is_in_recovery() when 't' then pg_xlog_location_diff(pg_last_xlog_receive_location(), restart_lsn) else pg_xlog_location_diff(pg_current_xlog_location(), restart_lsn) end) as pg_xlog_location_diff
|
||||||
FROM pg_replication_slots
|
FROM pg_replication_slots
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
semver.MustParseRange(">=10.0.0"),
|
semver.MustParseRange(">=10.0.0"),
|
||||||
`
|
`
|
||||||
SELECT slot_name, database, active, pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)
|
SELECT slot_name, database, active,
|
||||||
|
(case pg_is_in_recovery() when 't' then pg_wal_lsn_diff(pg_last_wal_receive_lsn(), restart_lsn) else pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) end) as pg_wal_lsn_diff
|
||||||
FROM pg_replication_slots
|
FROM pg_replication_slots
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user