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

fix(shards): Skip adding shard relabel rules automatically if already set #6099

Conversation

adinhodovic
Copy link
Contributor

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Currently sharding relabels are automatically added to additional scrape configs. However, users might have custom sharding relabels similar to the issue in #6063. We should skip those if we find an action with the value hashmod already there.

Fixes #6063.

Without this change the sharded tests would have duplicate hashmod functions.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

fix(shards): Skip adding shard relabel rules automatically if already set

@adinhodovic adinhodovic requested a review from a team as a code owner November 17, 2023 09:58
@@ -20,3 +20,22 @@ scrape_configs:
source_labels:
- __meta_gce_label_app
regex: my_app
- job_name: gce_app_bar_custom_shard_relabeling
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I should use a custom testdata file to not fill the non-sharding goldens?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for me

Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -20,3 +20,22 @@ scrape_configs:
source_labels:
- __meta_gce_label_app
regex: my_app
- job_name: gce_app_bar_custom_shard_relabeling
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for me

@simonpasquier simonpasquier merged commit 6b57315 into prometheus-operator:main Nov 17, 2023
17 checks passed
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.

Remove automatically appended default sharding configs to the relabel_configs
2 participants