Skip to content

Commit 16d66b8

Browse files
ORA-28000 error invalidates database (#373)
Signed-off-by: Anders Swanson <[email protected]>
1 parent 251b29a commit 16d66b8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

collector/database.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818

1919
const (
2020
ora01017code = 1017
21+
ora28000code = 28000
2122
)
2223

2324
func (d *Database) UpMetric(exporterLabels map[string]string) prometheus.Metric {
@@ -154,7 +155,7 @@ func isInvalidCredentialsError(err error) bool {
154155
if !ok {
155156
return false
156157
}
157-
return oraErr.Code() == ora01017
158+
return oraErr.Code() == ora01017code || oraErr.Code() == ora28000code
158159
}
159160

160161
func connect(logger *slog.Logger, dbname string, dbconfig DatabaseConfig) (*sql.DB, float64) {

site/docs/releases/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Our current priorities to support metrics for advanced database features and use
1313

1414
- Updated project dependencies.
1515
- Standardize multi-arch builds and document supported database versions.
16-
- 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.
16+
- 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.
1717
- Metrics with an empty databases array (`databases = []`) are now considered disabled, and will not be scraped.
1818
- Increased the default query timeout for the `top_sql` metric to 10 seconds (previously 5 seconds).
1919
- 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.

0 commit comments

Comments
 (0)