Skip to content

Grouped alert resolve renders empty group values when the group vanishes from the data #3470

Closed

Description

@andrewdunndev

What are you trying to do?

Get a grouped alert's resolve notification to name the group that fired, even when that group has no rows left.

I run a per-host alert: one alert grouped by host, firing when a host's error count climbs. When a host stops reporting altogether, its group has no rows in the resolve window, and the resolve renders {{attributes.host}} and {{var.host}} empty. The firing title and message named the host; the resolve says a host resolved, with the name blank. {{groupKey}} is still set on the resolve, but only as the joined string, so getting the host out as its own field means parsing it.

This is a documented limitation. #3384 (merged) notes that a group that drops out of the data still resolves with empty values because parsing values back out of groupKey isn't safe, the {{var}} row in docs/alert-webhook-template-variables.md carries the same caveat, and the checker marks the spot at packages/api/src/tasks/checkAlerts/index.ts:1290.

What would you like to see?

Store the group's values on its alert history row when the group is evaluated, and use them when the group resolves with no rows left.

  • When a group evaluates with values, write them to its history row alongside group.
  • At resolve, if the group has no current rows, fall back to the values on the previous history row.
  • History rows written before the change hold no values, so a group whose latest row predates the change and then vanishes resolves blank once more. A group that is evaluated at least once after the change carries its values.
  • No schema migration: one optional field on the history document.

Alternatives you've considered

Anything else?

A PR is ready with the change and an integration test: a raw SQL tile alert grouped by service fires for one service, that service's rows disappear, and the resolve notification names the service. The {{var}} docs row drops its "no rows left" caveat. I'll open it once this is scoped.

Activity

  1. added a commit that references this issue on Nov 3, 2026
    0453aa1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions