Commit Graph

69 Commits

Author SHA1 Message Date
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
stuart nelson
24a9a64bdf Only find MAC address if no command-line flag value given (#638)
* Find MAC address if mesh.hardware-addr not given

Defaulting to the machine's MAC address fails
sometimes fails and causes a panic. Allow the user
to specify custom address to skip this so they can
run AlertManager.

* -mesh.hardware-address -> -mesh.peer-id

* Fix command-line invocation
2017-02-28 14:57:45 +01:00
Martín Ferrari
5489644cbe Wait for test server to be ready before running tests (#605)
* Wait for test server to be ready before running tests

This fixes problems when running the acceptance tests in slow or CPU-starved
machines, as mentioned in #472.
2017-01-16 12:32:27 +00: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
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
e51770ce21 main: use mesh providers 2016-08-09 12:00:28 +02:00
Fabian Reinartz
81cbf3cda7 *: refactor Silence type, use UUID
This commit removes the dependency on model.Silence for the internal
Silence type, uses UUIDs instead of uint64s and clarifies invariants
around timestamp handling.

The created_at timestamp is removed for the time being.
2016-08-09 11:59:35 +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
Matt Bostock
68a1e51ffb Use localhost for tests
Previously, the tests would listen on all available interfaces.

Instead, have the tests use localhost only; using all available
interfaces is unnecessary.

On Mac OS X with the builtin firewall enabled, it triggers annoying
prompts to allow the tests to listen on all interfaces.
2016-06-04 08:19:23 +01:00
Fabian Reinartz
04f60c5a50 Deal with changed webhook format in tests 2016-02-12 11:00:51 +01: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
a2b8d35733 Validate API input 2015-12-09 18:21:06 +01:00
Fabian Reinartz
2e5b9e5194 Improve acceptance test logging 2015-12-08 11:55:29 +01:00
Fabian Reinartz
cec04341f7 Add resolved test 2015-11-30 11:20:28 +01:00
beorn7
93ffa534a5 PR with changes after code review
Now to be reverse-reveiewed.
2015-11-23 18:24:57 +01:00
Brian Brazil
faa88831f4 First-pass at improving template system.
- Cut back to bare minimum to make the rest simpler
- Consistency in config naming
- Have one data strucutre that's the same for all templates
- Pass in common labels to templates
- Support templates almost everywhere
- Support multiple SMTP recipients
- Support non-ASCII SMTP headers
- Handle colour logic via templates
- Make $subjects have consistent output, go maps aren't sorted.
- Make tests pass when v6 is disabled
2015-11-18 14:59:05 +00:00
Fabian Reinartz
d80fd26902 Add Dockerfile and target, change flag 2015-11-12 15:03:09 +01:00
Fabian Reinartz
dc656a44ea Adjust config fields to 'receiver' 2015-11-10 14:08:20 +01:00
Fabian Reinartz
e4e594d826 Unify receiver naming 2015-11-10 13:47:04 +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
fa7955c9bc Show logs of crashed testing instances 2015-10-15 16:17:04 +02:00
Fabian Reinartz
8148e82358 Terminate tests on Alertmanager crash 2015-10-15 16:15:37 +02:00
Fabian Reinartz
ff7eddc453 Add acceptance test for alert merging 2015-10-15 12:46:51 +02:00
Fabian Reinartz
2d3f0ecd84 Add test for silence deletion 2015-10-12 07:40:55 +02:00
Fabian Reinartz
0073647981 Restructure acceptance test files 2015-10-12 07:35:22 +02:00
Fabian Reinartz
16e693dd4f Add simple test for retry logic 2015-10-12 07:28:43 +02:00
Fabian Reinartz
aca2089216 Add injection function to webhook 2015-10-12 07:28:25 +02:00
Fabian Reinartz
5dc2f6e9b1 Add license headers 2015-10-11 17:24:49 +02:00
Fabian Reinartz
d1379a3f71 Move repeat_interval and send_resolved to route configuration 2015-10-08 10:50:37 +02:00
Fabian Reinartz
f48c95eb19 Test restartability with persistence 2015-10-07 16:19:37 +02:00
Fabian Reinartz
a653f90516 Setup persistence dir for acceptance tests 2015-10-06 12:41:20 +02:00
Fabian Reinartz
f14ada020a Fix alert batch comparison, improve debug output 2015-10-05 16:51:34 +02:00
Fabian Reinartz
5222e340b8 Move inhibition test into own file 2015-10-05 16:08:00 +02:00
Julius Volz
05f9972bb5 Remove some debug statements. 2015-10-05 16:03:57 +02:00
Julius Volz
247cf8e3cd Add first inhibition acceptance test. 2015-10-05 16:03:57 +02:00
Julius Volz
0c96c80cd6 Fix spelling of exepected->expected. 2015-10-05 16:03:56 +02:00
Fabian Reinartz
aab576c7c0 Add method to update Alertmanager configuration file 2015-10-02 14:14:30 +02:00
Fabian Reinartz
5ba2d4abc1 Assign webhook addresses automatically, per AM configs 2015-10-02 14:10:04 +02:00
Fabian Reinartz
1ff41b3864 Use alertmanager client package for alert pushing 2015-10-02 12:45:52 +02:00
Fabian Reinartz
83a0d68fc8 Add acceptance test documentation 2015-10-02 12:32:19 +02:00
Fabian Reinartz
f29a380ec4 Export Alertmanager process control functionality 2015-10-02 12:28:27 +02:00
Fabian Reinartz
5c4ec44962 Centralize test actions in AcceptanceTest 2015-10-02 12:18:02 +02:00
Fabian Reinartz
b0989ca9f3 Let test silence timeout by itself 2015-10-01 22:22:51 +02:00
Fabian Reinartz
152f811227 Fix acceptance test 2015-10-01 22:15:27 +02:00