Skip to content

[kube-prometheus-stack] Make namespace selector operator configurable - #5742

Merged
jkroepke merged 4 commits into
prometheus-community:mainfrom
rgarcia89:main
Jun 5, 2025
Merged

[kube-prometheus-stack] Make namespace selector operator configurable#5742
jkroepke merged 4 commits into
prometheus-community:mainfrom
rgarcia89:main

Conversation

@rgarcia89

@rgarcia89 rgarcia89 commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

This change adds the ability to configure the namespace selector operator
in Prometheus rules. Users can now choose between including namespaces with
the =~ operator (default) or excluding namespaces with the !~ operator.

The new configuration option "appNamespacesOperator" in values.yaml allows
users to specify which operator to use with the existing "appNamespacesTarget"
pattern, making it possible to exclude specific namespaces from monitoring
rules instead of only being able to include them.

This is particularly useful for large clusters where you want to monitor
everything except a few specific namespaces.

Signed-off-by: Raul Garcia Sanchez raul.garcia@meinauto.de

What this PR does / why we need it

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes #

Special notes for your reviewer

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

This change adds the ability to configure the namespace selector operator
in Prometheus rules. Users can now choose between including namespaces with
the "=~" operator (default) or excluding namespaces with the "!~" operator.

The new configuration option "appNamespacesOperator" in values.yaml allows
users to specify which operator to use with the existing "appNamespacesTarget"
pattern, making it possible to exclude specific namespaces from monitoring
rules instead of only being able to include them.

This is particularly useful for large clusters where you want to monitor
everything except a few specific namespaces.

Signed-off-by: Raul Garcia Sanchez <raul.garcia@meinauto.de>
Signed-off-by: Raul Garcia Sanchez <raul.garcia@meinauto.de>
@rgarcia89

Copy link
Copy Markdown
Contributor Author

nevermind - I just saw the comment on the first line of the rules 😄

@rgarcia89 rgarcia89 closed this Jun 5, 2025
@jkroepke

jkroepke commented Jun 5, 2025

Copy link
Copy Markdown
Member

@rgarcia89 such "special" changes are still possible, if you integrate them here:

@rgarcia89

Copy link
Copy Markdown
Contributor Author

Understood. Let me have a look

@rgarcia89 rgarcia89 reopened this Jun 5, 2025
Raul Garcia Sanchez added 2 commits June 5, 2025 15:54
Signed-off-by: Raul Garcia Sanchez <raul.garcia@meinauto.de>
Signed-off-by: Raul Garcia Sanchez <raul.garcia@meinauto.de>
@rgarcia89

Copy link
Copy Markdown
Contributor Author

@jkroepke do you have a clue why the test is failing?

@jkroepke jkroepke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@jkroepke
jkroepke merged commit 71902f7 into prometheus-community:main Jun 5, 2025
@jkroepke

jkroepke commented Jun 5, 2025

Copy link
Copy Markdown
Member

@jkroepke do you have a clue why the test is failing?

Bad luck

@unique-dominik

Copy link
Copy Markdown

Just to give Kudos. I tried to do that like 4 weeks ago via using a negative look ahead which of course did not work. Thank you so much ❤️ ❤️ ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants