Skip to content

Conversation

hamedsalim1999
Copy link

@hamedsalim1999 hamedsalim1999 commented Sep 14, 2025

feat(helm): add support for custom alert rule annotations

What this PR does / why we need it:
This PR introduces support for adding custom annotations to Loki Helm chart alerting rules, similar to how additionalRuleLabels already works.

  • Adds a new monitoring.rules.additionalRuleAnnotations values key.
  • These annotations are merged into the annotations: block of each built-in alert in alerts.yaml.tpl.

This enables users to enrich alerts with metadata such as runbook_url, summary, or any other contextual information without having to fork or manually patch the chart.


Which issue(s) this PR fixes:
Fixes #<19192>


Special notes for your reviewer:

  • The change mirrors the existing pattern for additionalRuleLabels.
  • Backward compatible: if additionalRuleAnnotations is not defined, behavior is unchanged.
  • Example usage in values.yaml:
monitoring:
  rules:
    additionalRuleAnnotations:
      runbook_url: "https://runbooks.example.com/oncall/loki"
      summary: "Investigate upstream errors; see runbook."

This will render in each alert’s annotations: block:

annotations:
  message: "...existing alert message..."
  runbook_url: "https://runbooks.example.com/oncall/loki"
  summary: "Investigate upstream errors; see runbook."

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added (values.yaml and chart README updated)
  • Tests updated (if applicable for chart validation)
  • Title matches the required conventional commits format

@hamedsalim1999 hamedsalim1999 requested a review from a team as a code owner September 14, 2025 13:38
@CLAassistant
Copy link

CLAassistant commented Sep 14, 2025

CLA assistant check
All committers have signed the CLA.

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.

2 participants