* Wait for the gossip to settle before sending notifications
See #1209 for details.
As an heuristic for mesh readyness, try to see if
the mesh looks stable (the number of peers isn't changing too much).
This implementation always mark the altermanager as ready after a maximum of 60s.
This adds one new flags to control this behavior:
```
--cluster.settle-timeout=60s mesh settling timeout. Do not wait more than this duration on startup.
```
It also adds `/-/ready` which always return 200 (in order to make it clear
that we are ready as soon as we can receive requests).
The mesh status is exposed in `/api/v1/status` and visible on `/#/status`.
* cluster: fix typos and base interval on gossipInterval
* wire default creator through Elm
* wire defaultCreator into localStorage
* add ui/bindata.go
* fix indentation
* change defaultCreator type from (Maybe String) to String
use an empty string as default value
* update ui/bindata.go
* Inconsistent use of baseUrl and apiUrl arguments
Both are Strings, so flipping the order between
one invocation and another didn't raise any
argument from the compiler. The baseUrl argument
is actually unnecessary, and has been removed.
* Update bindata.go
* 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
* Test for consecutive chars throughout string
Previously, we were only testing for consecutive
characters at the beginning of the string. Now,
the entire string being compared is searched
through for a matching character, and then the
consecutive search starts.
We were seeing weird situations where the text
entered matched the last half of certain terms,
but because it wasn't, but because we only
searched from the start, results that probably
shouldn't have been the top suggestion were being
suggested too high on the list.
* Weight consecutive matches more highly
Bit of a guess, this seemed to give better results
for my small test case.
* bindata
We generate binaries whenever `make build-all` is run. If they already
exist, we only regenerate them if they are outdated.
When one makes changes to the front-end and runs the single command
`make build-all` on the root level Makefile, the front-end is rebuild
accordingly.
`make build-all` will use Docker to build the front-end. If someone prefers
to install all the dev dependencies on their local machine instead, one
can add the `NO_DOCKER=true` flag.
For folks that only want to make back-end changes `ui/bindata.go` is
checked in, so they do not have to build the front-end. They still use
the `make build` command as before.
When clicking on a label on the AlertList or SilenceList view, the
changed Alert/Silence query is appended to the current url. This Postfix
should not start with a slash. If it does, the url is not appended but
replaced by the browser instead resulting in a `pushState` exception.
Infer path from Navigation.Location
Build uses template, local dev uses elm-reactor
Remove unneeded local dev go server
Add script.js make target
Compiles and uglifies script.js
Before:
~570kb
After:
~170kb
Bootstrap loading state
Add trailing slash via JS & add routePrefix console param
Add Javascript script tag to `index.html` which adds a trailing slash to
the url pathname if none is present. This is done to ensure assets like
`script.js` are loaded properly.
Example without patch:
If the pathname is "mxinden.com/alertmanager" the browser will try to
download the `script.js` asset from "mxinden.com/script.js". This
request will fail.
Example with patch:
If the pathname is "mxinden.com/alertmanager", Javascript redirects the
browser to "mxinden.com/alertmanager/" and then the `script.js` asset
will be downloaded from "mxinden.com/alertmanager/script.js". This
request will succeed.
Add `-web.route-prefix` as a console parameter. This configures a
Prefix for the internal routes of web endpoints. Defaults to path of
-web.external-url like in *Prometheus*.
Trim slashes off of route prefix and add one slash at the beginning.
Make sure route prefix is not empty or just a slash before prefixing
router.
* Restructure the validation
* Validate on blur
* Extract alerts from the silence
* Use string for the error type
* Use ApiData everywhere
* Validate the form
* Remove redirect on failure
* Code review fixes
* Hide the delete button if there is one matcher
* Rename silence2
* Update bindata.go
* Fix the tests
* Actually hide the delete button
* Update bindata.go
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