Skip to content

feat(metrics): add auth support for Prometheus push gateway mode#20045

Closed
mablr wants to merge 6 commits intoparadigmxyz:mainfrom
mablr:feature/prometheus_push_gateway_authentication
Closed

feat(metrics): add auth support for Prometheus push gateway mode#20045
mablr wants to merge 6 commits intoparadigmxyz:mainfrom
mablr:feature/prometheus_push_gateway_authentication

Conversation

@mablr
Copy link
Contributor

@mablr mablr commented Nov 30, 2025

#19243 (review) follow-up.

Add basic auth support for Prometheus push gateway mode.

It's unfortunately not practicable to use directly the built-in PrometheusBuilder::with_push_gateway, see metrics-rs/metrics#634, so that's why I think PR may be relevant.

@mablr mablr marked this pull request as ready for review December 1, 2025 08:17
requires = "push_gateway_password",
env = "RETH_METRICS_PUSH_USERNAME"
)]
pub push_gateway_username: Option<String>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we perhaps just combine these two into one arg?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean :

  • a single arg "username:password" that will be parsed ?
  • or an inner flatten optional Clap arg struct containing username and password fields ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize it should be possible to set username and leave password empty. (I'll fix that)

So the "username:password" argument to parse is definitely too complex compared to the benefit of having a single auth arg.

default_value = "5",
value_parser = parse_duration_from_secs,
value_name = "SECONDS",
help_heading = "Metrics"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we keep the heading here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As all fields of MetricArgs had this, I replaced them by adding to the struct #[command(next_help_heading = "Metrics")].

I can revert this btw, and set help_heading for each arg.

Comment on lines +620 to +621
self.node_config().metrics.push_gateway_username.clone(),
self.node_config().metrics.push_gateway_password.clone(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're only using these together perhaps we can make this a single Option instead?

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Dec 1, 2025
@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Dec 23, 2025
@github-actions github-actions bot removed the S-stale This issue/PR is stale and will close with no further activity label Jan 16, 2026
@emmajam
Copy link
Collaborator

emmajam commented Feb 25, 2026

Hey! We're doing some spring cleaning on our PR backlog 🧹 Closing old PRs to keep things tidy. If this is still relevant, please feel free to re-open — we appreciate your contribution!

@emmajam emmajam closed this Feb 25, 2026
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants