Skip to content

feat(postgres): add TXID wraparound monitoring

cc @abrandl @msmiley @Finotto @NikolayS


  1. Rename pg_database_datfrozenxid_and_datminmxid_age_datfrozenxid and pg_database_datfrozenxid_and_datminmxid_age_datminmxid to pg_database_wraparound_age_datfrozenxid and pg_database_wraparound_age_datminmxid respectively.
    1. This rename is safe, since the old metric was not consumed in any dashboards, alerts or recording rules.
  2. Switch from age(datminmxid) to mxid_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

Merge request reports

Loading