Skip to content

Metrics ​

Tack is a command, so it serves no metrics of its own. It reads two metrics of CloudNativePG while it plans, and records how long each run kept writes down.

What Tack reads ​

Each replica's instance manager serves its metrics on port 9187, path /metrics. Tack reads them through the API server's pod proxy, with the same permission as the WAL position (row 18 of Permissions), and no database credential.

MetricFromTack uses it for
cnpg_pg_replication_lagCloudNativePG's default monitoring queriesthe replay lag in the plan's WAL positions, and a warning in a site-loss plan when the target still has WAL to replay
cnpg_tack_replay_timestamp_secondsTack's opt-in replay-time query, which an operator adds to each Cluster (Replay time)when the target's last replayed commit was, in the plan and in the ledger's status.fork.lastCommit

A metric that is missing, or that cannot be read, leaves the plan as it is without it, and never refuses a run. RFC#0004, Requirement 13, has the rules.

What Tack records ​

RecordWhere
When writes stopped and came backstatus.writes, and the line Writes down: of tack status RUN (How long writes stay down)
When each phase and step started and ended, and each step's earlier attemptsstatus.phases, status.steps, and tack status RUN
Where a site loss's new history leaves the old onestatus.fork

To measure what clients see, in staging, use hack/measure/writes.sh with Measure failover time. Data loss and downtime sets the budget.

Released under the Apache License 2.0.