prometheus-community / prometheus-community/postgres_exporter
Deprecate environment variable configuration in favor of CLI flags
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 835
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 10
Description
Summary
postgres_exporter supports env-var configuration in two ways. We want to move fully to CLI flags, deprecate the env vars, and remove them after 2 releases.
Current state
-
Flags with an
Envar()fallback, settable via flag or env var. Kingpin doesn't record which one was used:PG_EXPORTER_WEB_TELEMETRY_PATH,PG_EXPORTER_DISABLE_DEFAULT_METRICS,PG_EXPORTER_AUTO_DISCOVER_DATABASES,PG_EXPORTER_EXTEND_QUERY_PATH,PG_EXPORTER_CONSTANT_LABELS,PG_EXPORTER_EXCLUDE_DATABASES,PG_EXPORTER_INCLUDE_DATABASES,PG_EXPORTER_METRIC_PREFIX,PG_EXPORTER_COLLECTION_TIMEOUT. Each already has a matching CLI flag (several already marked DEPRECATED for other reasons). -
Env-var-only settings with no CLI flag (
exporter/datasource.go:GetDataSources()):DATA_SOURCE_NAME,DATA_SOURCE_USER(_FILE),DATA_SOURCE_PASS(_FILE),DATA_SOURCE_URI(_FILE). This is the Postgres connection config, and there's no flag today for setting it. -
The
prometheus-community/helm-chartspostgres-exporter chart setsDATA_SOURCE_NAME,DATA_SOURCE_URI(_FILE),DATA_SOURCE_USER(_FILE), andDATA_SOURCE_PASS(_FILE)directly as container env vars intemplates/deployment.yaml, confirmed against the chart's currentmainbranch. It has no equivalent flag-based path and will need updating in that separate repo.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by auditing the flag definitions and the environment-variable fallbacks listed in the issue, then read exporter/datasource.go:GetDataSources() for connection configuration. Inspect the prometheus-community/helm-charts postgres-exporter templates/deployment.yaml separately. Done means the deprecation path is defined for all listed variables, CLI coverage is addressed, and the chart migration is coordinated for removal after two releases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, helm, postgresql
- Domain
- cli, databases, devops
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100