Commit Graph

158 Commits

Author SHA1 Message Date
Simon Pasquier 5fe5ea77a3
*: check Smarthost validity at config loading (#1957)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-08-28 15:04:40 +02:00
johncming 40b3facdf6 config: use the origin field instead of local var (#1999)
Signed-off-by: johncming <johncming@yahoo.com>
2019-08-26 14:01:40 +02:00
Asher Foa f45f870d2c Add the ability to configure slack markdown field (#1967)
* slack markdown field config

Signed-off-by: Asher Foa <asher@asherfoa.com>

* Add Test

Signed-off-by: Asher Foa <asher@asherfoa.com>

* remove empty lines

Signed-off-by: Asher Foa <asher@asherfoa.com>

* add empty line

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-07-31 12:04:59 +02:00
Simon Pasquier 02c9bb05bf
notify/pagerduty: fix images (#1931)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-06-24 12:19:06 +02:00
NODA, Kai fe4760ca75 config/notifiers.go: fix opsgenieValidTypesRe (#1910)
`^apple|banana|cherry$` finds matches to either of `^apple`, `banana`, or `cherry$`, so strings like `apple0`, `1banana2`, `3cherry` are accepted; I believe this wasn't intentional.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2019-06-17 11:05:38 +02:00
stuart nelson d291471f1e
Merge pull request #1888 from MIBc/master
Invalid APISecret error if only set default api_secret for wechat
2019-05-15 14:58:28 +02:00
lvjiawei 46a59f12d5 Invalid APISecret error if only set default api_secret for wechat
Signed-off-by: lvjiawei <lvjiawei@cmss.chinamobile.com>
2019-05-15 02:54:03 -07:00
Bartek Płotka 9ddc5f1348 opsgenie: Moved from deprecated, non documented teams to responders field. (#1863)
Teams config option will fail unmarshalling as it is deprecated.

Fixes https://github.com/prometheus/alertmanager/issues/1818

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
2019-05-13 14:51:26 +02:00
stuart nelson 6a0be9eaa2 Add image_url to example of good config
There was a report that this isn't working.
Updating the config and ensuring the parsing works
correctly indicates that the image_url is being
read into a string.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-05-06 10:51:14 +02:00
Simon Pasquier 0f754cdef3 config: fix Wechat global parameters (#1813)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-29 12:21:59 +01:00
Karsten Weiss 93671add46 config/notifiers.go: Fix bad syntax for struct tag value (#1794)
This fixes the following error found by go vet:

config/notifiers.go:546:2: struct field tag
`yaml:"url_title,omitempty" json:"url_title,omitempty` not compatible with
reflect.StructTag.Get: bad syntax for struct tag value (govet)
	URLTitle string   `yaml:"url_title,omitempty" json:"url_title,omitempty`
	^

Signed-off-by: Karsten Weiss <knweiss@gmail.com>
2019-03-13 11:09:58 +01:00
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
Simon Pasquier 873f1fb87c config: update coordinator's logs
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-02-26 16:41:50 +01:00
Max Leonard Inden d0cd5a0f08
*: Introduce config coordinator bundling config specific logic
Instead of handling all config specific logic inside
Alertmangaer.main(), this patch introduces the config coordinator
component.

Tasks of the config coordinator:
- Load and parse configuration
- Notify subscribers on configuration changes
- Register and manage configuration specific metrics

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2019-02-25 11:26:30 +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
Jason Roberts b02afcad63 Support adding custom fields to VictorOps notifications (#1420)
* Support adding custom fields to VictorOps notifications

* Response to feedback

* Added logic to validate victorops custom fields to config load time

* Cleanup victorops notifier of logic duplicated in config check

* rebase and further cleanup from feedback

* another grammer fix

Signed-off-by: Jason Roberts <jroberts@drud.com>
2019-01-15 11:59:05 +01:00
Tomas Dabasinskas cfc0d9c558 Pushover: support HTML, URL title and custom sounds (#1634)
* Support HTML inside Pushover message

Signed-off-by: Tomas Dabasinskas <tomas@dabasinskas.net>
2018-12-18 15:15:30 +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
Arno Uhlig b63b560074 [notify/slack] Add name, value, SlackConfirmationField to slack action (#1557)
Signed-off-by: Arno Uhlig <arno.uhlig@sap.com>
2018-10-29 15:55:43 +01:00
Arno Uhlig c38ac84a6d Slack notifier missing callback_id parameter (#1592)
* fix callback id in slack attachments

Signed-off-by: Arno Uhlig <arno.uhlig@sap.com>
2018-10-23 11:22:23 +02: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
Sean Houghton c9e250dab1 Add support for images and links in the PagerDuty notification config (#1559)
* Add support for images and links in the PagerDuty notification config

This only works when using the v2 API. It supports template values for all fields.

Signed-off-by: Sean Houghton <sean.houghton@activision.com>
2018-10-02 10:45:53 +02:00
miton18 e132c81c5c feat(email): support custom TLS certificates
Signed-off-by: miton18 <remi+github@collignon-ducret.fr>
2018-09-05 08:38:15 +02:00
Johannes 'fish' Ziemke f443038149 Slack: Support image/thumb url in attachment (#1506)
This closes #1491

Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2018-08-13 15:14:45 +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 2d3c4065e8 config: fix regression with Pager Duty (#1455)
The YAML strict mode doesn't allow mapping keys that are duplicates. If
someone wants to override one of the default keys in the Details hash,
the unmarshal function returns an error because the key is already
defined by DefaultPagerdutyConfig.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-07-05 09:54:28 +02:00
Simon Pasquier 0ebaeccd4b *: add missing license headers
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-05-14 17:37:13 +02:00
Alex Lardschneider 1f9a7b6182 [Request] Add Slack actions to notifications (#1355)
* Added slack actions to notifications

Signed-off-by: Alex Lardschneider <alex.lardschneider@gmail.com>
2018-05-14 17:26:11 +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
Trevor Wood cecfe5b2f5 Validate Slack field config and only allow the necessary input (#1334)
Signed-off-by: Trevor Wood <Trevor.G.Wood@gmail.com>
2018-04-25 18:58:11 +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
ranbochen b4048f46bc fix wechat issue (#1293) 2018-03-20 12:21:19 +01:00
Simon Pasquier 8c9e0cf50c config: set global SMTP hello to "localhost" by default (#1290) 2018-03-16 14:45:17 +00:00
pasquier-s e67aa8edae Hide sensitive Wechat configuration + remove default fields (#1253)
* Hide sensitive Wechat configuration

* Don't send resolved alerts for Wechat by default
2018-03-02 09:49:41 +01:00
Simon Pasquier 955c92f1b6 Configure http client for Wechat 2018-02-13 14:52:53 +01:00
Simon Pasquier 8b93f1085d Add tests for HTTP client configuration 2018-02-13 14:30:59 +01:00
Frederic Branczyk d678022fea *: configure http client from config 2018-02-13 14:30:59 +01:00
songjiayang d07a072b08 Fix WeChat issue (#1229)
* fix wechat issue

* wechat issue code review
2018-02-11 20:09:47 +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
Mike Bryant 6615ed15d2 Add templating to PD-CEF fields; Add missing field (#1231)
* Allow templating of Component and Group in PagerDuty v2

Related to #1211

* Add missing PD-CEF field Component
2018-02-09 10:50:18 +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
Evan Baker 6a3dfaff45 Add Slack additional "fields" to notifications (#1135)
* impl slack fields

* wrap title and value in tmplText
2017-12-15 12:18:05 +01:00
stuart nelson 7736ea0f61
Add footer field for slack messages (#1141) 2017-12-12 22:50:41 +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
xginn8 266baa089c Adding check for webhook's URL formatting (#1129)
* Adding check for webhook's URL formatting
Since alertmanager will fail silently when trying to send to a schemaless URL, provide a way to check that a URL is properly formatted in alertmanager

* updating error message as requested
2017-12-07 15:01:16 +01:00
Tom Fawcett fd0ace8d88 Support OpsGenie Priority field (#1094) 2017-11-12 12:01:19 -05:00