Commit Graph

1711 Commits

Author SHA1 Message Date
Max Inden
7ff1a618c6
Merge pull request #1613 from mxinden/api-v2-silences-status
ui: Move /status & /silences to API v2
2018-11-15 17:15:38 +01:00
Max Leonard Inden
b4b8b750df
api/v2/openapi.yaml: Differentiate between post and get silence
Instead of having one general silence, differentiate between postable
and gettable silence, hence making more fields required.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-15 16:21:07 +01:00
Max Leonard Inden
fb86df6add
ui: Patch /alerts and /receivers to use api v1
With the previous patch /status and /silences were requested from api
v2. Requesting alerts from api v1 is done in a separate commit to be
able to revert it once alerts also come from api v2.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-15 13:25:41 +01:00
Max Leonard Inden
e4e053b18e
ui: Move /status & /silences to API v2
This patch makes the Alertmanager UI (/status & /silences) use the
api/v2 endpoint. In addition it adds logic to generate the elm side data
model based on the OpenAPI specification.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-15 13:24:26 +01:00
Simon Pasquier
19dad7c8d5
Merge pull request #1622 from simonpasquier/fix-notify-channel
cmd/alertmanager: use buffered channel for signal
2018-11-14 18:06:08 +01:00
Simon Pasquier
dae389f058 cmd/alertmanager: use buffered channel for signal
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-11-14 16:41:32 +01:00
Max Inden
9426724e4a
Merge pull request #1609 from free/fix-mime-line-length
Use quoted-printable transfer encoding for the email notifier
2018-11-14 15:11:57 +01:00
stuart nelson
72e6720bea
Fixes #1615 (#1620)
Support `w` duration when making silences. Remove
`y` as a supported duration, silences are for
short term notification prevention.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-11-13 15:08:37 +01:00
Max Inden
86129874d1
Merge pull request #1617 from mxinden/back-to-master
*: Cut v0.15.3 back to master
2018-11-09 17:34:36 +00:00
Max Leonard Inden
e572eb55c0
*: Cut v0.15.3
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-09 16:49:50 +00:00
Simon Pasquier
008b4a93da
types: fix alert merging
Alert merging assumed that EndsAt would always be empty for firing
alerts. This is no longer true starting with Prometheus v2.4.0: EndsAt
is set to a multiple of the evaluation interval or resend interval
(whichever is the largest). This change updates the merging logic to
support both cases.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-11-09 16:48:46 +00:00
Guillaume Le Floch
108388a72f notify/email: Throw error if no auth mechanism matches (#1608)
Signed-off-by: glefloch <glfloch@gmail.com>
2018-11-09 12:45:07 +00:00
Max Inden
3a577968a0
Merge pull request #1612 from simonpasquier/remove-x-net-context
*: remove use of golang.org/x/net/context
2018-11-09 11:55:16 +00:00
Simon Pasquier
306fd73e32 *: remove use of golang.org/x/net/context
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-11-09 10:00:23 +01:00
stuart nelson
625604df90
Show more alert information on silence form/ silence view pages (#1601)
* Display same alert info as available in alert list

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-11-07 17:08:22 +01:00
Alin Sinpalean
9513afbe6b Use quoted-printable transfer encoding for the email notifier. Turns out MIME has a maximum line length of 998 bytes and some SMTP servers will enforce that by inserting a newline after 998 characters, whether that's in the middle of a URL or HTML tag.
Signed-off-by: Alin Sinpalean <alin.sinpalean@gmail.com>
2018-11-07 12:46:08 +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
Max Inden
0d94ec2268
Merge pull request #1562 from mxinden/clustering-tests
test: Enable testing against cluster of Alertmanagers
2018-10-24 16:42:42 +02:00
Max Leonard Inden
d123cbe696
test: Enable testing against cluster of Alertmanagers
Instead of only testing single instance Alertmanagers, this patch
enables individual tests to spin up Alertmanager clusters.

In addition it adds two tests:

1. A test firing alerts against a cluster, expecting to only receive a a
notification by one of the Alertmanager instances in the cluster.

2. A test firing alerts both against a single instance as well as a
cluster, making sure the output equals.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-10-24 15:59:36 +02:00
Tom Wieczorek
875f6ba178 Make OpsGenie API Key a templated string. (#1594)
This is analogous of what is done for PagerDuty secrets.

Signed-off-by: Tom Wieczorek <t.wieczorek@yieldlab.de>
2018-10-23 12:53:57 +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
Jonathon Mills-Kelly
f297445b88 run as nobody (#1586)
Signed-off-by: Jonathon <jonathon@insidersbyte.com>
2018-10-17 12:01:48 +02:00
Simon Pasquier
a19404238b *: move to go1.11 (#1580)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-10-10 11:12:15 +02:00
Simon Pasquier
7bdd221f3a circleci: switch to 2.1 configuration (#1579)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-10-10 08:59:17 +02:00
Chris Mark
6eaacfe243 Changes alertmanager_notifications to count attempted notifications (#1578)
alertmanager_notifications_total is increased only on
successful notifications, and not on any attempted
notification as the current description points

Signed-off-by: Chris Mark <chrismarkou92@gmail.com>
2018-10-09 13:23:12 +01:00
stuart nelson
50b87ac720
Fixes #1570 (#1575)
The documentation stated that the `alertname=`
part of a matcher could be dropped and it would be
assumed that the first value was the alertname.
This behavior was only honored if there was a
single matcher, but failed if there were multiple.

Any time we have one or more matchers, check to
see if the first matcher fails parsing. If so,
assume it's intended to be used as the alertname,
and append that value to the matcher.

Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>
2018-10-08 13:06:12 +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
Simon Pasquier
e6c5c03c9e circleci: store build outputs as artifacts (#1572)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-10-05 19:18:50 +02:00
Jannick Fahlbusch ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎
30aae38c95 store: Fix ineffectual assignment for default GC interval (#1568)
This fixes the ineffectual assignment for the default GC interval when specifiying a duration of 0

Signed-off-by: Jannick Fahlbusch <git@jf-projects.de>
2018-10-03 13:08:23 +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
Kai S
d593562493 Make a note about the firewall in HA mode (#1563)
* Make a note about the firewall in HA mode
2018-10-01 13:39:50 +02:00
Simon Pasquier
3558e6fd9e Migrate from go-bindata to vfsgen (#1532)
* Migrate from go-bindata to vfsgen

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

* Ensure idempotent generation for vfsgen

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

* asset: update generated files

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

* Fix asset paths for Windows platforms

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

* Regenerate assets

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

* Add vfs wrapper that returns constant mod time

This is identical to what we had with go-bindata and avoids the extra
step of storing the identity of the complete file system in another
location.

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

* Additional cleanup

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-09-24 15:12:40 +02:00
Max Inden
a74f94c4aa
Merge pull request #1528 from miton18/feat/notifier-email-tls-config
feat(email): support custom TLS certificates
2018-09-19 13:39:46 +02:00
dseebacher
d5b8e10286 Fix the Swagger/OpenAPI link (#1552)
Signed-off-by: David Seebacher <dseebacher@gmail.com>
2018-09-18 13:47:21 +02:00
stuart nelson
6f1118ab46
fix silence redirect (#1548)
* Use a button instead of a for buttons

Using <a> was causing an unintended redirect to
the root. It appears this behavior has changed in
0.19.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>

* bindata

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-09-13 15:02:24 +02:00
Simon Pasquier
460b7a72fc test: Don't run TestResolved() in parallel and reduce to 2 runs (#1544)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-09-11 12:55:48 +02:00
Max Inden
c8acbf1a5f
Merge pull request #1543 from simonpasquier/add-public-address-warning
README.md: update HA section
2018-09-10 08:04:25 +02:00
Simon Pasquier
47c84402af README.md: update HA section
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-09-07 10:36:42 +02:00
Andrey Kuzmin
e768371a39
Upgrade Alertmanager UI to Elm 0.19 (#1539)
* Run elm-upgrade
* Make compile
* Update index.html
* Upgrade tests
* Finalize the upgrade
* Optimize!
2018-09-06 18:08:51 +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
Max Inden
2c018e7828
Merge pull request #1352 from mxinden/apiv2
api: Introduce OpenAPI generated Alertmanager API V2
2018-09-04 16:29:48 +02:00
Max Leonard Inden
f1b920bcc9
api: Implement OpenAPI generated Alertmanager API V2
The current Alertmanager API v1 is undocumented and written by hand.
This patch introduces a new Alertmanager API - v2. The API is fully
generated via an OpenAPI 2.0 [1] specification (see
`api/v2/openapi.yaml`) with the exception of the http handlers itself.

Pros:
- Generated server code
- Ability to generate clients in all major languages
  (Go, Java, JS, Python, Ruby, Haskell, *elm* [3] ...)
    - Strict contract (OpenAPI spec) between server and clients.
    - Instant feedback on frontend-breaking changes, due to strictly
      typed frontend language elm.
- Generated documentation (See Alertmanager online Swagger UI [4])

Cons:
- Dependency on open api ecosystem including go-swagger [2]

In addition this patch includes the following changes.

- README.md: Add API section

- test: Duplicate acceptance test to API v1 & API v2 version

  The Alertmanager acceptance test framework has a decent test coverage
  on the Alertmanager API. Introducing the Alertmanager API v2 does not go
  hand in hand with deprecating API v1. They should live alongside each
  other for a couple of minor Alertmanager versions.

  Instead of porting the acceptance test framework to use the new API v2,
  this patch duplicates the acceptance tests, one using the API v1, the
  other API v2.

  Once API v1 is removed we can simply remove `test/with_api_v1` and bring
  `test/with_api_v2` to `test/`.

[1]
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

[2] https://github.com/go-swagger/go-swagger/

[3] https://github.com/ahultgren/swagger-elm

[4]
http://petstore.swagger.io/?url=https://raw.githubusercontent.com/mxinden/alertmanager/apiv2/api/v2/openapi.yaml

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-09-04 13:38:34 +02:00
stuart nelson
e883ccb9de
pull out shared code for storing alerts (#1507)
Move the code for storing and GC'ing alerts from being re-implemented in
several packages to existing in its own package

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-09-03 14:52:53 +02:00
Martin Chodur
20bdaaf949 fix amtool: Fixed config path check in amtool (#1538)
Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
2018-09-03 06:06:01 +02:00
Max Inden
b1a8fdd169
Merge pull request #1521 from mxinden/errcheck
*.go: Introduce errcheck enforcing error handling
2018-08-30 17:53:49 +02:00
Max Leonard Inden
1219541184
*.go: Introduce errcheck enforcing error handling
Errcheck [1] enforces error handling accross all go files. Functions can
be excluded via `scripts/errcheck_excludes.txt`.

This patch adds errcheck to the `test` Make target.

[1] https://github.com/kisielk/errcheck

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-08-30 15:47:13 +02:00
Tariq Ibrahim
d03e0ba116 Dockerfile: Using the recommended label syntax for maintainer (#1533)
Signed-off-by: Tariq Ibrahim <tariq.ibrahim@microsoft.com>
2018-08-27 18:59:41 +02:00
Simon Pasquier
3799768d94 circleci: fix Docker jobs (#1527)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-08-23 17:35:20 +02:00
Dave Barboza
34bc54cee1 Fix rfc3339 example texts (#1526)
Signed-off-by: Dave Barboza <dxbarboza@gmail.com>
2018-08-23 16:17:27 +02:00
Simon Pasquier
899226f3ac *: remove v1/alerts/groups API endpoint (#1525)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-08-23 16:03:49 +02:00