Skip to content

Commit aff0f28

Browse files
committed
Fix missing dsn sanitization for logging
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 prometheus-community#1042 Signed-off-by: Joe Adams <[email protected]>
1 parent 6f36adf commit aff0f28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cmd/postgres_exporter/postgres_exporter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
678678
if err := e.scrapeDSN(ch, dsn); err != nil {
679679
errorsCount++
680680

681-
logger.Error("error scraping dsn", "err", err, "dsn", dsn)
681+
logger.Error("error scraping dsn", "err", err, "dsn", loggableDSN(dsn))
682682

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

0 commit comments

Comments
 (0)