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

[Observability] [Alerts] Recovered alert notifications can have wrongly mapped group values #213547

Open
benakansara opened this issue Mar 7, 2025 · 1 comment
Labels
bug Fixes for quality problems that affect the customer experience Team:obs-ux-management Observability Management User Experience Team

Comments

@benakansara
Copy link
Contributor

When group by fields of the rule are modified, the recovered alert notifications that use context.group or context.groupByKeys can have wrongly mapped group values.

Example scenario

  1. Custom threshold rule is created with group by on host.name and container.id and alert action message uses context.group or context.groupByKeys depending on the rule
  2. Alert notification for "active" alert contains correct group values as:
  • in case of context.group: "group":[{"field":"host.name","value":"host-0"},{"field":"container.id","value":"container-0"}]
  • in case of context.groupByKeys: {"host":{"name":"host-0"},"container":{"id":"container-0"}}
  1. Rule is modified to have group by on container.name and host.name
  2. Existing alerts are recovered due to change in group by fields
  3. Recovered alert notification has wrongly mapped group values as:
  • in case of context.group: "group":[{"field":"container.name","value":"host-0"},{"field":"host.name","value":"container-0"}]
  • in case of context.groupByKeys: {"container":{"name":"host-0"},"host":{"name":"container-0"}}

This is due to relying on rule parameters to generate group context for recovered alerts as at this point rule parameters have changed which don't match with recovered alert Id anymore. Instead we should use alert document to extract rule parameters with either kibana.alert.rule.parameters.groupBy or kibana.alert.group.field.

Rules where this issue can happen

  • Custom threshold rule
  • Metric threshold rule
  • Log threshold rule
@benakansara benakansara added bug Fixes for quality problems that affect the customer experience Team:obs-ux-management Observability Management User Experience Team labels Mar 7, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:obs-ux-management Observability Management User Experience Team
Projects
None yet
Development

No branches or pull requests

2 participants