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

TSDB/query-planning-groundwork #6367

Merged
merged 7 commits into from
Jun 10, 2022
Merged

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Jun 10, 2022

This PR does a few things that will prepare us for better query planning using the new /loki/api/v1/index/stats API:

  • Adds a MatcherGroups()[][]*labels.Matcher method to the SampleExpr interface so we can resolve the underlying sets of stream matchers for metric queries. This will allow us to shard different legs of binary operations independently based on how much data each leg operates on.
  • Adds a ShardResolver interface with default implementation. This is how we'll thread through index sampling into the ast mapper.
type ShardResolver interface {
	Shards(expr syntax.Expr) (int, error)
}
  • Codec support for the IndexStats{Request,Response} so we can use them within the frontend middleware chains.

ref #5428

@owen-d owen-d marked this pull request as ready for review June 10, 2022 19:59
@owen-d owen-d requested a review from a team as a code owner June 10, 2022 19:59
Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

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

very cool

@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
- querier/queryrange	-1.2%
+               iter	0%
+            storage	0%
+           chunkenc	0%
-              logql	-0.2%
+               loki	0%

@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0.3%
+            querier	0%
- querier/queryrange	-1.2%
+               iter	0%
+            storage	0%
+           chunkenc	0%
-              logql	-0.2%
+               loki	0%

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