-
Notifications
You must be signed in to change notification settings - Fork 806
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
Alert history log support #5602
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Emmanuel Lodovice <[email protected]>
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 <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
Signed-off-by: Emmanuel Lodovice <[email protected]>
"github.com/prometheus/alertmanager/api" | ||
"github.com/prometheus/alertmanager/cluster" | ||
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is this belong to this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed to support the latest changes in AM. This change prometheus/alertmanager#3045 adds a featurecontrol parameter to NewPipelineBuilder
.
LGTM |
What this PR does:
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]