Summary
The wal collector fails on Amazon Aurora PostgreSQL where
pg_ls_waldir() is not exposed, aborting the scrape every interval
and emitting no WAL metrics.
Root Cause
The collector calls pg_ls_waldir() to count and size WAL segments.
On Aurora the function returns:
ERROR: pg_ls_waldir() is currently not supported for Aurora
The collector treats any scan error as fatal, propagating it up and
killing the collector for that scrape.
Impact
Expected Behavior
When the underlying function returns the Aurora-specific
feature_not_supported error, the collector should degrade gracefully:
skip emitting pg_wal_segments / pg_wal_size instead of failing the
whole scrape.
Proposed Solution
Detect the Aurora-specific error (PostgreSQL error class 0A
(feature_not_supported) with "Aurora" in the message) inside
collector/pg_wal.go and short-circuit cleanly (skip emitting the
metrics, return without error). This mirrors the approach in #1274
which fixes the same class of bug for the replication collector.
Sketch:
err := row.Scan(&segments, &size)
if err != nil {
if isAuroraUnsupportedFunction(err) {
return nil // Aurora doesn't support pg_ls_waldir; skip silently
}
return err
}
isAuroraUnsupportedFunction is a tiny helper that checks
pqErr.Code.Class() == "0A" && strings.Contains(pqErr.Message, "Aurora").
Environment
- postgres_exporter v0.19.x / current
main
- Amazon Aurora PostgreSQL versions where
pg_ls_waldir() is restricted
Summary
The
walcollector fails on Amazon Aurora PostgreSQL wherepg_ls_waldir()is not exposed, aborting the scrape every intervaland emitting no WAL metrics.
Root Cause
The collector calls
pg_ls_waldir()to count and size WAL segments.On Aurora the function returns:
The collector treats any scan error as fatal, propagating it up and
killing the collector for that scrape.
Impact
pg_wal_*metrics on every scrape.to a different built-in function).
Expected Behavior
When the underlying function returns the Aurora-specific
feature_not_supportederror, the collector should degrade gracefully:skip emitting
pg_wal_segments/pg_wal_sizeinstead of failing thewhole scrape.
Proposed Solution
Detect the Aurora-specific error (PostgreSQL error class
0A(
feature_not_supported) with"Aurora"in the message) insidecollector/pg_wal.goand short-circuit cleanly (skip emitting themetrics, return without error). This mirrors the approach in #1274
which fixes the same class of bug for the
replicationcollector.Sketch:
isAuroraUnsupportedFunctionis a tiny helper that checkspqErr.Code.Class() == "0A" && strings.Contains(pqErr.Message, "Aurora").Environment
mainpg_ls_waldir()is restricted