Skip to content

Expose gauges to report status of partitioning

Andreas Brandl requested to merge ab/partition-metrics into master

What does this MR do?

This adds two metrics (gauges) to observe the state of dynamic partitioning: For time-based partitioning, it is crucial to create partitions ahead of time and before they are being needed. If there is no partition created yet (e.g. for the current month), inserts to the partitioned table simply fail.

In order to track the state of this and perhaps even to facilitate some alerting later, we add two gauges per table:

  1. db_partitions_present
  2. db_partitions_missing

Under normal conditions, db_partitions_missing would be 0 or - only very shortly - 1. The latter is a race condition which normally doesn't happen.

We also report db_partitions_present to be able to observe that partitions are being created properly over time.

Issue is #227353 (closed)

Conformity

Edited by Andreas Brandl

Merge request reports

Loading