Commit Graph

140 Commits

Author SHA1 Message Date
Stuart Nelson a552afd998 Merge branch 'master' into memberlist 2018-02-13 10:47:17 +01:00
Fabian Reinartz 3f2e00fbea cluster/api: improve metrics and cluster status 2018-02-09 11:16:00 +01:00
Fabian Reinartz fd49dbb477 *: move to memberlist for clustering 2018-02-08 12:18:44 +01:00
conorbroderick e8832619e0 Fixes AM wrongly counting alerts with EndTimes in the future as resolved 2018-02-07 15:52:26 +00:00
Jose Donizetti fc9306cd7e Add expired silence validation (#1096)
* Add expired silence validation

* Add silence end time in the past validation
2018-01-21 15:29:51 +01:00
pasquier-s 364979bbf8 Display connections in the Status page (#1164)
This change shows the status of the local connections in the web UI. It
can be used to troubleshoot mesh issues.
2017-12-22 11:39:27 +01:00
Fabian Reinartz 405dbb8d9c
Fix wrong lock 2017-12-21 16:55:55 +01:00
stuart nelson 1abe4c9a56 Lock around variables used in Update()
Found two places where struct members being
updated in api.Update() where being accessed
elsewhere without locks.
2017-12-21 12:08:39 +01:00
Jose Donizetti 10ed60361d Fix silences negative filtering (#1095)
* Fix silence negative filtering

* Refactor extract filtering labels func
2017-11-15 14:29:06 -05:00
Jose Donizetti e303646b80 Fix typo (#1103) 2017-11-15 14:25:46 -05:00
Jose Donizetti 95e80d1aa8 Add tests to receiver filtering (#1098) 2017-11-12 11:35:49 -05:00
Julius Volz fdee5fcbfc Fix UI when no silences are present (#1090)
* Explicitly initialize silences list to avoid "null" JSON

* Wrap "No silences found" message in error box

* bindata fixup
2017-11-11 14:48:48 +01:00
Jose Donizetti 74808e40f3 Refactor silence constants (#1076)
* Refactor remove dups silence state constants

* Refactor to use const instead of string
2017-11-07 11:36:30 +01:00
Jose Donizetti b9597f5c7b Fix negative matchers filtering (#1077) 2017-11-04 14:38:16 +01:00
Julius Volz 947970af44 Convert Alertmanager to use non-global go-kit loggers
Fixes https://github.com/prometheus/alertmanager/issues/1040
2017-10-22 00:20:40 -07:00
Carlos Alexandro Becker 26489b13ef also hide inhibited alerts (#1039)
* also hide inhibited alerts

* split inhibited and silenced
2017-10-17 10:49:59 +02:00
Conor Broderick c56d2b5d07 Sorted silences based on current status (#1015) 2017-10-02 18:42:43 +02:00
Stuart Nelson ad64e9f1b2 Sort alerts by their fingerprint
Seemed like an ok way to sort.
2017-09-02 11:35:17 +02:00
Łukasz Mierzwa 8e61ebf6c3 Expose alert fingerprint in the API (#786)
* Expose alert fingerprint in the API

Alert fingerprint is already provided as the value of status.inhibitedBy[] attribute that inhibited alerts have, but there's no way to get back to the alert that's inhibiting it as the fingerprint is not exposed.

* Expose alert fingerprint as ID in the list endpoint

* Rename ID to Fingerprint

* Use Fingerprint().String() in the API
2017-08-18 19:30:18 +02:00
stuart nelson 040b1f9e53 Stn/status page ohne mesh (#920)
* Render status page without mesh connection (#918)

A mesh connection was assumed, even though the
value that was being passed into the helper
function was a possibly-nil pointer. Add a check
for this, and return a nil value in that case. The
frontend finds this when decoding the json
payload, and displays the "not configured"
message.

* Update bindata
2017-07-22 12:30:19 +02:00
stuart nelson a7009a9db7 Stn/add receiver support (#872)
Add ability to filter alerts by receiver in UI. This adds changes both in the Elm UI, as well as the Go backend.
2017-06-26 18:20:26 +02:00
Frederic Branczyk c4c0875ba3
fix config JSON marshaling 2017-06-08 13:37:57 +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
Max Leonard Inden b9acb7a63f
Add 'silenced' query param to /alerts endpoint
This adds the silenced query parameter to the /alerts API endpoint. In
addition it changes the default in the UI. Previously silenced alerts
were displayed by default. This PR hides silenced alerts by default.
2017-05-17 18:59:20 +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
Max Leonard Inden 401e440db4
Return silence state on /silences
silenceState = "expired" | "active" | "pending"
```
"status": {
  "state": "expired"
}
```
2017-05-10 12:01:21 +02:00
Max Inden d463f1c298 Sync ui-rewrite with master (#779) 2017-05-10 11:49:02 +02:00
Max Leonard Inden 96a28bbc36
Init result slice to prevent /alerts returning `null`
When there are no alerts to return the api endpoint `/alerts` should
return:
```
{
  "status": "success",
  "data": []
}
```
instead of
```
{
  "status": "success",
  "data": null
}
```
2017-05-02 11:51:09 +02:00
Max Leonard Inden ef3cc7b001
Return alert status on /alerts endpoint and enable filtering
This makes the /alerts endpoint return the alert status introduced by PR
 # 717. In addition it enables alert filtering via matchers like on the
/alerts/groups endpoint.
2017-05-02 09:46:20 +02:00
Tom Wilkie ba4fc17307 Remove use of route.Context 2017-04-25 17:43:01 -07: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
stuart nelson 1e34f29532 Filter alerts (#633)
* Vendor dependencies.

This updates several old dependencies, removes
some that are no longer needed, and adds
`pkg/labels` from prometheus `dev-2.0` branch.

* Add metrics selector parsing code

This is a temporary simplified re-implementation
of promQL's metric selector parsing.

* Add alerts filtering

Filter alerts through `?filter=` query string.

* Add silences filtering

Filter silences through `?filter=` query string.

* Move `parse` to `pkg/parse`
2017-03-16 11:16:10 +01:00
Max Inden fced9e126b api: Expose mesh status (#644)
* api: Expose mesh status

The weaveworks mesh package reveals information about the current status
of the mesh network between alertmanager instances. This commit exposes
the current address and connection status of each instance connected to
the targeted alertmanager instance via the /status API endpoint.

* api: Replace LocalConnectionStatus with PeerStatus

Now meshStatus contains all peers (Name, NickName, UID) of the network.
Additionally adding Name and Nickname of current target to toplevel of
meshNetwork object.
2017-03-07 18:17:03 +01:00
stuart nelson 0ecc59076c Add DELETE to acceptable cors methods 2017-02-22 13:55:57 +01:00
Matt Bostock 890f148a27 Prevent panic on failed config load
Prevent Alertmanager from panicking when the configuration cannot be
loaded.

Spotted in version 0.4.2:

    INFO[0000] Starting alertmanager (version=0.4.2, branch=HEAD, revision=9a5ab2fa63dd7951f4f202b0846d4f4d8e9615b0)  source=main.go:84
    INFO[0000] Build context (go=go1.7.3, user=root@45f28166fed1, date=20170117-13:50:50)  source=main.go:85
    INFO[0000] Loading configuration file                    file=alertmanager.yml source=main.go:156
    ERRO[0000] error: yaml: line 64: could not find expected ':'  source=api.go:115
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x401adb]

    goroutine 1 [running]:
    panic(0x83e240, 0xc42000e020)
            /usr/local/go/src/runtime/panic.go:500 +0x1a1
    main.(*API).Update(0xc4200b20f0, 0xc42019f800, 0x17e7, 0x45d964b800)
            /go/src/github.com/prometheus/alertmanager/api.go:117 +0xcb
    main.main.func3(0x0, 0x0)
            /go/src/github.com/prometheus/alertmanager/main.go:172 +0x226
    main.main()
            /go/src/github.com/prometheus/alertmanager/main.go:192 +0x97a
    make: *** [run] Error 2
2017-01-17 14:59:11 +00:00
Fabian Reinartz d7843ad6a6 Export parsed configuration as JSON and drop js-yaml dependency. (#563)
* Export parsed configuration as JSON in /api/v1/status.
* Avoid exporting the XXX fields.
* Drop js-yaml library and use already parsed configuration.
* Go fmt + go-bindata
2016-11-22 15:05:14 +01:00
Brian Brazil 406aacf141 Improve logging of API errors. (#553)
Previously errors would look like:
ERRO[0008] api error: {bad_data 0xc4201caae0}
source=api.go:534

Now they look like:
ERRO[0001] api error: bad_data: json: cannot unmarshal object into Go
value of type []*types.Alert  source=api.go:534
2016-11-18 16:50:15 +01:00
Vanesa 9d766e1843 allow CORS for api GET and OPTIONS 2016-09-04 17:43:25 +02:00
Fabian Reinartz a4e8703567 *: integrate new silence package 2016-08-30 12:15:23 +02:00
Fabian Reinartz 3931d4e64b *: restructure package tree
This commit packages up individual modules and removes the top-level
main package.
2016-08-09 14:24:52 +02:00