-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add force preferred ip protocol #382
Add force preferred ip protocol #382
Conversation
What about calling this feature |
preferred_ip_protocol is already existing in blackbox_exporter. The current default is ip6 and fallback to ip4 if there's no IPv6 available. My patch make it possible to disable the fallback, and force the prefered ip protocol. |
@laghoule Yes, I understand. What I'm suggesting is we simplify the naming so that we have two options. |
@SuperQ sorry for the misunderstanding. I agree with you. I will make the modification. |
I would like to maintain the original behavior, which is to "preferred" mode by default. Also, with the switch to a bool, |
Yeah make sense. I will do that. |
Signed-off-by: Pascal Gauthier <[email protected]> Signed-off-by: Pascal Gauthier <[email protected]>
Signed-off-by: Pascal Gauthier <[email protected]> Signed-off-by: Pascal Gauthier <[email protected]>
Signed-off-by: Pascal Gauthier <[email protected]>
Signed-off-by: Pascal Gauthier <[email protected]>
This reverts commit 964bd87. Signed-off-by: Pascal Gauthier <[email protected]>
This reverts commit df88900. Signed-off-by: Pascal Gauthier <[email protected]>
Signed-off-by: Pascal Gauthier <[email protected]>
Signed-off-by: Pascal Gauthier <[email protected]>
Signed-off-by: Pascal Gauthier <[email protected]>
Oh, I think there was a misunderstanding. I want to keep |
Signed-off-by: Pascal Gauthier <[email protected]>
@SuperQ sorry, I was doing the change after work, my brain was not fully operational ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
prober/utils.go
Outdated
level.Warn(logger).Log("msg", "Resolution with preferred IP protocol failed, attempting fallback protocol", "fallback_protocol", fallbackProtocol, "err", err) | ||
ip, err = net.ResolveIPAddr(fallbackProtocol, target) | ||
if fallbackIPProtocol == false { | ||
level.Error(logger).Log("msg", "Resolution with IP protocol failed (fallback IP protocol is FALSE): err", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fallback_ip_protocol would be easier for users to find, and the FALSE could be false.
The default behavior is the same though.
…On Fri 23 Nov 2018, 19:44 Ben Kochie ***@***.*** wrote:
***@***.**** commented on this pull request.
------------------------------
In CONFIGURATION.md
<#382 (comment)>
:
> @@ -84,8 +84,9 @@ The other placeholders are specified separately.
# HTTP proxy server to use to connect to the targets.
[ proxy_url: <string> ]
- # The preferred IP protocol of the HTTP probe (ip4, ip6).
- [ preferred_ip_protocol: <string> | default = "ip6" ]
+ # The IP protocol of the HTTP probe (ip4, ip6).
+ [ ip_protocol: <string> | default = "ip6" ]
I wanted to make it obvious that this is a behavior change.
But I like the idea of a deprecation warning.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#382 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGyTdkcUO8guGnYX1ROn_ylVq-ODmgciks5uyEIAgaJpZM4YebpL>
.
|
@brian-brazil Yea, works for me. I think adding |
@laghoule, do you want to implement the |
@SuperQ, yes I will do it. I hope to have some free time this week to work on this. |
Signed-off-by: Pascal Gauthier <[email protected]>
Signed-off-by: Pascal Gauthier <[email protected]>
CONFIGURATION.md
Outdated
# The preferred IP protocol of the HTTP probe (ip4, ip6). | ||
[ preferred_ip_protocol: <string> | default = "ip6" ] | ||
# The IP protocol of the HTTP probe (ip4, ip6). | ||
[ preferred_ip_protocol: <string> | default = "ip6" *DEPRECATED* ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why we're deprecating this just to change its name, this would cause unnecessary work for all our existing users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never liked the name or behavior of this code. With the new code, it's nolonger exactly "preferred", it's just specifying a specific protocol, and having a fallback or not.
I do not want to go in circles on this review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still preferred, and we've already broken this config option before. If we're going to break it again I want to to be due a complete change in how it works, not a minor name change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not, the new behavior does not represent preferred anymore. With preferred, fallback was always an option. Now fallback is optional, and this necessitates a name change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that adding a new option necessitates breaking existing users.
CONFIGURATION.md
Outdated
# The IP protocol of the HTTP probe (ip4, ip6). | ||
[ preferred_ip_protocol: <string> | default = "ip6" *DEPRECATED* ] | ||
[ ip_protocol: <string> | default = "ip6" ] | ||
[ fallback_ip_protocol: <boolean | default = true> ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ip_protocol_fallback would make it clearer that this is a bool, rather than a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, posted comment to the wrong spot.
For this one, I agree, ip_protocol_fallback
does parse a little better in my head.
What do you think @laghoule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it's better visually and conceptually.
Signed-off-by: Pascal Gauthier <[email protected]>
@brian-brazil @SuperQ Let me know what you want to do about the breaking changes / deprecation issues. |
As I said I don't see the point of causing disruption for our existing users for no benefit to them. |
Ok, I will adjust the behavior. |
Is it OK to keep IPProtocol var, but use the preferred_ip_protocol yaml config?
|
That's fine. |
Signed-off-by: Pascal Gauthier <[email protected]>
Thanks! |
I was just testing this for release, and the default isn't true as the docs say. |
I will take a look at it as soon as possible. |
Is there somewhere I can download an alpha build containing this change, or would I need to build blackbox_exporter myself? |
I will have the merge request this week. I will post it here.
Pascal Gauthier
…On Tue., Mar. 12, 2019, 02:02 Daniel Lo Nigro, ***@***.***> wrote:
Is there somewhere I can download an alpha build containing this change,
or would I need to build blackbox_exporter myself?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#382 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABhiZ0DKMiW9zgUyX3gQGWJMAgf0B1XSks5vV0L8gaJpZM4YebpL>
.
|
Great! |
This MR should fix the issue: #436 |
In some case we may want to force a preferred protocol.
I'v added an option (false by default) for that purpose:
[ force_preferred_ip_protocol: <boolean | default = false> ]