We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aec5cf0 commit c3fbc44Copy full SHA for c3fbc44
cmd/postgres_exporter/datasource.go
@@ -75,7 +75,11 @@ func (e *Exporter) discoverDatabaseDSNs() []string {
75
}
76
77
if dsnURI != nil {
78
- dsnURI.Path = databaseName
+ if dsnURI.Host == "" && strings.HasPrefix(dsnURI.Path, "/") {
79
+ dsnURI.Path = "/" + databaseName
80
+ } else {
81
+ dsnURI.Path = databaseName
82
+ }
83
dsn = dsnURI.String()
84
} else {
85
// replacing one dbname with another is complicated.
0 commit comments