Skip to content

Commit

Permalink
Fix missing dsn sanitization for logging (#1104)
Browse files Browse the repository at this point in the history
This log line was not sanitized previously which could result in logging sensitive information. I have scanned the rest of the files and I don't see anywhere else that DSN is used in a log line without this filter.

Resolves #1042

Signed-off-by: Joe Adams <[email protected]>
  • Loading branch information
sysadmind authored Feb 15, 2025
1 parent 99e1b51 commit 4c170ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/postgres_exporter/postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
if err := e.scrapeDSN(ch, dsn); err != nil {
errorsCount++

logger.Error("error scraping dsn", "err", err, "dsn", dsn)
logger.Error("error scraping dsn", "err", err, "dsn", loggableDSN(dsn))

if _, ok := err.(*ErrorConnectToServer); ok {
connectionErrorsCount++
Expand Down

0 comments on commit 4c170ed

Please sign in to comment.