thanos icon indicating copy to clipboard operation
thanos copied to clipboard

Remove hardcoded labels in store shard matcher and inject unshardable label in query analyzer

Open haanhvu opened this issue 3 years ago • 5 comments
trafficstars

Signed-off-by: haanhvu [email protected]

fixes #5625

  • [ ] I added CHANGELOG entry for this change.
  • [ ] Change is not relevant to the end user.

Changes

Remove hardcoded __name__ label in store shard matcher to make it shardable. Inject unshardable le label in query analyzer.

Verification

haanhvu avatar Aug 24 '22 21:08 haanhvu

Convert to draft to fix errors and warnings

haanhvu avatar Aug 24 '22 23:08 haanhvu

Thanks for the contribution. We should also add tests for this change.

@fpetkovski actually I didn't add the test because I see we already have one test case with le label? https://github.com/thanos-io/thanos/blob/544d67a8f3f0c8187afa974cad71972aeb10d297/pkg/querysharding/analyzer_test.go#L125-L126

haanhvu avatar Aug 29 '22 09:08 haanhvu

@fpetkovski I fixed all the suggestions. Pls review.

Thanks for the contribution. We should also add tests for this change.

@fpetkovski actually I didn't add the test because I see we already have one test case with le label?

https://github.com/thanos-io/thanos/blob/544d67a8f3f0c8187afa974cad71972aeb10d297/pkg/querysharding/analyzer_test.go#L125-L126

We already have a shardableByLabels test case. So I just add a shardableWithoutLabels test case.

Also, could you review https://github.com/thanos-io/thanos/pull/5653 too?

haanhvu avatar Aug 29 '22 12:08 haanhvu

Thanks, I can take a look at this tomorrow.

fpetkovski avatar Aug 29 '22 14:08 fpetkovski

@fpetkovski done converting to local variables

haanhvu avatar Sep 11 '22 16:09 haanhvu