Add --datasource.* CLI flags to replace DATA_SOURCE_* env vars
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start in exporter/datasource.go by tracing GetDataSources() and how it currently reads the DATA_SOURCE_* environment variables. Locate the project's CLI flag registration path, add the seven listed datasource options with equivalent configuration behavior, and verify that each flag can provide the corresponding setting without relying on its environment variable.
Written by the indexing model from the issue text.
Description
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(replacesDATA_SOURCE_NAME)--datasource.uri(replacesDATA_SOURCE_URI)--datasource.uri-file(replacesDATA_SOURCE_URI_FILE)--datasource.user(replacesDATA_SOURCE_USER)--datasource.user-file(replacesDATA_SOURCE_USER_FILE)--datasource.pass(replacesDATA_SOURCE_PASS)--datasource.pass-file(replacesDATA_SOURCE_PASS_FILE)
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 835
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 10
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.
More from prometheus-community/postgres_exporter
-
BDU:2025-02344 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
prometheus-community/postgres_exporter#716 · 3 reactions ·
All issues in prometheus-community/postgres_exporter
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100