Commit Graph

126 Commits

Author SHA1 Message Date
Conor Broderick
10b9d34f80 Initialise notifications_total and notifications_failed_total (#1011) 2017-10-07 11:57:53 +02:00
Alin Sinpalean
4931c9206e Fix multipart email implementation: (#1009)
* Don't send parts with empty templates.
 * Add a MIME-Version: 1.0 header.
 * Place text/html part last, as parts are supposed to be in increasing preference order.
2017-09-29 11:22:38 +02:00
conorbroderick
5597a76ad4 Added confirmation dialog when expiring silences 2017-09-14 16:41:55 +01:00
Pierre Awaragi
f3cd3978db added email notification text content support (#934)
* added email notification text content support (configuration text)
added default email notification text content default value empty
converted email notification from html to multipart/alternatives with support to both html (first) and text (last)
ignore intellij IDE .idea working folder

* removed specific editor .gitignore entries

* renamed TEXT to Text as it's not an acronym
added TODO note to refactor multipart code to use standard go library

* refactored to use standard go mime/multipart library for text and html parts and bounderies

* use multipart createPart returned writer
added error handling while creating parts
removed unnecessary quotes from boundry string

* removed unnecessary comments
2017-09-07 17:24:19 +02:00
9to6
e1b2bfe497 When I notify alert to slack, I want to use this option. (#912)
* add link_names attribute to slack notifier

* changed type of slack option `link_names` to boolean
2017-07-25 09:21:33 +02:00
ideaship
a566036015 Support for custom SMTP hello string (#892)
* Support for custom SMTP hello string

Some MTAs insist that they be greeted with a fully qualified domain
name. The default provided by the net/smtp library, "HELLO localhost",
is not sufficient and will result in rejected messages.

This changeset adds a new configuration option that allows the
alertmanager to do its job in such an environment.

* Test SMTPHello parsing
2017-07-18 09:32:57 +02:00
Paul Traylor
dfbac123db Add User-Agent for webhook requests (#893) 2017-07-11 11:22:13 +02:00
Siavash Safi
d5f0d1773f Add entity_display_name for VictorOps, use better state_message (#769)
* Add entity_display_name for VictorOps, use better state_message

* Reuse existing long-form templates for state_message

* Rebuild binaries

* Limit state_message to 20K
2017-07-03 11:44:53 +02:00
Praveen Maurya
525bd56db0 Changes to send mail to smtp port 465 (#704) 2017-06-18 12:18:10 +02:00
Max Inden
a217e162a8 Do not expose resolved alerts & do not send resolved if never firing (#820)
Do not expose resolved alerts on the /alerts endpoint. Do not send
resolved alerts to receivers if the alerts have never been fired before.
2017-05-29 14:07:05 +02:00
Fabian Reinartz
d73a655bf4 Simplify silence modifications, add update endpoint (#796)
* Simplify silence modifications, add update endpoint

* vendor: add pkg/errors

* ui: Handle upserting of silences

.

* Regenerate bindata
2017-05-16 16:48:25 +02:00
Frederic Branczyk
cec7341ce7 Merge pull request #750 from prometheus/fabxc-patch-1-1
notify: hex encode deduplication hash
2017-04-27 14:19:12 +02:00
stuart nelson
6a909abf17 Add processing status field to alert 2017-04-27 14:18:52 +02:00
Fabian Reinartz
49ceb8cc99 notify: hex encode deduplication hash 2017-04-27 13:10:43 +02:00
Fabian Reinartz
3269bc39e1 *: switch group key to matcher serialization
Turn the GroupKey into a string that is composed of the matchers if the
path in the routing tree and the grouping labels.
Only hash it at the very end to ensure we don't exceed size limits of
integration APIs.
2017-04-21 12:06:23 +02:00
Fabian Reinartz
b1486ca546 silence: move to gogoproto
This generates the protobuf Go code with gogoproto and switches to
standard library time types.
2017-04-18 12:47:42 +02:00
Fabian Reinartz
4258b028d6 nflog: switch to gogoproto
This switches the nflog to generate Go code via gogoproto and thereby
use standard library timestamp types.
2017-04-18 10:03:57 +02:00
Fabian Reinartz
8820ce7827 Merge pull request #703 from prometheus/fix-resolve
Fix resolve notifications
2017-04-17 14:19:04 +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
Julius Volz
7f1d111324 Include notifier type in retry logs and errors 2017-04-11 00:55:14 +02:00
Conor Broderick
b7bea3df5c Renamed from and message options for VictorOps to monitoring_tool and state_message as per the VictorOps documentation (#667) 2017-03-24 14:06:39 +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
sgissi
96a428a55e config/notify: Add SMTP Require TLS global option (#512) 2016-09-27 11:00:21 +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
b822fe58b6 Merge branch 'slack_enhance' of https://github.com/dmclain/alertmanager into dmclain-slack_enhance 2016-08-09 14:46:39 +02:00
Fabian Reinartz
2fda2f3071 Merge pull request #365 from prometheus/fabxc-soha
[WIP] Alertmanager HA mode
2016-08-09 12:03:47 +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
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
bc0897bb8f provider: remove in-memory provider
Remove the in-memory provider. It will be equivalent to a 1-peer
gossip setup.
2016-08-09 11:48:38 +02:00
振阳 赵
00e37b703b Modify SMTP login auth bug. 2016-08-08 17:57:08 +08: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
Djordje Atlialp
8e0f405e67 Add VictorOps Notifier
Add default VictorOpsAPIURL

Add VictorOps default config

Add VictorOpsConfig struct in notifiers

Add new template tags for victorops

Add notifications logic for victorops

Compiled template tags with make assets

Remove common labels from entity_id template

Set messageType default value to CRITICAL

Recovery messageType is not configurable anymore. Firing state only allows specific keys

Make assets

Using log.Debugf

EntityID should not be configureable

Remove entity_id from template

Use GroupKey(ctx) as entity_id

Improve debug logging

Fix type of entity_id
2016-07-27 00:49:05 +02:00
Tristan Colgate
de2252911e OpsGenie Notifier, fixes and additions:
- OpsGenie notifier confused the description and message fields
- Also added the notes field.
2016-07-12 16:20:23 +01:00
Thierry BOUVET
936f7e6362 Add smtp AUTH LOGIN 2016-07-05 15:10:42 +02:00
Dave McLain
c5d1c48610 Add support for overriding the icon_url slack parameter 2016-05-12 13:57:15 -05:00
Timo Derstappen
68232da066 Add resolved alerts to pushover template
The pushover notification of resolved alerts can end up in an empty
message (only a newline). I've fixed the check for an empty message with
trimming the whitespace. But I also thought that adding the resolved
alerts to the message would be helpful.
2016-04-27 10:55:06 +02:00
Fabian Reinartz
b52e71e5cd Merge pull request #308 from mpchadwick/smtp-auth
Move SMTP auth to the config file
2016-04-16 23:52:44 +02:00
Max Chadwick
4cb3874ab8 Move SMTP auth to the config file 2016-04-16 16:41:55 -04:00
Johannes Visintini
f38a16c848 Fixing Pushover issue with message length
thanks to Merovius
2016-04-16 13:00:46 +02:00