-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Call correct method on index store #5979
Call correct method on index store #5979
Conversation
when index gateway does not implement the new API. This bug did not yield an error but only returned incorrect results because both functions `c.IndexStore.LabelNamesForMetricName` and `c.IndexStore.LabelValuesForMetricName` return `([]string, error)`. Signed-off-by: Christian Haudum <[email protected]>
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
@@ -88,7 +88,7 @@ func (c *IndexGatewayClientStore) LabelValuesForMetricName(ctx context.Context, | |||
}) | |||
if isUnimplementedCallError(err) { | |||
// Handle communication with older index gateways gracefully, by falling back to the index store calls. | |||
return c.IndexStore.LabelNamesForMetricName(ctx, userID, from, through, metricName) | |||
return c.IndexStore.LabelValuesForMetricName(ctx, userID, from, through, metricName, labelName, matchers...) |
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.
is it tested?
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.
No it is not currently, but I have #5968 prepared, that covers this aspect.
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'll try to find a way to test this without a huge amount of boilerplate code.
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 for catching this 👍
when index gateway does not implement the new API. This bug did not yield an error but only returned incorrect results because both functions `c.IndexStore.LabelNamesForMetricName` and `c.IndexStore.LabelValuesForMetricName` return `([]string, error)`. Signed-off-by: Christian Haudum <[email protected]>
when index gateway does not implement the new API. This bug did not yield an error but only returned incorrect results because both functions `c.IndexStore.LabelNamesForMetricName` and `c.IndexStore.LabelValuesForMetricName` return `([]string, error)`. Signed-off-by: Christian Haudum <[email protected]>
What this PR does / why we need it:
when index gateway does not implement the new API.
This bug did not yield an error but only returned incorrect results
because both functions
c.IndexStore.LabelNamesForMetricName
andc.IndexStore.LabelValuesForMetricName
return([]string, error)
.Signed-off-by: Christian Haudum [email protected]
Which issue(s) this PR fixes:
Special notes for your reviewer:
Checklist
CHANGELOG.md
.docs/sources/upgrading/_index.md