feat(postgres): add TXID wraparound monitoring
cc @abrandl @msmiley @Finotto @NikolayS
- Part of https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/9965
- Part of https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/13392#note_581743954
- Rename
pg_database_datfrozenxid_and_datminmxid_age_datfrozenxid
andpg_database_datfrozenxid_and_datminmxid_age_datminmxid
topg_database_wraparound_age_datfrozenxid
andpg_database_wraparound_age_datminmxid
respectively.- This rename is safe, since the old metric was not consumed in any dashboards, alerts or recording rules.
- Switch from
age(datminmxid)
tomxid_age(datminmxid)
to correct the age calculation
The output of the query on the pg primary presently is as follows:
datname | age_datfrozenxid | age_datminmxid
---------------------+------------------+----------------
template1 | 180765323 | 2604050
gitlabhq_production | 199895030 | 7402384
postgres | 182343280 | 6985407
Next step will be to update gitlab-com/runbooks!3584 (merged) to use the renamed metrics. The query in that MR is likely to remain broadly similar to what it is at present.
Edited by Andrew Newdigate