Commit Graph

50 Commits

Author SHA1 Message Date
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
Frederic Branczyk e72e45c8f1 silence: add cache for silence matchers
compiling regex silence matchers on every query is expensive, therefore
caching them as soon as they are gossiped through the mesh
2016-09-09 11:41:39 +02:00
Frederic Branczyk 92acfbd449 add retry flag for notify providers
The retry flag allows an integration to specify whether a retry can
potentially be solved or if the error is likely not going to recover.
For example invalid authentication is likely a wrong configuration and
therefore a retry would not make sense, while a server error is likely
a temporary problem and can potentially be solved on the next retry.
2016-09-06 16:21:56 +02:00
Fabian Reinartz a4e8703567 *: integrate new silence package 2016-08-30 12:15:23 +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 d2a556b269 notify: include context in Stage interface
This adds context.Context to the return arguments of a Stage.
This is necessary to propagate modified contexts.
2016-08-18 11:42:37 +02:00
Fabian Reinartz ed4f295c70 notify: embed nflogpb.Receiver in stage
This commit directly adds the nflogpb.Receiver object to stage
objects at stage creation time. Hence, we no longer rely on a value from
within the context.
2016-08-16 16:40:42 +02:00
Fabian Reinartz 998a9ce38e notify: rename Receiver to ReceiverName
This string value is initially used to store a receiver name. It is
later overloaded with a unique string identifier of <name, integration,
index>.
This renaming is in preparation to separate the two and use the Receiver
object of the nflogpb package.
2016-08-16 16:33:17 +02:00
Frederic Branczyk 7bc851e894 rework building of stage pipelines 2016-08-16 10:56:46 +02:00
Frederic Branczyk 840dd7d2f5 introduce Stage interface 2016-08-12 16:01:40 +02:00
Frederic Branczyk 3dfb17e601 refactor notification pipeline
move hard to read backwards declared approach to more transparent
pipeline approach with more detailed interfaces
2016-08-11 15:04:03 +02:00
Fabian Reinartz 66c2171bd8 *: rename NotifyInfo to NotificationInfo 2016-08-09 12:01:31 +02:00
Fabian Reinartz c59f39557b notify,main: implement peer based notify backoff
This commit implements a wait period before actually dispatching
notifications. The backoff linearly depends on the UID order of
participating peers.
This gives the gossip state time to catch up and avoids duplicate
notifications while ensuring that every peer notifies eventually.
2016-08-09 12:00:28 +02:00
Fabian Reinartz bdcd3770ca notify: always check context before retrying
This addresses the misleading error messages reported in #212
Explanation: https://github.com/prometheus/alertmanager/issues/282#issuecomment-237784895

Fixes #282
2016-08-05 10:18:10 +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 9b4479cb6b Move send_resolved parameter to notifier configuration 2015-12-17 13:43:56 +01:00
Fabian Reinartz 4ada2398f2 Set previous inhibition/silence state 2015-12-04 10:58:56 +01:00
Fabian Reinartz 9fbc76a52f Improve PagerDuty templating 2015-11-27 14:02:34 +01:00
Fabian Reinartz 38b6ed118d Iterate over templating 2015-11-26 12:56:09 +01:00
beorn7 93ffa534a5 PR with changes after code review
Now to be reverse-reveiewed.
2015-11-23 18:24:57 +01:00
Fabian Reinartz 0d8ee0b3ec Fix golint issues in notify/ 2015-11-12 13:18:36 +01:00
Fabian Reinartz e4e594d826 Unify receiver naming 2015-11-10 13:47:04 +01:00
Fabian Reinartz 8d2bbc348b Simplify and rename notification info struct.
The delivered field was previously unused and is removed by this commit.
Only successful notifications are stored. The type was renamed to NotifyInfo.
2015-11-06 10:09:39 +01:00
Fabian Reinartz 5ce39632f8 Fix go vet warnings 2015-11-05 10:25:25 +01:00
Fabian Reinartz 6f0d441e39 Fix unlocked write and unnecessary condition 2015-11-04 17:17:37 +01:00
Fabian Reinartz c045a6285b Implement deterministic incident keys, complete PD integration 2015-10-21 13:08:53 +02:00
Fabian Reinartz 4b49350122 Fix potential grouping collisions, pass down group labels 2015-10-16 16:55:56 +02:00
Fabian Reinartz 5dc2f6e9b1 Add license headers 2015-10-11 17:24:49 +02:00
Fabian Reinartz 9c5468786d Simplify notifier constructors 2015-10-11 16:54:31 +02:00
Fabian Reinartz 6bcc8c9928 Add concurrent, named fanout notifier 2015-10-11 15:37:21 +02:00
Fabian Reinartz 41821faf92 Use multi-error for notify-fanout 2015-10-11 12:40:43 +02:00
Fabian Reinartz 6e47e75ac5 Enhance email notifier templating 2015-10-11 12:34:05 +02:00
Fabian Reinartz c84a287be6 Notify pipeline restructuring
Notifcation configs may have multiple notification destinations.
This commit changes the pipeline so that each one has its own
retry and deduplication logic.
2015-10-10 15:11:37 +02:00
Fabian Reinartz f62dc65ff4 Implement initial email notifications 2015-10-09 12:03:15 +02:00
Fabian Reinartz e209c8b4fc Outlined slack notification support 2015-10-09 10:48:25 +02:00
Fabian Reinartz 9cd90d3482 Implement retrying notifier
Retrying notifier is added to the end of the pipeline where it retries
sending out the final notifications until the context times out.
Exponential backoff is used.
2015-10-09 09:37:32 +02:00
Fabian Reinartz 9bf18ec4a5 Always assume success on reload of valid config 2015-10-09 09:05:21 +02:00
Fabian Reinartz 42e1963715 Ensure minimum notification context timeout 2015-10-09 08:58:44 +02:00
Fabian Reinartz 0a5a7691fe Encapsulate context values in package.
Setting and getting of context values are done via helper
methods in the notifier package. The used keys are unexported. Thus,
we ensure that external code cannot overwrite the values and the type
is always correct.
2015-10-09 08:43:39 +02:00
Fabian Reinartz 638b3f9f40 Use a fixed now time through notify pipeline 2015-10-09 08:26:41 +02:00
Fabian Reinartz d1379a3f71 Move repeat_interval and send_resolved to route configuration 2015-10-08 10:50:37 +02:00
Fabian Reinartz 77cce75c05 Simplify notify provider interface 2015-10-06 20:40:52 +02:00
Fabian Reinartz 0e742ecf33 Handle resolved new alerts properly 2015-10-02 15:58:37 +02:00
Fabian Reinartz 03272174f2 Pass aggregation group identifier through context 2015-10-01 15:18:19 +02:00
Fabian Reinartz 3e145caef9 Implement unifying of batches on repeated sends 2015-09-30 19:03:04 +02:00
Fabian Reinartz f5cfe0b4e8 Add an exit point in case all alerts are filtered 2015-09-30 18:44:33 +02:00
Fabian Reinartz a377004d90 Wrap all notifiers with logging 2015-09-30 14:54:13 +02:00
Fabian Reinartz c3b36790eb Move notifiers into their own package 2015-09-29 15:36:36 +02:00
Fabian Reinartz 8799d647b3 Use proper build function to create new notifiers 2015-09-29 15:02:30 +02:00
Fabian Reinartz b5cee8828a Add webhook notifier mechanism 2015-09-29 14:45:38 +02:00