-
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 probe_ip_addr_hash to detect if the IP changes #584
Conversation
Signed-off-by: Wing924 <[email protected]>
Can we use a better hash? |
@brian-brazil this hash is copied from java's Why I use this simple hash instead of SHA256:
But I'm not have strong opinion on using this simple hash. |
Use any hash that Go provides and truncate it to 32 bits. |
Signed-off-by: Wing924 <[email protected]>
@brian-brazil I've changed the hash func to Go provided. |
prober/utils.go
Outdated
@@ -37,8 +38,20 @@ func chooseProtocol(ctx context.Context, IPProtocol string, fallbackIPProtocol b | |||
Name: "probe_ip_protocol", | |||
Help: "Specifies whether probe ip protocol is IP4 or IP6", | |||
}) | |||
|
|||
probeIPAddr := prometheus.NewGaugeVec(prometheus.GaugeOpts{ |
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.
This IP could have high cardinality, it's not safe to expose it.
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.
Understood. I've removed that.
Signed-off-by: Wing924 <[email protected]>
Thanks! |
Looking for some documentation on the metric on how this can be used lead me to this pull request.
|
WHAT
add
probe_ip_addr_hash
metrics to specify the hash of IP addressWHY
We want to detect if the IP is changed by
change(probe_ip_addr_hash[10h])
Use Case
Assume you use CDN and you want to monitoring your web server.
if the edge server failover, blackbox exporter returns error and the IP address will be changed.
With
probe_ip_addr_hash
, we can tell the error happen due to edge failover.