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

Adding a metric for hosts not being found in resolver #5414

Merged
merged 9 commits into from
Dec 22, 2023

Conversation

davidporter-id-au
Copy link
Member

@davidporter-id-au davidporter-id-au commented Oct 7, 2023

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

@davidporter-id-au davidporter-id-au changed the title Adding a metric Adding a metric for hosts missing Oct 8, 2023
@davidporter-id-au davidporter-id-au changed the title Adding a metric for hosts missing Adding a metric for hosts not being found in resolver Oct 8, 2023
@@ -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)
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

@3vilhamster 3vilhamster left a 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

@@ -26,6 +26,7 @@ package membership
import (
"errors"
"fmt"
"github.com/uber/cadence/common/metrics"
Copy link
Member

Choose a reason for hiding this comment

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

imports are messed up.

@@ -23,6 +23,7 @@
package membership

import (
"github.com/uber/cadence/common/metrics"
Copy link
Member

Choose a reason for hiding this comment

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

imports are messed up

@davidporter-id-au davidporter-id-au enabled auto-merge (squash) October 14, 2023 02:48
@davidporter-id-au davidporter-id-au merged commit a031fe6 into master Dec 22, 2023
16 checks passed
@davidporter-id-au davidporter-id-au deleted the bugfix/adding-host-not-found-metrics branch December 22, 2023 20:00
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