abahmed / kwatch

:eyes: monitor & detect crashes in your Kubernetes(K8s) cluster instantly
https://kwatch.dev
MIT License
955 stars 75 forks source link

Ignore pods by label/name pattern #240

Closed codekoala closed 6 months ago

codekoala commented 1 year ago

Is your feature request related to a problem? Please describe. I would like to ignore alerts from pods that are part of helm charts that I do not have control over. Sometimes these pods include containers with very generic names such as main or app, which make it difficult to use ignoreContainerNames for targeting these specific pods while continuing to receive alerts for other pods for our own apps with containers having those same names.

Describe the solution you'd like I think something similar to this would be useful:

ignorePodNames:
- some-pod-*

or maybe regex:

ignorePodNamePatterns:
- some-pod-.*

Perhaps something involving pod labels:

ignorePodLabels:
- label: something
  value: a value
- label: another-selector
  value: pattern-*

I feel like the name/name pattern based option would be much more straightforward, while the label-based option would be very helpful for a lot of different scenarios. I could see the label-based option getting complicated though (must a pod match all labels before being ignored? must one pod match multiple labels but we still need to add other labels to ignore separate pods?).

alikoptan commented 7 months ago

Hey @abahmed, I would like to try and work on this :)

fschlager commented 6 months ago

Sorry for cutting in line, but I really needed this in production.

abahmed commented 6 months ago

Released in v0.8.5 🎉