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

Support vertical sharding for label_join and label_replace functions #5889

Merged
merged 3 commits into from Nov 15, 2022

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Nov 11, 2022

Signed-off-by: Ben Ye benye@amazon.com

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

Even if the query contains label manipulation functions like label_join and label_replace, as long as there is no conflict between sharding labels and the dynamic destinations labels specified by the function, then we should be fine to shard.

For example, for query sum by (pod, dst_label) (label_join(metric, "dst_label", ",", "src_label")), dst_label is the dynamic label and we sum by (pod, dst_label), we could just shard by pod in this case.

Note: if we could push down the label_join and label_replace function to the store level while matching series, we could also support sharding dynamic labels. This could be a follow up if we think it makes sense.

Changes

Support vertical sharding for label_join and label_replace functions

Verification

Updated unit tests

Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
@yeya24 yeya24 force-pushed the support-sharding-label-functions branch from d9ee315 to 5c644a7 Compare November 14, 2022 19:12
Copy link
Contributor

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

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

Thanks, this optimization makes sense. I am not sure if it is worth going further than this and sharding dynamic relabels. From what I understand, It will require propagating more information to stores and could introduce quite a bit of complexity.

@yeya24
Copy link
Contributor Author

yeya24 commented Nov 15, 2022

@fpetkovski Thanks, this makes sense. For our current use case, current support for these label manipulation functions should be good enough. I will merge this then.

@yeya24 yeya24 merged commit fe45cfc into thanos-io:main Nov 15, 2022
@yeya24 yeya24 deleted the support-sharding-label-functions branch November 15, 2022 06:40
ngraham20 pushed a commit to ngraham20/thanos that referenced this pull request May 18, 2023
…hanos-io#5889)

* support vertical sharding for label_join and label_replace functions

Signed-off-by: Ben Ye <benye@amazon.com>

* update changelog

Signed-off-by: Ben Ye <benye@amazon.com>

* fix doc

Signed-off-by: Ben Ye <benye@amazon.com>

Signed-off-by: Ben Ye <benye@amazon.com>
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.

None yet

2 participants