From 05993a3bd965acd8244c9fc3af716410ba1f07ca Mon Sep 17 00:00:00 2001 From: Anders Swanson Date: Fri, 26 Sep 2025 11:29:38 -0700 Subject: [PATCH] ORA-28000 error invalidates database Signed-off-by: Anders Swanson --- collector/database.go | 3 ++- site/docs/releases/changelog.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/collector/database.go b/collector/database.go index 5ef3894d..dbc4bbfb 100644 --- a/collector/database.go +++ b/collector/database.go @@ -18,6 +18,7 @@ import ( const ( ora01017code = 1017 + ora28000code = 28000 ) func (d *Database) UpMetric(exporterLabels map[string]string) prometheus.Metric { @@ -154,7 +155,7 @@ func isInvalidCredentialsError(err error) bool { if !ok { return false } - return oraErr.Code() == ora01017 + return oraErr.Code() == ora01017code || oraErr.Code() == ora28000code } func connect(logger *slog.Logger, dbname string, dbconfig DatabaseConfig) (*sql.DB, float64) { diff --git a/site/docs/releases/changelog.md b/site/docs/releases/changelog.md index e3641f04..45f8973f 100644 --- a/site/docs/releases/changelog.md +++ b/site/docs/releases/changelog.md @@ -13,7 +13,7 @@ Our current priorities to support metrics for advanced database features and use - Updated project dependencies. - Standardize multi-arch builds and document supported database versions. -- If the exporter fails to connect to a database due to invalid credentials (ORA-01017 error), that database configuration will be invalidated and the exporter will not attempt to re-establish the database connection. Other databases will continue to be scraped. +- If the exporter fails to connect to a database due to invalid or locked credentials (ORA-01017 or ORA-28000 errors), that database configuration will be invalidated and the exporter will not attempt to re-establish the database connection. Other databases will continue to be scraped. - Metrics with an empty databases array (`databases = []`) are now considered disabled, and will not be scraped. - Increased the default query timeout for the `top_sql` metric to 10 seconds (previously 5 seconds). - Metrics using the `scrapeinterval` property will no longer be scraped on every request if they have a cached value. This only applies when the metrics exporter is configured to scrape metrics _on request_, rather than on a global interval.