-
Notifications
You must be signed in to change notification settings - Fork 801
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
Adding a metric for hosts not being found in resolver #5414
Adding a metric for hosts not being found in resolver #5414
Conversation
common/membership/resolver.go
Outdated
@@ -193,6 +198,7 @@ func (rpo *MultiringResolver) Unsubscribe(service string, name string) error { | |||
func (rpo *MultiringResolver) Members(service string) ([]HostInfo, error) { | |||
ring, err := rpo.getRing(service) | |||
if err != nil { | |||
rpo.metrics.Scope(metrics.ResolverHostNotFoundScope).IncCounter(1) |
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.
Isn't it better to move to LookupByAddress() which calls Members
?
Then it would be clear - every time LookupByAddress
returns empty HostInfo
we emit the metric.
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.
yes, you're right, I was being a bit hurried and this doesn't make sense
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.
Something is off with you goimports setup. Otherwise LGTM
common/membership/resolver.go
Outdated
@@ -26,6 +26,7 @@ package membership | |||
import ( | |||
"errors" | |||
"fmt" | |||
"github.com/uber/cadence/common/metrics" |
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.
imports are messed up.
common/membership/resolver_test.go
Outdated
@@ -23,6 +23,7 @@ | |||
package membership | |||
|
|||
import ( | |||
"github.com/uber/cadence/common/metrics" |
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.
imports are messed up
What changed?
Adds a metric around hosts not being visible in the resolver. This is for debugging and early alerting, though it's normal for this metric to appear during rebalancing or deployments temporarily. Long periods of this metric firing may indicate a problem with service discovery.
Why?
How did you test it?
Potential risks
Release notes
Documentation Changes