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.
* 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
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
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
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
* 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
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".
* 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.
* Extract a model for the silence form
* Use empty in initSilenceForm
* Use plural silences in urls
* Populate matchers from alert
* Updating bindata.go file
* Including glue between Alertmanager server and Elm UI.
* Rebuilding assets (ui/bindata.go).
* Exact commit: 'bd78de6b16bcefaacf4229304d439b33aa09cc72'
* Subdirectory: ui/app
* 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
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.
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.
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.
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
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
- 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