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 to exporter-toolkit v0.8.2 #979

Conversation

DaAwesomeP
Copy link
Contributor

This pull updates the blackbox_exporter to use the latest version of exporter-toolkit and includes the new flag methods.

Associated exporter-toolkit pull: prometheus/exporter-toolkit#95

Similar node_exporter pull: prometheus/node_exporter#2393

cc @SuperQ @roidelapluie

@DaAwesomeP
Copy link
Contributor Author

Build is failing because go mod tidy prompts if Go 1.16 compatibility is required (this is reproduceable on local machines). Running go mod tidy -compat=1.17 does not prompt and passes. client_golang v1.13.0 requires a minimum of Go 1.17.

Please advise on the preferred solution.

@SuperQ
Copy link
Member

SuperQ commented Oct 21, 2022

Bumping the indirect dependencies is the preferred method. For example go get golang.org/x/xerrors.

@SuperQ
Copy link
Member

SuperQ commented Oct 21, 2022

Maybe we should move the external URL and route prefix features to the toolkit next.

@DaAwesomeP
Copy link
Contributor Author

Fixed dependency issues! Now passes tests.

Maybe we should move the external URL and route prefix features to the toolkit next.

Yeah, I can look into that next possibly. Though no promises as my non-work open source timeline is often sporadic. The route prefix option seems pretty popular, though I guess in my limited experience so far I have not encountered external URL as much.

I think if we were to formalize getting data out of the flags then we should probably implement helper methods instead of encouraging struct access to avoid possible later breaking changes. This is more a discussion for the toolkit repo so maybe I will open an issue there.

For v0.8.0 though, this should be good to go (pun intended)!

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

Need to pull in the bug fix, otherwise LGTM.

go.mod Outdated Show resolved Hide resolved
@DaAwesomeP DaAwesomeP requested a review from SuperQ October 22, 2022 16:16
@DaAwesomeP
Copy link
Contributor Author

Bumped exporter-toolkit to v0.8.1!

@DaAwesomeP DaAwesomeP changed the title Update to exporter-toolkit v0.8.0 Update to exporter-toolkit v0.8.1 Oct 22, 2022
@DaAwesomeP
Copy link
Contributor Author

@SuperQ just checking in on this!

@@ -92,7 +91,14 @@ func run() int {
level.Info(logger).Log("msg", "Loaded config file")

// Infer or set Blackbox exporter externalURL
beURL, err := computeExternalURL(*externalURL, *listenAddress)
listenAddrs := toolkitFlags.WebListenAddresses
if *externalURL == "" && *toolkitFlags.WebSystemdSocket {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be *externalURL != ""

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 believe it is correct, and I tested it. This if statement intentionally throws an error if an external URL is not explicitly provided when using a systemd socket listener. This is because the external URL can never be inferred from the systemd socket.

Copy link
Member

Choose a reason for hiding this comment

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

But, what if you don't care about the external URL? It's an optional setting in the normal case. Wouldn't this for the user to set an external URL in systemd mode? I don't think that's desired.

Copy link
Contributor Author

@DaAwesomeP DaAwesomeP Nov 15, 2022

Choose a reason for hiding this comment

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

External URL is an optional setting because it infers it from the port number or hostname provided when no external URL is provided. It can't infer this with the systemd socket. The default from the optional flag is an empty string, but then the function called on it later finds the real fallback value.

If you're saying the external URL is not actually needed for the exporter to function, then I think that goes past the scope of this pull. The existing function attempts to find a fallback default value when not is provided.

@SuperQ SuperQ requested review from roidelapluie and mem November 15, 2022 13:22
@roidelapluie roidelapluie merged commit 8ac0a8e into prometheus:master Dec 1, 2022
@roidelapluie
Copy link
Member

Thanks!

@roidelapluie roidelapluie changed the title Update to exporter-toolkit v0.8.1 Update to exporter-toolkit v0.8.2 Dec 1, 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.

3 participants