Aller au contenu
login
arrow_backRetour aux issues
prometheus-community/postgres_exporter #1372

Add --datasource.* CLI flags to replace DATA_SOURCE_* env vars

ecoDébutant help wanted go

descriptionDescription

Part of #1371. **Summary** `GetDataSources()` in `exporter/datasource.go` currently reads the Postgres connection config only from env vars, with no CLI flag path. Add flags that provide the same configuration options, so the env vars have something to deprecate in favor of. **New flags** - `--datasource.dsn` (replaces `DATA_SOURCE_NAME`) - `--datasource.uri` (replaces `DATA_SOURCE_URI`) - `--datasource.uri-file` (replaces `DATA_SOURCE_URI_FILE`) - `--datasource.user` (replaces `DATA_SOURCE_USER`) - `--datasource.user-file` (replaces `DATA_SOURCE_USER_FILE`) - `--datasource.pass` (replaces `DATA_SOURCE_PASS`) - `--datasource.pass-file` (replaces `DATA_SOURCE_PASS_FILE`)
codeOuvre sur GitHub