Fix missing dsn sanitization for logging (#1104)

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 <github@joeadams.io>
This commit is contained in:
Joe Adams 2025-02-15 10:35:04 -05:00 committed by GitHub
parent 99e1b5118c
commit 4c170ed564
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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++