Alert history log support#5602
Conversation
Signed-off-by: Emmanuel Lodovice <lodovice@amazon.com>
a13ac1c to
b989eb5
Compare
|
IIUC, this requires some prs to upstream alertmanager first? |
|
yes, this PR needs this PR in upstream alertmanager prometheus/alertmanager#3461 so I am keeping it as draft so I can get some preliminary review |
b989eb5 to
52d0fa1
Compare
Signed-off-by: Emmanuel Lodovice <lodovice@amazon.com>
52d0fa1 to
b00cc53
Compare
pkg/alertmanager/alert_observer.go
Outdated
|
|
||
| func (o *LogAlertLifeCycleObserver) PipelineStart(alerts []*types.Alert, meta alertobserver.AlertEventMeta) { | ||
| logLvl := o.limiter.Level() | ||
| if logLvl < 2 { |
There was a problem hiding this comment.
nit: should we create a function as shouldLog? so that we can put all level control logic in there
pkg/alertmanager/alert_observer.go
Outdated
| reason = "Unknown" | ||
| } | ||
| for _, a := range alerts { | ||
| o.logWithAlert(a, true, "msg", "Rejected", "reason", reason) |
There was a problem hiding this comment.
do we need reject per log? maybe log rejected alerts in the same line better for less log volume?
pkg/alertmanager/alert_observer.go
Outdated
| return | ||
| } | ||
| for _, a := range alerts { | ||
| o.logWithAlert(a, true, "msg", "Added to aggregation group", "groupKey", groupKey) |
Signed-off-by: Emmanuel Lodovice <lodovice@amazon.com>
| "github.com/prometheus/alertmanager/cluster/clusterpb" | ||
| "github.com/prometheus/alertmanager/config" | ||
| "github.com/prometheus/alertmanager/dispatch" | ||
| "github.com/prometheus/alertmanager/featurecontrol" |
There was a problem hiding this comment.
nit: is this belong to this change?
There was a problem hiding this comment.
This is needed to support the latest changes in AM. This change prometheus/alertmanager#3045 adds a featurecontrol parameter to NewPipelineBuilder.
|
LGTM |
|
This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions. |
What this PR does:
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]