Skip to content

Add aurora_replica_status collector#1311

Open
megative wants to merge 1 commit into
prometheus-community:masterfrom
megative:feat/aurora-init-detection-and-replica-status
Open

Add aurora_replica_status collector#1311
megative wants to merge 1 commit into
prometheus-community:masterfrom
megative:feat/aurora-init-detection-and-replica-status

Conversation

@megative
Copy link
Copy Markdown

@megative megative commented May 17, 2026

Summary

First PR in a series splitting #1308 (Aurora support) into one-PR-per-collector as requested by @sysadmind.

This PR adds:

  • Aurora auto-detection infrastructure on instance struct. Mirrors the existing version field pattern (per @SuperQ feedback). On everysetup(), a one-shot SELECT aurora_version() runs via sync.Once — exactly one probe per process lifetime. The result is cached in instance.isAurora and read by Aurora-specific collectors.

  • aurora_replica_status collector. Exposes the values from Aurora's aurora_replica_status() built-in: replica lag (per server), replay latency, and pending read IOs. Disabled by default (--collector.aurora_replica_status); on non-Aurora servers it short-circuits to ErrNoData cleanly.

Test plan

  • go build ./..., go vet ./..., go test ./... clean.
  • Tested live against an Aurora PostgreSQL 17.7.0 cluster — collector
    emits metrics; per-process aurora_version() probe fires exactly once.
  • Tested against vanilla PostgreSQL 17 — collector returns ErrNoData
    silently; no error logs.

Follow-up PRs in the series will add the remaining 8 Aurora collectors on top of this infrastructure.

Add the first Amazon Aurora PostgreSQL collector, with the supporting
Aurora detection infrastructure on the instance struct.

- instance.isAurora bool field, set by setup() via a one-shot
  SELECT aurora_version() (sync.Once, one probe per process)
- aurora_replica_status collector exposes replica lag, replay latency,
  and pending read IOs from aurora_replica_status(). Gated on
  instance.isAurora — on non-Aurora servers returns ErrNoData.
- Disabled by default; opt-in via --collector.aurora_replica_status.

First in a series of per-collector PRs splitting prometheus-community#1308 as requested by
@sysadmind.

Signed-off-by: Pavel K <megativ3@gmail.com>
@megative
Copy link
Copy Markdown
Author

hi @SuperQ @sysadmind
Could you guys please take a look? It would be great to deliver Aurora support to upstream.

@megative
Copy link
Copy Markdown
Author

@SuperQ @sysadmind guys, sorry for pushing but any luck you have a chance to review this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant