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

query,store: Improve replica flag handling #7855

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

SuperQ
Copy link
Contributor

@SuperQ SuperQ commented Oct 23, 2024

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

Changes

Add a string utility parsing function to improve the handling of replica label flags. This allows for easier handling of flags when multiple replica labels are need.

  • Split flag parts that are comma separated.
  • Remove any empty strings.
  • Sort and deduplicate the slice.

For example in the case of multiple replica labels like: --query.replica-label=prometheus_replica,thanos_rule_replica

Verification

Add a string utility parsing function to improve the handling of replica
label flags. This allows for easier handling of flags when multiple
replica labels are need.
* Split flag parts that are comma separated.
* Remove any empty strings.
* Sort and deduplicate the slice.

For example in the case of multiple replica labels like:
`--query.replica-label=prometheus_replica,thanos_rule_replica`

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ SuperQ force-pushed the superq/flag_labels branch from 34717b9 to 050f014 Compare October 23, 2024 13:33
@SuperQ SuperQ changed the title Improve replica flag handling query,store: Improve replica flag handling Oct 23, 2024
@SuperQ
Copy link
Contributor Author

SuperQ commented Oct 23, 2024

👓 @wallee94

Copy link
Member

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

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

Thanks!
I feel like doing repeated flags makes it more readable, but I also see cases where grouping labels in the same flag might be easier

@SuperQ
Copy link
Contributor Author

SuperQ commented Oct 29, 2024

Yes, I also prefer repeatable flags. But when using Kustomize templates we're a bit stuck with having to use a single flag with variable substitution.

@saswatamcode saswatamcode enabled auto-merge (squash) October 29, 2024 07:53
@saswatamcode saswatamcode merged commit 5749c8c into thanos-io:main Oct 29, 2024
22 checks passed
@SuperQ SuperQ deleted the superq/flag_labels branch October 29, 2024 09:40
pedro-stanaka pushed a commit to pedro-stanaka/thanos that referenced this pull request Oct 31, 2024
Add a string utility parsing function to improve the handling of replica
label flags. This allows for easier handling of flags when multiple
replica labels are need.
* Split flag parts that are comma separated.
* Remove any empty strings.
* Sort and deduplicate the slice.

For example in the case of multiple replica labels like:
`--query.replica-label=prometheus_replica,thanos_rule_replica`

Signed-off-by: SuperQ <superq@gmail.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.

2 participants