mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-08 10:11:26 +00:00
Merge 04e73d413c
into f8b7139174
This commit is contained in:
commit
2c7a6cc1ee
@ -216,5 +216,14 @@ func loggableDSN(dsn string) string {
|
||||
pDSN.User = url.UserPassword(pDSN.User.Username(), "PASSWORD_REMOVED")
|
||||
}
|
||||
|
||||
// Blank password data from parameters if not nil
|
||||
q := pDSN.Query()
|
||||
if q != nil {
|
||||
if q.Get("password") != "" {
|
||||
q.Set("password", "PASSWORD_REMOVED")
|
||||
pDSN.RawQuery = q.Encode()
|
||||
}
|
||||
}
|
||||
|
||||
return pDSN.String()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user