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.
When there are no alerts to return the api endpoint `/alerts` should
return:
```
{
"status": "success",
"data": []
}
```
instead of
```
{
"status": "success",
"data": null
}
```
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.
* 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`
* 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.
* 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
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