Query/Ruler: Add metric for number of endpoints resolved for each configured address.#1260
Merged
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.
bwplotka
reviewed
Jun 18, 2019
| 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. |
Member
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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.
bwplotka
reviewed
Jun 18, 2019
Member
bwplotka
left a comment
There was a problem hiding this comment.
LGTM, except one thing, commented below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Add
thanos_querier_store_apis_dns_provider_results/thanos_ruler_query_apis_dns_provider_resultsmetrics.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/metricsand found the entry: