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

Call correct method on index store #5979

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Apr 21, 2022

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 and
c.IndexStore.LabelValuesForMetricName return ([]string, error).

Signed-off-by: Christian Haudum [email protected]

Which issue(s) this PR fixes:

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated
  • Is this an important fix or new feature? Add an entry in the CHANGELOG.md.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

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]>
@chaudum chaudum requested a review from a team as a code owner April 21, 2022 06:22
Copy link
Contributor

@kavirajk kavirajk left a 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...)
Copy link
Contributor

Choose a reason for hiding this comment

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

is it tested?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@simonswine simonswine left a 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 👍

@kavirajk kavirajk merged commit db23887 into main Apr 21, 2022
@kavirajk kavirajk deleted the chaudum/index-gateway-label-value-for-metric-name branch April 21, 2022 07:23
chaudum added a commit that referenced this pull request Apr 21, 2022
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]>
chaudum added a commit that referenced this pull request Apr 21, 2022
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants