robusta-dev / robusta

Kubernetes observability and automation, with an awesome Prometheus integration
https://home.robusta.dev/
MIT License
2.5k stars 247 forks source link

Added support for webhook_url dynamic overriding using annotations (issue 1083) #1476

Open itisallgood opened 1 week ago

itisallgood commented 1 week ago

Introduced the webhook_override attribute for ms_teams_sink, enabling the use of annotations from YAML files to dynamically override the webhook_url.

Issue #1083.

sinksConfig:
- ms_teams_sink:
    name: main_ms_teams_sink
    webhook_url: teams-incoming-webhook 
    webhook_override: "annotations.msteams"

If no such annotation exists, the default webhook will be used. If the annotation is found but its value does not contain a valid URL, the system will search for an environmental variable with the name of the value in the additional_env_vars section of your generated_values.yaml file.

Reason for using annotations instead of labels:

Annotations are used instead of labels because URLs can't be passed to labels (see comment for MsTeamsWebhookUrlTransformer in src/robusta/core/sinks/msteams/msteams_webhook_tranformer.py )

CLAassistant commented 1 week ago

CLA assistant check
All committers have signed the CLA.