iamseth / oracledb_exporter

Prometheus Oracle database exporter.
MIT License
472 stars 242 forks source link

Parse Dsn URL to handle user/password masking #452

Closed vicmarbev closed 1 month ago

vicmarbev commented 1 month ago

Description

Parse Dsn URL before trying to connect to be avoid printing user/password. When trying to connect via a malformed Dsn URL, the exporter logs something like this: caller=collector.go:263 level=error errorpingingoracle:="parse \"oracle://user:password@\\oracleserver.com:1556/sdfef\": net/url: invalid control character in URL" As this is treated as a generic error, the maskDsn function is not used.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

A test has been added

Screenshots (if appropriate):

Checklist: