Commit Graph

325 Commits

Author SHA1 Message Date
Max Leonard Inden b3bb5dca80
Rework SilenceForm
* Restyle SilenceForm view
* Add validation to SilenceForm
* Redirect to new silence when editing expired one
2017-05-19 14:14:35 +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
stuart nelson a0e6aceadb Merge GroupBy alerts (#775)
* Create set of labelKeys

* Wip (compiling)

* Add naive levenshtein distance

Need to check out the fzf fuzzy algo, this is just
a place holder for now.

https://github.com/junegunn/fzf/blob/master/src/algo/algo.go

* Hack a groupBy into the code

This needs massive cleanup and is just a
late-night spike. Everything in this commit needs
to be re-organized, most likely.

* Update some html/css

* Set input validation for label filtering

* Add Jaro-Winkler string comparison

* remove levenshtein stuff

* Fix match tests

* Read actual Jaro definition

if ml == 0, then the distance == 0

* Use correct searchLength implementation

* Limit searching string to matchRange

Only search matchRange when looking for matches,
instead of going through every value and then
deciding if it should be checked based on its
position.

Data generated from
https://ellie-app.com/38cXFnRLjcga1/1

matchCharmatchChar2delta

mean ops/sec
346,928.55 (stddev: 12,306.94, 3.55%)
364,551.61 (stddev: 10,561.94, 2.9%) +5.08%

mean runtime
2.886ns (stddev: 103.748µs, 3.59%)
2.745ns (stddev: 80.856µs, 2.95%) -4.87%

total runtime
5.022s
5.052s

sampling
48 runs of 30,000 calls
46 runs of 40,000 calls

* Fix off-by-one error in List slicing

* Simplify transition calculation

* Keyboard controls for the autocomplete

* Fix clicking on the results

* Rename AutoComplete to GroupBar

* Broke apart the view function

* Fix the layout

* Change button style

* Synchronize grouping with URL

* Fix tests

* Added toggle silenced alerts

* Remove comment

* Roll back the labelButton

* Always fetch the alerts

* Disable show silenced

* Extract alert groups

* Rename tests

* Use more generic number instead of int

* Restore showSilenced

* Update ui/bindata.go

* Update template/internal/deftmpl/bindata.go

* Update bindata.go

* Reformat with updated elm-format
2017-05-16 00:10:30 +02:00
Max Leonard Inden 3117e69239
Restyle SilenceList view and group by state 2017-05-11 11:30:36 +02:00
Max Inden 6784e300cf Merge pull request #772 from prometheus/cache-control
Update cache control for web assets
2017-05-09 15:17:29 +02:00
stuart nelson 91e802c4f3 Extract Alert Filter Bar (#755)
* Extract Alert Filter Bar

* Add FilterBar to silenceList page

* Prevent empty key= in query string
2017-05-08 10:42:42 +02:00
Max Leonard Inden 9cc00323ca
Update cache control for web assets
The commit [1] introduced the `cache-control` header field with the value
`no-cache`. This enforces any cache to revalidate. Apparently this does
not prohibit *FireFox* from caching the assets. `no-cache, no-store,
must-revalidate` does by prohibiting to even save anything of the
request.

[1] c3850708c1
2017-05-05 09:30:09 +02:00
Max Leonard Inden 30c62c2f9f
Switch to /alerts endpoint and restlye alerts list page
Instead of using the /alerts/groups endpoint to retriev alerts this
commit introduces usage of the /alerts endpoint. This bypasses a lot of
complexity by ignoring alert groups and alert blocks. Groups and blocks
are left as a pure back-end detail.

Fixes #694
2017-05-02 09:46:20 +02:00
Max Leonard Inden a5a53c46f7
Display more information on status page 2017-05-02 09:18:36 +02:00
Max Leonard Inden 9ec25d84c5
test: Introduce elm-test package
Adding two basic (fuzz-) tests for Utils.Filter.parseMatcher. Including
tests in Travis runs. Adding make target "test" and "dev-server".
2017-04-25 12:03:02 +02:00
Max Leonard Inden fae4c81286
Update template/internal/deftmpl/bindata.go & ui/bindata.go
Additionaly linting AlertList/Types.elm
2017-04-25 11:39:57 +02:00
Max Leonard Inden f3a3be8191 Update template/internal/deftmpl/bindata.go & ui/bindata.go
Additionaly linting AlertList/Types.elm
2017-04-25 11:34:31 +02:00
Max Leonard Inden a8d7f92c66 test: Ensure bindata.go is always up to date
This adds three more steps to the Travis tests.
1. Compile Elm -> script.js
2. Bundle html.index & script.js -> bindata.go
3. Check if bindata.go hasn't changed
2017-04-25 11:33:57 +02:00
stuart nelson d58e81db46 Generate assets 2017-04-25 10:36:48 +02:00
stuart nelson 06a37d66e2 Remove unused MatchOperator import 2017-04-24 14:59:58 +02:00
stuart nelson 2ae96e845d Add the fns for all match op types
They aren't use, but we might as well be correct.
2017-04-24 14:56:54 +02:00
stuart nelson b29afb80a2 Receiver key is always an anchored regex match 2017-04-24 14:54:25 +02:00
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
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
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
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
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
Harmen be74c8442c make assets format 2017-01-03 19:44:04 +01:00
Harmen 0a3fed86ae add a favicon 2017-01-03 19:41:34 +01: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
Fabian Reinartz b6851a5421 silences: fix concurrent cache writes (#561)
This fixes #559 by removing concurrent map writes to the matcher cache.
The cache was guarded by the Silence's main lock, which only used a
read-lock on queries.
The cache's get methods lazily loads data into the cache and thus
causing concurrent writes.

We just change the main lock to always write-lock, as we don't expect
high lock contention at this point and would have it in a dedicated
cache lock anyway.
2016-11-21 11:09:49 +01:00
stuart nelson 7078d18457 Regenerate static assets 2016-10-27 13:37:14 +02:00
stuart nelson 3ea0439a90 Missing semi-colon 2016-10-27 13:36:52 +02:00
stuart nelson 6bc77a1a14 Correctly render continue routing
Nodes with `continue: true` were being ignored,
and only the first match in the routing tree was
being highlighted.

Additionally, each node was incorrectly being set
to continue=true if nothing is received from the
API. The API sends nothing if continue=false.
2016-10-27 13:36:41 +02:00
tattsun 9396976771 [ui] Save creator's e-mail address to in browser storage 2016-09-19 16:47:31 +02:00
Fabian Reinartz 2c6454b370 Merge pull request #454 from prometheus/fabxc-restruct2
*: restructure package tree
2016-08-09 15:20:23 +02:00
Fabian Reinartz b822fe58b6 Merge branch 'slack_enhance' of https://github.com/dmclain/alertmanager into dmclain-slack_enhance 2016-08-09 14:46:39 +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
Fabian Reinartz 2098be4f93 ui: handle silence edit modes
This change makes actions around silences in different stages more
clear. Changes that are not allowed to be in-place are handled by
creating a new silence and deleting/expiring the old one behind the
scenes.
2016-08-09 12:01:31 +02:00
Fabian Reinartz 1e5babd843 ui: split silences into pending/elapsed/active 2016-08-09 12:01:14 +02:00
Fabian Reinartz a840fae9de ui: don't delete old silence on modification 2016-08-09 12:00:52 +02:00
Matt Bostock 16d8afd5a8 Hide groups if all alerts within are silenced
Currently, even if all alerts within a group are silenced, the group
summary still appears. This can take up a lot of space when many alerts
are silenced.

If all alerts in a group are silenced and 'Hide silences' is checked,
hide the empty group.

bindata was updated by running:

    make assets format
2016-07-28 13:28:12 +01:00
Djordje Atlialp 8e0f405e67 Add VictorOps Notifier
Add default VictorOpsAPIURL

Add VictorOps default config

Add VictorOpsConfig struct in notifiers

Add new template tags for victorops

Add notifications logic for victorops

Compiled template tags with make assets

Remove common labels from entity_id template

Set messageType default value to CRITICAL

Recovery messageType is not configurable anymore. Firing state only allows specific keys

Make assets

Using log.Debugf

EntityID should not be configureable

Remove entity_id from template

Use GroupKey(ctx) as entity_id

Improve debug logging

Fix type of entity_id
2016-07-27 00:49:05 +02:00
Tristan Colgate de2252911e OpsGenie Notifier, fixes and additions:
- OpsGenie notifier confused the description and message fields
- Also added the notes field.
2016-07-12 16:20:23 +01:00
Fabian Reinartz cc5aab6cff provider/boltmem: add alert subscription.
This commit implements the Subscribe() and GetPending()
methods for the bolt based alert provider.
2016-05-03 12:46:34 +02:00
Max Chadwick c3198633d7 Filter silenced alerts 2016-04-27 22:53:44 -04:00
Fabian Reinartz 7a14971042 Merge pull request #294 from ben51/master
Change fallback fonts to something readable
2016-04-18 11:42:52 +02:00
Fabian Reinartz f33c1bedb4 Hide PushOver auth information 2016-04-12 10:14:22 +02:00
stuart nelson 84acd309a6 Add routing-tree visualization (#302) 2016-04-11 16:39:57 +02:00
Benjamin Villain c94c1ed464 Change fallback fonts to something readable
Change-Id: I5f5ce8c7113b2188083ef0ec9ef2bcc4d74f5500
2016-04-07 14:14:38 +02:00
Julius Volz 20739cc6ad Re-add full -web.external-url functionality
Fixes https://github.com/prometheus/alertmanager/issues/212
2016-03-30 23:04:19 +02:00
Fabian Reinartz a0e4df20ef Add reload config instrumentation 2016-03-03 14:20:21 +01:00
Fabian Reinartz 124d637de0 Include generatorURL in PD and emails 2016-02-16 16:42:22 +01:00
Fabian Reinartz 3fba247d7c Run `make assets` for template changes 2016-02-16 12:28:16 +01:00
Fabian Reinartz 6e82fdd419 Fix vetting errors 2016-02-15 11:57:16 +01:00
Fabian Reinartz 9d8d386758 Add generatorURL to UI 2016-02-09 14:46:18 +01:00
Fabian Reinartz e0f67dbca5 Invert navigation active/inactive color 2015-12-18 12:05:31 +01:00
Fabian Reinartz fbd81f325b Use double quotes for label values in UI 2015-12-17 11:35:33 +01:00
Fabian Reinartz 5997b89ea2 Improve silence form validation 2015-12-16 16:40:10 +01:00
Fabian Reinartz e29c7ab2b4 Increase highlighted silence visibility 2015-12-16 14:52:12 +01:00
Fabian Reinartz 625fc42658 Preserve activity interval on silence edit 2015-12-16 14:42:38 +01:00
Fabian Reinartz 002c9ca793 Add better mail template 2015-12-09 11:49:22 +01:00
Fabian Reinartz 7581d974ff Hide secret configuration data 2015-12-03 12:46:28 +01:00
Fabian Reinartz 1629e9d166 Statically compile default templates 2015-12-01 18:39:57 +01:00
Fabian Reinartz 12585e91c0 Sync alert filtering with URL.
This commit keeps the alert filters synchronized with URL search parameters
so they can be shared.
2015-11-25 12:43:40 +01:00
beorn7 93ffa534a5 PR with changes after code review
Now to be reverse-reveiewed.
2015-11-23 18:24:57 +01:00
Fabian Reinartz 7b6b971518 Recompile bindata 2015-11-19 08:53:53 +01:00
Brian Brazil faa88831f4 First-pass at improving template system.
- Cut back to bare minimum to make the rest simpler
- Consistency in config naming
- Have one data strucutre that's the same for all templates
- Pass in common labels to templates
- Support templates almost everywhere
- Support multiple SMTP recipients
- Support non-ASCII SMTP headers
- Handle colour logic via templates
- Make $subjects have consistent output, go maps aren't sorted.
- Make tests pass when v6 is disabled
2015-11-18 14:59:05 +00:00
Fabian Reinartz 5770d3ec60 Make silences editable in UI 2015-11-16 21:45:28 +01:00
Fabian Reinartz c5d77252e6 Improve button visibility in UI 2015-11-16 14:47:03 +01:00
Fabian Reinartz d80fd26902 Add Dockerfile and target, change flag 2015-11-12 15:03:09 +01:00
Fabian Reinartz 16bc5356aa Vendor static assets 2015-11-11 18:03:56 +01:00
Fabian Reinartz d945c872d8 Style fix, remove debug prints 2015-11-11 17:53:18 +01:00
Fabian Reinartz 034ab0da0c Statically compile assets into binary 2015-11-11 15:34:36 +01:00
Fabian Reinartz f188f3357d Format alert filtering section 2015-11-11 13:33:33 +01:00
Fabian Reinartz f1a6f8892f Make collapsible detail sections more visible 2015-11-10 14:55:57 +01:00
Fabian Reinartz ede4b63a91 Implement deterministic alert group order, cleanup 2015-11-10 14:52:04 +01:00
Fabian Reinartz e4e594d826 Unify receiver naming 2015-11-10 13:47:04 +01:00
Fabian Reinartz 91db91ef4a Separate elapsed and active silences 2015-11-10 11:19:04 +01:00
Fabian Reinartz 3cdc3c5359 Add HTML title 2015-11-09 19:08:40 +01:00
Fabian Reinartz 9e7255a850 Vendor angular-sanitize 2015-11-09 18:30:51 +01:00
Fabian Reinartz f915a61d16 Filter entire groups of non-selected destionations 2015-11-09 16:42:52 +01:00
Fabian Reinartz fa64b7d1b9 link and highlight silence in UI 2015-11-09 15:30:02 +01:00
Fabian Reinartz 5f46042dd5 Add toggling for silence form 2015-11-09 15:19:22 +01:00
Fabian Reinartz 83c4d596bc mark inhibition and silencing in UI 2015-11-09 14:41:06 +01:00
Fabian Reinartz b2351ef76c Auto-convert links in annotations 2015-11-09 13:32:41 +01:00
Fabian Reinartz 1918379668 Remove dead code, make silence immutable 2015-11-09 12:34:31 +01:00
Fabian Reinartz 09bcb8c71a More readable styling 2015-11-09 12:33:14 +01:00
Fabian Reinartz 5b3621948b Show firing duration 2015-11-09 12:03:36 +01:00
Fabian Reinartz 152df94088 Simplify alert UI 2015-11-09 11:09:32 +01:00
Fabian Reinartz 23b8cde4b6 Switch routing tree to flat alerting groups 2015-11-07 14:29:54 +01:00
Fabian Reinartz 73e6fcfbcd Toggle details by click to reduce noise 2015-11-06 18:17:41 +01:00
Fabian Reinartz 7be65952e3 UI silencing on alert items fixed 2015-11-06 17:35:37 +01:00
Fabian Reinartz a3dc8fb36e Adjust alert UI to silence UI 2015-11-06 17:26:06 +01:00
Fabian Reinartz 896449efac Improve silence UI 2015-11-06 17:07:55 +01:00
Fabian Reinartz 8f937a3d05 Move silence to own partial, style fixes 2015-11-06 15:27:28 +01:00
Fabian Reinartz 8b327b1d8e Improve silence form 2015-11-06 14:14:46 +01:00
Fabian Reinartz e681d8619d Remove bass.css 2015-11-06 14:14:11 +01:00
Fabian Reinartz 6f0d441e39 Fix unlocked write and unnecessary condition 2015-11-04 17:17:37 +01:00
Fabian Reinartz 08948391df Add uptime to status page 2015-11-02 20:04:37 +01:00
Fabian Reinartz 09e8552cd7 Add status page in UI 2015-11-02 19:47:12 +01:00
Fabian Reinartz 85475d4e50 Add /api/status endpoint for config and version info 2015-11-02 19:41:23 +01:00
Fabian Reinartz a1a9840656 Minor enhancement to silence form 2015-11-02 18:51:54 +01:00
Fabian Reinartz f4a31855cc Add silence-form directive, enable silence button for alerts 2015-10-27 19:54:21 +01:00
Fabian Reinartz 3d216d887b Add README on status and installation 2015-10-22 14:56:55 +02:00
Fabian Reinartz f6461b0182 Emphasize alertname label in UI 2015-10-22 11:10:59 +02:00
Fabian Reinartz 9f8c959d4d Make annotations collapsable in UI 2015-10-22 10:56:37 +02:00
Fabian Reinartz a4333564a0 Improve UI tree JSON, style UI tree 2015-10-22 09:49:16 +02:00
Fabian Reinartz e151f029b7 Add initial UI for recursive routing tree 2015-10-21 16:34:38 +02:00
Fabian Reinartz d365519ed3 Temporary fix for getting pending alerts 2015-10-20 12:38:42 +02:00
Fabian Reinartz 329b36594b (u)int64 fixes, UI time range improvements 2015-10-20 07:12:28 +02:00
Fabian Reinartz aead14a99f Implement initial PagerDuty notifications 2015-10-19 13:36:17 +02:00
Fabian Reinartz 494de8228c Add alert view to UI 2015-10-15 16:24:27 +02:00
Fabian Reinartz 26222c3b50 Add CSS library and custom definitions 2015-10-15 16:24:02 +02:00
Fabian Reinartz e48ec3a339 Complete silence UI 2015-10-15 12:01:19 +02:00
Fabian Reinartz 3917620c24 Implement multiple matchers in Silence creation 2015-10-13 16:59:37 +02:00
Fabian Reinartz 433c7008b4 Improve silence datetime display. 2015-10-12 22:36:56 +02:00
Fabian Reinartz 3e213ddb3d Add listing and creation of silences 2015-10-12 22:22:21 +02:00
Fabian Reinartz 942a4f91ed Initial layout for angular.js UI 2015-10-12 17:08:07 +02:00