From 694e6a58fea0e9bb411223edf0e1c51bab4b157c Mon Sep 17 00:00:00 2001 From: Haley Wang Date: Wed, 13 Nov 2024 14:45:23 +0800 Subject: [PATCH] remove unused comments --- app/vmalert/rule/alerting.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/vmalert/rule/alerting.go b/app/vmalert/rule/alerting.go index 338a4e8d7..1c0e4b284 100644 --- a/app/vmalert/rule/alerting.go +++ b/app/vmalert/rule/alerting.go @@ -457,15 +457,13 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr } var numActivePending int var tss []prompbmarshal.TimeSeries - // store alerts' labels which are `FIRING => INACTIVE`, `PENDING => INACTIVE` or `PENDING => FIRING` in this iteration, - // need to create stale time series for them later. for h, a := range ar.alerts { // if alert wasn't updated in this iteration // means it is resolved already if _, ok := updated[h]; !ok { if a.State == notifier.StatePending { // alert was in Pending state - it is not active anymore - // add stale time series for it + // add stale time series tss = append(tss, pendingAlertStaleTimeSeries(a.Labels, ts.Unix(), true)...) delete(ar.alerts, h) @@ -485,7 +483,7 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr if ts.Sub(a.KeepFiringSince) >= ar.KeepFiringFor { a.State = notifier.StateInactive a.ResolvedAt = ts - // add stale time series for it + // add stale time series tss = append(tss, firingAlertStaleTimeSeries(a.Labels, ts.Unix())...) ar.logDebugf(ts, a, "FIRING => INACTIVE: is absent in current evaluation round") @@ -500,7 +498,7 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr a.Start = ts alertsFired.Inc() if ar.For > 0 { - // add stale time series for it + // add stale time series tss = append(tss, pendingAlertStaleTimeSeries(a.Labels, ts.Unix(), false)...) } ar.logDebugf(ts, a, "PENDING => FIRING: %s since becoming active at %v", ts.Sub(a.ActiveAt), a.ActiveAt)