Skip to content

Make the DATA_SOURCE_URI environment variable a real URI #113

@rgl

Description

@rgl

The DATA_SOURCE_URI environment variable is not really an URI as seen in:

https://github.com/wrouesnel/postgres_exporter/blob/6e3d130f40423ef7a55bcc9f971fce79e40e4ff2/postgres_exporter.go#L1033-L1034

It's part of the URI. What do you think in making it really an uri? Like postgresql://postgres@localhost:5432?sslmode=disable, then later parse it to set the user and password if the corresponding environment variable exists (that would also prevent uri escaping issues that exist with the current code, as it simply concatenates the user and pass without proper escaping).

BTW, why was there a need to introduce a new environment variable? Why not reuse the DATA_SOURCE_NAME? This seems like a compatible change.

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