Commit Graph

29 Commits

Author SHA1 Message Date
Julius Volz 3a73ca5b65 Fix receiver name checking in deep sub-routes
Fixes https://github.com/prometheus/alertmanager/issues/1759

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-03-02 12:35:09 +01:00
Miek Gieben 41c5b5cefa Add original field to Regexp (#1757)
In similar vein to prometheus/prometheus/pkg/relabel/relabel.go, extend
Regexp to include the original regular expression string to faithfully
output what was read.

Update TestEmptyFieldsAndRegex.

Fixes: #1753

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-02-19 11:08:35 +01:00
Hrishikesh Barman 4e424e3cd6 config: Change DefaultGlobalConfig to a function (#1656)
The variable DefaultGlobalConfig was being used to initialize values, but it stored previous information due to which some things were persisting in the newer initialization.

In this PR, DefaultGlobalConfig is changed to a function so that it returns a fresh GlobalConfig for initialization.

Signed-off-by: Hrishikesh Barman <hrishikeshbman@gmail.com>
2019-01-15 18:03:45 +01:00
stuart nelson 082b1efed0
Fix #1662 (#1665)
GroupByAll and a duplicate GroupBy were showing up
in the marshaled config, which we don't want.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-12-13 11:51:49 +01:00
Simon Pasquier 34f78c9146 config: fix unmarshalling of secret URLs (#1663)
* config: fix unmarshalling of secret URLs

* Add comment describing why we need the special case

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-12-13 11:09:02 +01:00
kirillsablin 32bb289906 dispatch: Add group_by_all support (#1588)
To aggregate by all possible labels use '...' as the sole label name. 
This effectively disables aggregation entirely, passing through all 
alerts as-is. This is unlikely to be what you want, unless you have 
a very low alert volume or your upstream notification system performs 
its own grouping. Example: group_by: [...]

Signed-off-by: Kyryl Sablin <kyryl.sablin@schibsted.com>
2018-11-29 12:31:14 +01:00
Simon Pasquier ce2f2ac380 config: enforce HTTP or HTTPS URLs (#1567)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-10-05 19:29:52 +02:00
Max Leonard Inden 0e50299679
config/test: Count `<secret>` occurrences via golang strings
`honnef.co/go/tools/cmd/staticcheck` complains with
`config/config_test.go:260:32: regular expression does not contain any
meta characters (SA6004)`. Instead of using a RegEx this patch simply
switches to using Golangs `strings.Count` function.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-07-30 08:08:44 +02:00
Simon Pasquier 0ccc7c9f74 config: validate URLs at config load time (#1468)
* config: validate URLs at config load time

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Address Brian and Lucas comments

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Shallow copy of URL instead of reparsing it

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Unshadow net/url package

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Make a deep-copy of URL struct

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-07-26 12:39:33 +02:00
Simon Pasquier 28967e394e config: fix Go formatting (#1368)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-05-07 18:12:14 +02:00
Manos Fokas 300a87e85b Removed file changes to resolve conflict. (#1318)
Signed-off-by: manosf <manosf@protonmail.com>
2018-04-17 16:22:46 +02:00
Frederic Branczyk d678022fea *: configure http client from config 2018-02-13 14:30:59 +01:00
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
Carlos Alexandro Becker c5ea346d06 allow global opsgenie api key (#1208)
* allow global opsgenie api key

* added missing files

* removed test
2018-01-29 16:05:17 +01:00
berlinsaint 6bab629590 Add notify support for Chinese User wechat (#1059)
* WECHAT support by ybyang2/berlinsaint

* correct the whitespace

* add some TestFile and modify some naming errors by ybyang2/berlinsaint

* modify wechat retry test expect

* template error

* add newline
Signed-off-by: yb_home <berlinsaint@126.com>

* fmt some pr code

* use the @stuartnelson3 the test-ci-wechat bingdata.go

* notify go add wechat
2017-12-09 16:20:22 +01:00
Jose Donizetti 76c15a0ef5 Fix config name inconsistency (#1087)
* Rename global config hipchat_url to hipchat_api_url

* Rename opsgenie config 'host' to 'url'
2017-11-11 15:01:21 +01:00
Steven Carvellas 5db8055bab Add support for PagerDuty API v2 (#1054) 2017-11-07 11:07:27 +01:00
Jose Donizetti 4369eb3244 Improve config test coverage (#1046) 2017-10-19 21:00:35 +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
Carlos Alexandro Becker ca8d73a59b Added possibility to have a global victorops api_key (#897)
* Added possibility to have a global victorops api_key

* adding tests for victorops default key
2017-07-12 09:25:47 +02:00
Conor Broderick b5ad65fa32 Omit empty config fields and show regex upon re-marshalling to elide secrets (#864)
* Omit empty config fields upon remarshalling to elide secrets

* added test checking for empty or null fields and blank regexps
2017-06-20 19:09:14 +02:00
Frederic Branczyk c4c0875ba3
fix config JSON marshaling 2017-06-08 13:37:57 +02:00
Conor Broderick 5a5acb2d1c Elide secrets in alertmanager config (#841) 2017-06-06 12:02:49 +01:00
Conor Broderick a77bfb44d6 Added unit test for continue in root route error (#768)
* Added unit test for continue in root route error

* replaced %v with %q
2017-05-09 10:11:40 +02:00
Matt Bostock a29860d80e Allow route receiver to be inherited
This is useful when you're using a label to determine the receiver but
want to override other options such as `group_by`. Currently you'd have
to duplicate the matchers for the receivers to be able to do this.

`checkReceiver()` now returns no error if a receiver is empty and we add
a check to ensure that the root route has a receiver defined. I've added
a test for this.

This brings the `receiver` option into line with the other options
(`group_by`, `group_wait`, etc) in the sense that routes can now inherit
the receiver from the parent node.

From https://prometheus.io/docs/alerting/configuration/:

> A route block defines a node in a routing tree and its children. Its
> optional configuration parameters are inherited from its parent node
> if not set.
2016-06-04 10:19:43 +01:00
Fabian Reinartz 2e1a01b2fa switch to YAML config. 2015-06-29 18:53:47 +02:00
Julius Volz 5d4f9f7e11 Add notification options to configuration. 2013-07-29 18:43:01 +02:00
Julius Volz db599b6d26 PR comments fixups. 2013-07-26 17:39:46 +02:00
Julius Volz 24ac73af5d Add loading configuration from file. 2013-07-26 16:12:11 +02:00