Commit Graph

1294 Commits

Author SHA1 Message Date
stuart nelson
dc90e8dec3 Allow filtering receiver with a regex
e.g.:
http://localhost:5000/#/alerts?receiver=~(backend|ops)-warn
2017-04-23 21:04:53 +02:00
stuart nelson
e9cb88e15a Fix vendor package while waiting
I can't be bothered to go through the mountain of
steps to commit this tiny change.

https://github.com/golang/go/issues/20055
2017-04-21 16:21:32 +02:00
Fabian Reinartz
c61a6ec8b6 Merge pull request #716 from prometheus/reloadtest
test: add reload test
2017-04-21 14:57:52 +02:00
Fabian Reinartz
9753a7fcc6 Merge pull request #726 from prometheus/peerpanic
cmd: fix panic on empty peer string
2017-04-21 14:57:23 +02:00
Kellen Fox
b2c656a071 Add command wrapper to handle printing errors for any subcommands (#724)
Fixes #721

I was using the RunE method of cobra.Command which does things with an
error returned from a function. I doesn't seem possible to keep it from
printing usage every time, so I've make a wrapper to use the other
function.
2017-04-21 14:50:02 +02:00
Fabian Reinartz
7e31a58868 cmd: fix panic on empty peer string 2017-04-21 14:40:46 +02:00
Fabian Reinartz
0659dfbde3 Merge pull request #725 from prometheus/groupkey
*: switch group key to matcher serialization
2017-04-21 13:21:39 +02:00
Fabian Reinartz
3269bc39e1 *: switch group key to matcher serialization
Turn the GroupKey into a string that is composed of the matchers if the
path in the routing tree and the grouping labels.
Only hash it at the very end to ensure we don't exceed size limits of
integration APIs.
2017-04-21 12:06:23 +02:00
stuart nelson
68e1cbe024 Add mousetrap vendor package 2017-04-20 11:33:33 +02:00
stuart nelson
7429ccca99 Fix invalid json in vendor.json file 2017-04-20 11:31:04 +02:00
Kellen Fox
3aab66ec3a Amtool implementation (#636)
* Implement alertmanager cli tool 'amtool'

The primary goal of an alertmanager tool is to provide a cli interface
for the prometheus alertmanager.

My vision for this tool has two parts:
  - Silence management (query, add, delete)

  - Alert management (query, maybe more in future?)

Resolves: #567
2017-04-20 11:04:17 +02:00
Andrey Kuzmin
88ec956973 Improve filter (#714)
* Update elm-tools/parser

* Improve filter UI

* Pressing backspace edits the last matcher

* Put escape char back into the output

* Allow editing the matcher

* Update bindata.go

* Const for key codes

* Use qualified imports

* Update bindata.go

* Commented the backspacePressed attribute
2017-04-18 20:49:52 +02:00
Fabian Reinartz
cb8729a458 Merge pull request #715 from prometheus/gogoproto
Move to gogoproto
2017-04-18 14:12:58 +02:00
Fabian Reinartz
15efe6d748 vendor: add gogo protobuf packages 2017-04-18 12:58:32 +02: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
Fabian Reinartz
ff5ecfff51 test: add reload test
This test reloads the Alertmanager to verify, that it properly keeps
state and sends notifications correctly across reloads.
2017-04-18 12:44:38 +02:00
Fabian Reinartz
4258b028d6 nflog: switch to gogoproto
This switches the nflog to generate Go code via gogoproto and thereby
use standard library timestamp types.
2017-04-18 10:03:57 +02:00
Tobias Schmidt
af8cfdde14 Create sha256 checksums file during release (#713) 2017-04-17 20:00:29 +02:00
Fabian Reinartz
8820ce7827 Merge pull request #703 from prometheus/fix-resolve
Fix resolve notifications
2017-04-17 14:19:04 +02:00
Fabian Reinartz
309c6af4b2
nflog: use alert set instead of hash for deduplication
Building a hash over an entire set of alerts causes problems, because
the hash differs, on any change, whereas we only want to send
notifications if the alert and it's state have changed. Therefore this
introduces a list of alerts that are active and a list of alerts that
are resolved. If the currently active alerts of a group are a subset of
the ones that have been notified about before then they are
deduplicated. The resolved notifications work the same way, with a
separate list of resolved notifications that have already been sent.
2017-04-13 15:13:47 +02:00
Julius Volz
0ce2de56fc Merge pull request #702 from prometheus/log-failed-notifiers
Include notifier type in retry logs and errors
2017-04-11 13:00:00 +02:00
Julius Volz
7f1d111324 Include notifier type in retry logs and errors 2017-04-11 00:55:14 +02:00
Max Leonard Inden
c3850708c1 Make assets generation deterministic
By passing "-modtime 1" flag into go-bindata command it uses the same
unix timestamp (1) for every file in the fake filesystem. Thereby every
execution of "make assets" results in the same asset outputs if the
inputs were the same. This forces us to set the "Cache-Control"
attribute to "no-cache".
2017-04-10 13:47:13 +02:00
stuart nelson
8e4c29f5b8 Click alert matchers (#690)
* Clicks update alerts filter text

- Normal click replaces filter with selected label
- Modifier (ctrl, cmd) + click appends to filter

* Auto-filter when clicking labels

* ctrl+click removes already present matcher

* Match arbitrary whitespace before/after comma

* Run elm make with --yes

* Always add labels to the filter

* Updating filter currently sends Noop msg

For now we are still going to require the user to
explicitly click "filter" before we send an API
request to update the list.
2017-04-08 13:00:21 +02:00
Max Leonard Inden
f50a9ef9db test: Add elm-format + elm-make job to ci
This runs elm-format and elm-make inside a docker container which servs
the Elm environment.

Related to issue #671
2017-04-07 11:19:42 +02:00
Max Inden
eeee29c65b Use vanilla Bootstrap as ui framework (#695)
* Transition NavBar to basic Bootstrap

* Restyle filter bar

* Highlight currently active tab in navbar

* Remove Bootstrap JS plugins
2017-04-05 18:26:39 +02:00
stuart nelson
4288292365 Add CONTRIBUTING.md for front-end code 2017-03-31 17:49:50 +02:00
stuart nelson
3f9494e32d Add correct repository format in elm-package.json 2017-03-31 16:25:56 +02:00
stuart nelson
cc8f3bb866 Update short date format (fixes #670) 2017-03-31 16:25:24 +02:00
Max Inden
78d5030f36 Merge pull request #668 from mxinden/ui-rewrite
Add Elm UI rewrite from github.com/stuartnelson3/am-ui with history to "ui-rewrite" branch
2017-03-29 23:16:00 +02:00
Andrey Kuzmin
bdd65fdfd7
Extract a model for the silence form (#22)
* Extract a model for the silence form

* Use empty in initSilenceForm

* Use plural silences in urls

* Populate matchers from alert

* Updating bindata.go file
2017-03-29 22:13:35 +02:00
Max Leonard Inden
b6243f55e4
Remove front-end specific license
Now that this is being merged it is opperating under the Apache 2.0 of
the Alertmanager project (See LICENSE file in the root directory).
2017-03-29 22:13:25 +02:00
Max Leonard Inden
10d018b7a2
Update repository url specified in elm-package.json 2017-03-27 17:51:43 +02:00
Max Leonard Inden
85ee536937
Merge commit '62c9421f2438bf572663d05ec16d84fecf0d0dcd' into ui-rewrite
Subtree commit from https://github.com/stuartnelson3/am-ui/
2017-03-24 18:21:54 +01:00
stuart nelson
62c9421f24 Parse filter directly in alerts route (#21)
* Parse filter directly in alerts route

* Fix filtering order and updating

* SilencesList parses directly to Filter too
2017-03-24 18:08:59 +01:00
Max Leonard Inden
0faf0f531f
Add Elm UI rewrite from github.com/stuartnelson3/am-ui with history
* Including glue between Alertmanager server and Elm UI.
* Rebuilding assets (ui/bindata.go).
* Exact commit: 'bd78de6b16bcefaacf4229304d439b33aa09cc72'
* Subdirectory: ui/app
2017-03-24 17:48:50 +01:00
Max Leonard Inden
971a6b4660
Remove old alertmanager ui 2017-03-24 16:24:16 +01:00
Conor Broderick
b7bea3df5c Renamed from and message options for VictorOps to monitoring_tool and state_message as per the VictorOps documentation (#667) 2017-03-24 14:06:39 +00:00
stuart nelson
bd78de6b16 Use generic getAlerts api function 2017-03-24 14:14:51 +01:00
Max Inden
af473363ca Rearchitecture (#12)
* Extract update function from Main.elm into Updates.elm

* Refactor Alerts view to use MsgForAlerts instead of Translator

Related to Issue #8

* Prevent decode failure when alert annotation is not present

Previously if one alert wouldn't have an annotation field the entire
decoding of the block would fail, due to the Maybe unwrapping of the
block type (line 46). Now if an alert does not have an annotation field
it just returns an empty list for that alert instead.

Fixes #11

* Move AlertList code to Views/AlertList/.

Related to issue #8

* Move Alert entity related types to Alerts/Types.elm

Related to issue #8

* Refactor Silences view to use MsgForSilences instead of Translator

Related to issue #8

* Move Silences view code to Views/SilenceList

TODO: Split up SilenceList into SilenceList, SilenceEdit, SilenceView,

Related to issue #8
...

* Rename MsgFor{Alerts,Silences} to MsgFor{AlertList,SilenceList}

Related to issue #8

* Seperate SilenceView from SilencesListView

Extracting all SilenceView related code to seperate
Views/Silence/{Views,Types,Parsing,Updates} files.

Related to Issue #8

* Seperate SilenceForm from SilencesListView

Extracting all SilenceForm related code to seperate
Views/SilenceForm/{Views,Types,Parsing,Updates} files.

Related to issue #8

* Flatten route tree

Instead of having sub routes under silences this commit flattens the
route tree and introduces the SilenceListRoute as a top level route.

Related to issue #8

* Run elm-format on entire elm code base

* Introduce NotFoundPage to prevent default case conditions

Having (_ ->) in case declarations is error-prone. This removes them in
the routing code.

* Move Status view code to Views/Status/.

Introduce InitView event to keep logic inside view update function
instead of global update function

Related to issue #8

* Introduce Init*View pattern to SilenceView

Instead of triggering the initialization of the view (loading silences,
loading alerts, ...) inside the global update function, the global
update function just triggers the message Init*View which is picked up
by e.g. the Silence update function which then triggers requesting the
silence.

Related to issue #8

* Remove unused Silences Msg and corresponding update case

* Remove unused Alerts Msg and corresponding update case

* Prevent empty filters to be specified

If the user inputs only a space into the filter textbox it crashes the
request to the server.

* Move NavBar code into Views folder

Additionally making silence available under /silence/<id>.

* Use type variable "msg" instead of concrete type "Msg"

Related to issue #8

* Use import alias on qualified view imports

Related to issue #8

* Rename {edit,new}Form to {new,edit} in SilenceForm.Views

Related to issue #8

* Pass only model.silence and not the entire model down to SilenceForm

Related to issue #8

* Refactor AlertListCompact.views function

Credit goes to @w0rm.

Related to issue #8

* Refactor SilenceBase.view function

Related to issue #8

* Refactor Views.Silence.Updates.update function

Related to issue #8

* Refactor Alerts.Types and global parsing function

Related to issue #8

* Remove accidentally added files
2017-03-23 09:56:34 +01:00
stuart nelson
1dd7ef96a1 Add empty state view for alerts affected by sil 2017-03-20 12:19:32 +01:00
stuart nelson
d229abac97 Silence preview (#7)
* Wip

* Add placeholder preview html

* Show affected alerts on silence show page
2017-03-17 17:14:49 +01:00
stuart nelson
080f850270 Update status on page load 2017-03-17 17:12:14 +01:00
Max Leonard Inden
46012db1ec Approach app structure via MsgFor* instead of translators
Instead of using ForSelf and ForParent, messages are wrapped by a message
per view, like e.g. MsgForStatus. The global update function then hands
each message to its corresponding sub-update function. So the message
"MsgForStatus getStatus" is redirected to the Status.Update.update
function.
2017-03-17 17:06:40 +01:00
Max Leonard Inden
e028dcaaae Add routing to status page 2017-03-17 17:04:06 +01:00
stuart nelson
d725cb01a4 Update silence decoders for empty comment 2017-03-16 13:54:42 +01:00
Andrey Kuzmin
4113d9dec4 Add the duration field 2017-03-16 12:42:18 +01:00
stuart nelson
f3e1985c58 Fix default startsAt time 2017-03-16 12:33:42 +01:00
stuart nelson
476dfa3f59 Update "Filter Alerts" button color 2017-03-16 12:23:06 +01:00
stuart nelson
5cea0efc46 Filter for alertname in silence view 2017-03-16 12:19:54 +01:00