Commit Graph

21 Commits

Author SHA1 Message Date
pasquier-s 76ee5388e7 Forbid 0 value for group_interval and repeat_interval (#1230)
Setting one of these parameters to a zero value doesn't make sense
semantically and can cause high CPU usage.
2018-02-09 10:53:46 +01:00
pasquier-s 62b957cc14 Notify only when new firing alerts are added (#1205)
After the initial notification has been sent, AlertManager shouldn't notify the
receiver again when no new alerts have been added to the group during
group_interval.

This change also modifies the acceptance test framework to assert that no
notification has been received in a given interval.
2018-01-23 16:52:03 +01:00
pasquier-s 907ac510f8 Fix flaky TestBatching acceptance test (#1193)
This change decreases the repeat_interval parameter from 5s to 4.9s to
make sure that the alerts are effectively sent after 5 seconds.

The workflow is:
- The dispatcher flushes the alerts at t0, sends the notification and
marks the notification log at t0+epsilon.
- The dispatcher flushes the alerts at t1, t2, t3 and t4 and doesn't
send the notifications as expected.
- At t5, the dispatcher flushes the alerts because current_time - (t0+epsilon)
is less then repeat_interval.

If repeat_interval is exactly 5s, there is a little chance that it is
greater than current_time - (t0+epsilon).
2018-01-11 22:45:59 +01:00
Julius Volz b0aab04906 Fix notifications for flapping alerts (#1071)
Fixes https://github.com/prometheus/alertmanager/issues/1063
2017-11-02 11:12:12 +01:00
Julius Volz 9b72c10134 Minor code cleanups 2017-11-01 23:08:34 +01:00
Fabian Reinartz ff5ecfff51 test: add reload test
This test reloads the Alertmanager to verify, that it properly keeps
state and sends notifications correctly across reloads.
2017-04-18 12:44:38 +02:00
Fabian Reinartz 309c6af4b2
nflog: use alert set instead of hash for deduplication
Building a hash over an entire set of alerts causes problems, because
the hash differs, on any change, whereas we only want to send
notifications if the alert and it's state have changed. Therefore this
introduces a list of alerts that are active and a list of alerts that
are resolved. If the currently active alerts of a group are a subset of
the ones that have been notified about before then they are
deduplicated. The resolved notifications work the same way, with a
separate list of resolved notifications that have already been sent.
2017-04-13 15:13:47 +02:00
Frederic Branczyk c392ace697
notify: replace unfiltered with filtered alerts 2017-01-04 13:50:40 +01:00
Frederic Branczyk dcf2b3afcb
notify: move resolved alert filtering to integration
Resolved alerts, even when filtered, have to end up in the
SetNotifiesStage, otherwise when an alert fires again it is ambiguous
whether it was resolved in between or not.

fixes #523
2016-10-05 17:45:35 +02:00
Fabian Reinartz 72fdf3d3ab *: integrate nflog
This commit replaces the previous NotifyInfo provider with the new
nflog package. It needs adjustments in the behavior of the deduping
stage.
The nflog stores notification digests per receiver per alert aggregation
group rather than one entry for alert per receiver. This drastically
reduces the number of entries and removes interference
across aggregation groups.
2016-08-18 15:52:28 +02:00
Fabian Reinartz e51770ce21 main: use mesh providers 2016-08-09 12:00:28 +02:00
Fabian Reinartz d6e64dccc5 provider/boltmem: make alerts purely in-memory.
Initial testing has shown BoltDB in plain usage to be a bottleneck
at a few thousand alerts or more (especially JSON decoding.
This commit actually makes them purely memory as a temporary solution.
2016-07-07 09:45:12 +02:00
Fabian Reinartz 11fae2a719 Simplify and fix notification grouping.
This commit changes the notification grouping behavior
to simply send all alerts of a group as soon as a single
one of them needs updating.

This fixes a critical bug which caused erroneous resolved
notifications to be sent.
2016-01-08 15:17:54 +01:00
Fabian Reinartz d21d29ee58 Correctly parse send_resolved config field
Fixes #198
2015-12-23 08:31:50 +01:00
Fabian Reinartz cec04341f7 Add resolved test 2015-11-30 11:20:28 +01:00
Fabian Reinartz dc656a44ea Adjust config fields to 'receiver' 2015-11-10 14:08:20 +01:00
Fabian Reinartz ba4c3d31b5 Extend merging test to cover more scenarios 2015-10-20 11:59:40 +02:00
Fabian Reinartz 6cbd7f5511 Inherit grouping labels, default grouping labels 2015-10-19 17:35:59 +02:00
Fabian Reinartz cb0ecd9416 Alter config to have a root route 2015-10-19 16:52:54 +02:00
Fabian Reinartz ff7eddc453 Add acceptance test for alert merging 2015-10-15 12:46:51 +02:00
Fabian Reinartz 0073647981 Restructure acceptance test files 2015-10-12 07:35:22 +02:00