Add deprecation warnings for DATA_SOURCE_* and PG_EXPORTER_* env vars

Open
#1,373 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go, postgresql
Domain
cli, observability

Research direction

Start with startup configuration and the kingpin Envar() handling, then trace how the datasource environment variables are read. Add warnings for each listed environment variable when it is used instead of its equivalent flag, identifying the replacement flag. Confirm that all listed Envar()-backed and datasource variables are covered and warnings appear at startup.

Written by the indexing model from the issue text.

Description

go help wanted

Part of #1371. Depends on #1372.

Summary

Once flag equivalents exist for all env vars (see #1372 for the DATA_SOURCE_* datasource flags; the PG_EXPORTER_* flags already have equivalents via kingpin's Envar()), log a warning at startup whenever an env var is used instead of its flag, pointing to the flag that should replace it.

Env vars to cover

  • Envar()-backed: 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
  • Datasource: DATA_SOURCE_NAME, DATA_SOURCE_URI(_FILE), DATA_SOURCE_USER(_FILE), DATA_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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from prometheus-community/postgres_exporter

All issues in prometheus-community/postgres_exporter

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.