-
Notifications
You must be signed in to change notification settings - Fork 2.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
Query/Ruler: Add metric for number of endpoints resolved for each configured address. #1260
Conversation
`count(dns_provider_results)` tells us how many addresses have been configured through flags and file-SD, while `sum(dns_provider_results)` gives us the number of endpoints actually produced from these addresses.
@@ -91,6 +97,7 @@ func (p *Provider) Resolve(ctx context.Context, addrs []string) { | |||
p.resolverLookupsCount.Inc() | |||
if err != nil { | |||
// The DNS resolution failed. Continue without modifying the old records. | |||
p.resolved[addr] = p.resolved[addr] // Ensure metrics capture the result even if empty. |
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 really get this part is, it intentional? Isn't this noop?
It's tricky what should be there TBH ;p Should we set results for both query to empty and metrics to 0? should we only adjust metrics? Not sure yet.
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 ensures that the map contains an entry for the address. So when we iterate over the map keys for the metric, we report that there was an address configured regardless of whether we got some results here, got no results, or continue using previous results.
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, except one thing, commented below.
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, Thanks!
Changes
Add
thanos_querier_store_apis_dns_provider_results
/thanos_ruler_query_apis_dns_provider_results
metrics.count(dns_provider_results)
tells us how many addresses have beenconfigured through flags and file-SD, while
sum(dns_provider_results)
gives us the number of endpoints actually produced from these addresses.
Verification
Ran
thanos query --store=localhost:10901
, navigated tolocalhost:10902/metrics
and found the entry: