Skip to content

Commit

Permalink
Delete group markers when the aggregation group is deleted
Browse files Browse the repository at this point in the history
Signed-off-by: George Robinson <[email protected]>
  • Loading branch information
grobinson-grafana committed Apr 3, 2024
1 parent 44bba05 commit eda57d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dispatch/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type Dispatcher struct {
route *Route
alerts provider.Alerts
stage notify.Stage
marker types.GroupMarker
metrics *DispatcherMetrics
limits Limits

Expand Down Expand Up @@ -107,7 +108,7 @@ func NewDispatcher(
ap provider.Alerts,
r *Route,
s notify.Stage,
mk types.AlertMarker,
mk types.GroupMarker,
to func(time.Duration) time.Duration,
lim Limits,
l log.Logger,
Expand All @@ -121,6 +122,7 @@ func NewDispatcher(
alerts: ap,
stage: s,
route: r,
marker: mk,
timeout: to,
logger: log.With(l, "component", "dispatcher"),
metrics: m,
Expand Down Expand Up @@ -182,6 +184,7 @@ func (d *Dispatcher) run(it provider.AlertIterator) {
for _, ag := range groups {
if ag.empty() {
ag.stop()
d.marker.DeleteByGroupKey(ag.GroupKey())
delete(groups, ag.fingerprint())
d.aggrGroupsNum--
d.metrics.aggrGroups.Dec()
Expand Down

0 comments on commit eda57d2

Please sign in to comment.