You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-08-09 15:42:47 +03:00
Supports alternate postgres:// prefix in URLs
Adds support for the alternate postgres:// prefix in URLs. It's maybe not the cleanest approach, but works. Hoping I can either get some pointers on a more appropriate patch, or that we could use this in the interim to unblock this use-case. Signed-off-by: Jack Wink <57678801+mothershipper@users.noreply.github.com>
This commit is contained in:
@@ -35,7 +35,7 @@ func (e *Exporter) discoverDatabaseDSNs() []string {
|
||||
var dsnURI *url.URL
|
||||
var dsnConnstring string
|
||||
|
||||
if strings.HasPrefix(dsn, "postgresql://") {
|
||||
if strings.HasPrefix(dsn, "postgresql://") || strings.HasPrefix(dsn, "postgres://") {
|
||||
var err error
|
||||
dsnURI, err = url.Parse(dsn)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user