Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies for 2.40 #11524

Merged
merged 1 commit into from Nov 3, 2022
Merged

Update dependencies for 2.40 #11524

merged 1 commit into from Nov 3, 2022

Conversation

codesome
Copy link
Member

@codesome codesome commented Nov 2, 2022

In prepartion for v2.40.0

@juliusv
Copy link
Member

juliusv commented Nov 2, 2022

CI looks like some types in dependencies have changed...

@codesome codesome force-pushed the updeps branch 2 times, most recently from 6aae35d to 6ce1267 Compare November 2, 2022 20:27
@@ -251,7 +250,10 @@ func main() {
a.Flag("web.listen-address", "Address to listen on for UI, API, and telemetry.").
Default("0.0.0.0:9090").StringVar(&cfg.web.ListenAddress)

webConfig := toolkit_webflag.AddFlags(a)
webConfig := a.Flag(
Copy link
Member Author

Choose a reason for hiding this comment

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

The toolkit_webflag.AddFlags dependency introduced a new flag and registers web.listen-address flag to be a slice of address with different message. So I just copied ther web config registration here to keep it same.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I think just updating to the new AddFlags would be better, or would that break anything else I'm not aware of?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. It adds a new flag web.systemd-socket which is not used in Prometheus but still will be visible in the help text.
  2. In Prometheus web.listen-address is a single address, but the AddFlags overrides it to be a list of address and help text saying you can add more than one address, so we can't use that in Prometheus directly. (the code)

Copy link
Member

Choose a reason for hiding this comment

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

Ah yeah, I was aware of the multiple addresses but thought we could just allow listening on multiple in Prometheus as well.

For the systemd socket, by skimming prometheus/exporter-toolkit#95 it looks like it'd just work for Prometheus as well, but of course there's limited use for that in Prometheus, which should always be running. I think in the long run it'd be good to modify the exporter toolkit to make that flag optional (that way we have to duplicate less boiler plate here), but this PR is fine for now.

Choose a reason for hiding this comment

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

As noted in that pull, the purpose of the systemd socket is so that the service can use a privileged port when running as non-root without any additional messy configuration on the operating system side. It also prevents other unprivileged processes from stealing the unprivileged port. In general it provides an optionally more secure way to listen on systemd-based systems. The benefits of this are more thoroughly explained in prometheus/node_exporter#2393. There was not much interest in jumpstarting a service that should always be running.

In general the pull allows for listening in multiple places and aims to reduce boilerplate everywhere else by urging exporter maintainers to not use the config struct directly. Possibly there is a way to make use of the same code without duplicating it here? It simplifies listening on multiple addresses or systemd sockets to only a few lines:
https://github.com/prometheus/node_exporter/pull/2393/files#diff-7907251477470326df65250bf7fa699e0756ce5d6282e27b34c112132a7ef6b5R193-R197

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
@codesome
Copy link
Member Author

codesome commented Nov 2, 2022

@juliusv should be all good now

@codesome codesome mentioned this pull request Nov 2, 2022
@beorn7
Copy link
Member

beorn7 commented Nov 3, 2022

I'm a bit confused that there are so many updated dependencies. Shouldn't they update automatically via dependabot?

@codesome
Copy link
Member Author

codesome commented Nov 3, 2022

Shouldn't they update automatically via dependabot?

Not sure how the bot works :/

@codesome codesome merged commit 6dd4e90 into prometheus:main Nov 3, 2022
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.

None yet

4 participants