robusta icon indicating copy to clipboard operation
robusta copied to clipboard

Ability to filter alerts based on namespace's labels in sinksConfig

Open luigiaparicio opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? The actual situation is this:

This is my config right now, filtering by namespace name: - ms_teams_sink: name: paas-alerts-stg-ohe-empresas webhook_url: https://blablabla.bla/foo default: false match: namespace: "(.*secmdw$|.*pe-api-users$|.*pe-api-bff$|.*sm-bff-web$|.*sm-bff-mobile$)"

This works, but in the future I must add each new namespace to the list

Describe the solution you'd like I would like to filter alerts matching the labels attached to namespaces.

For example: - ms_teams_sink: name: paas-alerts-stg-ohe-empresas webhook_url: https://blablabla.bla/foo default: false match: namespace_label: "team=devops"

Also using regex here anyone could AND/OR labels, or whatever the case would be.

Describe alternatives you've considered Also it would be nice to filter by others objects labels, ie: alert labels

Additional context What I'm trying to accomplish is to simplify the playbook and sinks configuration though I can send notifications to the teams that really matters, and using labels in kubernetes (is like tagging in the cloud) I can then match the alerts in a simpler way.

luigiaparicio avatar Feb 24 '23 17:02 luigiaparicio

we are also interested in this feature.

with label we had a generic way for routing alerts

1337andre avatar Mar 05 '24 17:03 1337andre

Hi @luigiaparicio and @1337andre, Is this for Prometheus alerts, for APIServer notifications (e.g. OOMKills), or both?

The main challenge here is how to handle cases when the namespace no longer exists, but I assume that's not very common in either of your cases.

aantn avatar Mar 06 '24 07:03 aantn

update: this is not fixed yet

arikalon1 avatar Apr 05 '24 20:04 arikalon1

Yes, we are also interested in this feature

sumeet-zuora avatar Apr 10 '24 15:04 sumeet-zuora