Skip to content

config: add reusable exporter config package#3660

Draft
nicolastakashi wants to merge 1 commit into
prometheus:masterfrom
nicolastakashi:embeddable-config-foundation
Draft

config: add reusable exporter config package#3660
nicolastakashi wants to merge 1 commit into
prometheus:masterfrom
nicolastakashi:embeddable-config-foundation

Conversation

@nicolastakashi
Copy link
Copy Markdown

@nicolastakashi nicolastakashi commented May 19, 2026

Summary

This starts a small, incremental refactor to make node_exporter easier to embed outside the standalone binary.

The broader goal is to support ongoing work to make Prometheus exporters embeddable inside the Prometheus OpenTelemetry Collector distribution as native receivers, without requiring each exporter to be rewritten as an OpenTelemetry component.

As a first step, this PR introduces a standalone config package that:

  • defines a reusable top-level Config type
  • provides shared defaults for top-level exporter settings
  • centralizes validation for those settings

This does not make node_exporter fully embeddable yet. It is intended as groundwork for follow-up changes that will extract reusable runtime construction from the CLI layer and gradually reduce process-global configuration wiring.

Why

Today, top-level exporter configuration is constructed directly in the binary entrypoint. Moving that configuration shape into a reusable package gives downstream callers and future runtime code a shared place for:

  • defaults
  • validation
  • config construction independent of CLI parsing

That is a useful first step toward separating:

  • binary concerns such as flags, HTTP serving, and process setup
  • reusable exporter concerns such as config and collector/runtime construction

Signed-off-by: Nicolas Takashi <nicolas.tcs@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant