Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mimir-distributed] Add additionalRuleLabels to PrometheusRule alerts #8153

Open
WhiteDiamondz opened this issue May 16, 2024 · 1 comment
Open
Labels
enhancement New feature or request helm help wanted Extra attention is needed

Comments

@WhiteDiamondz
Copy link

WhiteDiamondz commented May 16, 2024

Is your feature request related to a problem? Please describe.

Custom labels added to alerts are always useful and are often used for routing purposes. The mimir-distributed helm chart allows the user to deploy default PrometheusRules (alerts and recording rules). However, no option exists to add a custom label to all the alerts (and rules?) deployed.

Describe the solution you'd like

Much like it is the case for other helm charts like Loki, a posibility would be to create and configure a key like:

metaMonitoring:
  prometheusRule:
    additionalRuleLabels:
      custom_label: custom_value

Describe alternatives you've considered

Unfortunately with my knowledge I currently don't see other alternatives.

Additional context

Even if the structure is different, an example of this feature exists for the Loki helm chart: grafana/loki#9020

@narqo
Copy link
Contributor

narqo commented May 21, 2024

Some pointers to start looking at the issue:

The source of truth for the alerting rules is currently defined in mimir's jsonnet mixin. The jsonnet files are compiled into static YAML, which is injected into k8s PrometheusRule object via Helm template (ref. source code).

Note that jsonnet mixin already allows adding additional labels to the alerting rules, via $._config.alert_extra_labels (ref. source code). This is, of course, doesn't help the Helm chart's users, unfortunately.

@narqo narqo added enhancement New feature or request help wanted Extra attention is needed helm labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request helm help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants