Skip to content

Help about the syntax for the environment variable DATA_SOURCE_NAME for multiple database #273

@chhith

Description

@chhith

Hi,
I'm trying postgres_exporter for Prometheus. I need some help about the syntax for the DATA_SOURCE_NAME variable in the case we have multiple database in one instance.

On my postgresql server, I have 2 database (Bills and Customers).
It worked when I set DATA_SOURCE_NAME with a single DB like this :
export DATA_SOURCE_NAME="postgresql://login:password@localhost:5432/bills?sslmode=disable"
or
export DATA_SOURCE_NAME="postgresql://login:password@localhost:5432/customers?sslmode=disable

But I got those messages error when I set the DATA_SOURCE_NAME like this :
export DATA_SOURCE_NAME="postgresql://login:password@localhost:5432/bills?sslmode=disable,postgresql://login:password@localhost:5432/customers?sslmode=disable"

INFO[0000] Established new database connection. source="postgres_exporter.go:1035"
INFO[0000] Error while closing non-pinging DB connection: source="postgres_exporter.go:1041"
INFO[0000] Error opening connection to database (postgresql://login:PASSWORD_REMOVED@localhost:5432/bills?sslmode=disable,postgresql://login:password@localhost:5432/customers?sslmode=disable): pq: unsupported sslmode "disable,postgresql://postgres:postgres@localhost:5432/postgres2?sslmode=disable"; only "require" (default), "verify-full", "verify-ca", and "disable" supported source="postgres_exporter.go:1070"

Could you help me with the correct syntax please ? O should I launch one exporter per database ?

I'm grateful in advance :)

Kinds

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions