Commit Graph

325 Commits

Author SHA1 Message Date
masataka c5d41bb68e Grouping label's expand button with grouping id (#2012)
* Expand button with id

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* fixed indexedMap

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* rebuild

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
2019-08-29 09:33:24 +02:00
masataka c1040d5d74 Recreate silence with previous comment. (#1927)
* Recreate silence with previous comment.

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* implement newSilenceFromMatchersAndComment

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* Trigger

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
2019-08-27 12:03:57 +02:00
masataka b33a9366dd Textarea with auto resize in UI (#1893)
* textarea with auto resize

Signed-off-by: mizukoshi-m <mizukoshi@mfeed.ad.jp>

* implement resize textarea on type

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* remove scrollHeight

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* Add new function for textarea field

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* remove unnecessary code

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
2019-06-12 08:54:16 +02:00
masataka e33edd6f13 Create Silence from filter Bar (#1911)
* Create Silence from filters

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>

* Get rid of unnecessary things

Signed-off-by: m-masataka <m.mizukoshi.wakuwaku@gmail.com>
2019-06-05 19:01:56 +02:00
Stuart Nelson d7000fc984 Merge branch 'master' into stn/collapse-alert-groups 2019-05-13 10:03:27 +02:00
Andrey Kuzmin 658dd3a29f Properly serialize boolean
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
2019-05-11 20:28:33 +02:00
Andrey Kuzmin 20c336fe22 Adjust the styling
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
2019-05-11 20:28:33 +02:00
Will Hegedus 5a5133af7e update Tests to account for "active" param
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
2019-05-10 09:57:27 -04:00
Will Hegedus 96a33e1bc6 Add filtering based off "active" query param
Signed-off-by: Will Hegedus <wbhegedus@liberty.edu>
2019-05-08 12:05:18 -04:00
stuart nelson 1abb1fb9bb Persist alert group expansion in local storage
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-05-07 16:08:32 +02:00
stuart nelson f46adfe46a Support expanding multiple groups
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-05-07 16:08:29 +02:00
stuart nelson 072365a44e Show alert count behind group
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-05-07 16:08:26 +02:00
stuart nelson 7e0862f67c When only one alert group is present, always expand it
Can't think of a reason to hide the alerts if
there's only a single group.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-05-07 16:08:22 +02:00
stuart nelson 759bf7b6b6 Parse alert list into alert groups when received from API
We can simplify the view flow by parsing the list
of alerts for custom grouping as soon as they are
returned to the update function.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-05-07 16:08:05 +02:00
stuart nelson b4fb8a28ef Collapse alert groups when initially viewing ui
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-05-03 16:15:07 +02:00
James Ritchie a6bdc73fa4 added icon to show inhibited status
Signed-off-by: James Ritchie <james.g.ritchie@baesystems.com>
2019-05-01 08:22:41 +00:00
stuart nelson 0a7e227549 Merge branch 'master' into default-grouping-in-ui
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-04-30 15:09:56 +02:00
stuart nelson 1f41731881 Correctly construct filter query string for api
Updating the api in
bc373f562f
resulted in the UI sending query strings for the
filter that no longer match what the backend
expects. This brings that in to line.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-04-29 16:50:56 +02:00
Andrey Kuzmin eb8345e72f Update tests
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
2019-04-27 12:31:48 +02:00
Andrey Kuzmin 9ddadb8c77 Support default grouping
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
2019-04-27 12:14:31 +02:00
Andrey Kuzmin 1df9de3f28 Introduce a helper to render apiData
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
2019-04-27 12:14:31 +02:00
Andrey Kuzmin 91d29725e0 Remove unused filter argument
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
2019-04-27 12:14:31 +02:00
Andrey Kuzmin 26f3e4ef44 Generate AlertGroup decoders
Signed-off-by: Andrey Kuzmin <andrey.kuzmin@soundcloud.com>
2019-04-27 12:14:31 +02:00
Max Leonard Inden b1f05ce988
ui/web: Set HTTP headers to prevent asset caching
This patch adds HTTP headers to each web asset response, disabling
caching for the payload. This prevents users running an old version of
the UI against a new version of Alertmanager once they updated. On the
down-side it increases page load size on subsequent page loads.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2019-03-29 09:33:20 +01:00
Paul Gier c834a991c6 set ELM_HOME for the elm-env container
The ELM_HOME variable needs to be set to the mounted volume
directory when building to prevent permissions errors caused
by using root as the default home dir.

Signed-off-by: Paul Gier <pgier@redhat.com>
2019-03-11 10:45:45 -05:00
Paul Gier 458f1d646b Makefile improvements
- make clean shouldn't print errors when files/directories have already
been removed
- add copyright header to generated api files to pass license check

Signed-off-by: Paul Gier <pgier@redhat.com>
2019-03-11 10:45:45 -05:00
Simon Pasquier bc373f562f *: fix filter parameters with comma
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-03-08 09:56:05 +01:00
beorn7 f2345d7c8e Make the silence preview show also muted alerts
Even if an alert is already silenced and/or muted, I still want to
know that my newly created silence will affect it.

Signed-off-by: beorn7 <beorn@soundcloud.com>
2019-03-01 14:15:53 +01:00
Nguyen Quang Huy edf170d03b Add signed off to commit (#1766)
- Fix error string should not be capitalized from [Golang coding convention](https://github.com/golang/go/wiki/CodeReviewComments#error-strings)
- Fix some typos

Signed-off-by: Nguyen Quang Huy <huynq0911@gmail.com>
2019-02-25 11:04:42 +01:00
Max Leonard Inden 8e157b3af5
api/v2: Make cluster status peers and name optional
If a users chooses to disable the Alertmanager cluster feature, there is
no cluster name nor cluster peers. Hence these should be optional. Only
cluster status is set to "disabled".

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2019-02-04 11:40:30 +01:00
Max Leonard Inden 2f055d9966
api/v2: Do not populate cluster info if clustering is disabled
When users start Alertmanager with `--cluster.listen-address=`, the
cluster will not be initialized, hence api.peer will be `nil`. So far
this would result in a nil pointer dereference by the API v2 accessing
the api.peer field.

With this patch, api v2 skips populating the peers array, sets the name
to an empty string and the status to "disabled" in case `api.peer` is
nil.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2019-01-31 16:56:59 +01:00
stuart nelson dba283edd0
respect regex matchers when recreating silences (#1697)
* Respect regexes when recreating silences
* Generate assets

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-01-09 10:33:43 +01:00
stuart nelson b437240bd9
Stn/update alert compact view (#1698)
* Remove inhibited/silenced text

In the alert list, this is already seen via the
icons. In the silence preview, since it's in the
silence preview, clearly it's affected by the
silence.

* Generate assets

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2019-01-08 16:26:12 +01:00
Max Leonard Inden 2b697aaa6b
api/v2: Extract shared properties of gettable and postable alert
With issue 1465 on openapi-generator [1] being fixed, we can not extract
shared properties of the gettable and postable alert definition into a
shared object (`alert`) like we do for silence, gettable silence and
postable silence.

In addition this patch does the following changes to the UI:

- Use `List GettableAlert` instead of plural type definition like
`GettableAlerts` because the plural definitions are not generated.

- Fix openapi-generator-cli docker image to specific hash.

[1] https://github.com/OpenAPITools/openapi-generator/issues/1465

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-28 14:35:39 +01:00
Max Inden 218b8fb1f4 ui: Pass parameterized api url down to status logic (#1637)
Previously the api url was hardcoded in the elm logic fetching the
status of an Alertmanager. Instead it is now being passed down like we
already did for /alerts, /silences and /receivers.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-27 15:33:19 +01:00
Max Leonard Inden f504f953c1
ui: Move /alerts to API v2
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-23 12:53:48 +01:00
Max Leonard Inden 8c19b96bd6
Revert "ui: Patch /alerts and /receivers to use api v1"
This reverts commit fb86df6add.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-21 17:10:17 +01:00
Max Leonard Inden b4b8b750df
api/v2/openapi.yaml: Differentiate between post and get silence
Instead of having one general silence, differentiate between postable
and gettable silence, hence making more fields required.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-15 16:21:07 +01:00
Max Leonard Inden fb86df6add
ui: Patch /alerts and /receivers to use api v1
With the previous patch /status and /silences were requested from api
v2. Requesting alerts from api v1 is done in a separate commit to be
able to revert it once alerts also come from api v2.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-15 13:25:41 +01:00
Max Leonard Inden e4e053b18e
ui: Move /status & /silences to API v2
This patch makes the Alertmanager UI (/status & /silences) use the
api/v2 endpoint. In addition it adds logic to generate the elm side data
model based on the OpenAPI specification.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-11-15 13:24:26 +01:00
stuart nelson 72e6720bea
Fixes #1615 (#1620)
Support `w` duration when making silences. Remove
`y` as a supported duration, silences are for
short term notification prevention.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-11-13 15:08:37 +01:00
stuart nelson 625604df90
Show more alert information on silence form/ silence view pages (#1601)
* Display same alert info as available in alert list

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-11-07 17:08:22 +01:00
Simon Pasquier 3558e6fd9e Migrate from go-bindata to vfsgen (#1532)
* Migrate from go-bindata to vfsgen

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Ensure idempotent generation for vfsgen

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* asset: update generated files

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Fix asset paths for Windows platforms

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Regenerate assets

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Add vfs wrapper that returns constant mod time

This is identical to what we had with go-bindata and avoids the extra
step of storing the identity of the complete file system in another
location.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Additional cleanup

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-09-24 15:12:40 +02:00
stuart nelson 6f1118ab46
fix silence redirect (#1548)
* Use a button instead of a for buttons

Using <a> was causing an unintended redirect to
the root. It appears this behavior has changed in
0.19.

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>

* bindata

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-09-13 15:02:24 +02:00
Andrey Kuzmin e768371a39
Upgrade Alertmanager UI to Elm 0.19 (#1539)
* Run elm-upgrade
* Make compile
* Update index.html
* Upgrade tests
* Finalize the upgrade
* Optimize!
2018-09-06 18:08:51 +02:00
Harsh Agarwal 049663b2c8 Help tab (#1522)
* add helpTab in navbar

Signed-off-by: Harsh Agarwal <cs15btech11019@iith.ac.in>

* add updated bindata.go

Signed-off-by: Harsh Agarwal <cs15btech11019@iith.ac.in>
2018-08-16 00:20:29 +02:00
Simon Pasquier 0c512998ee Use Makefile.common from Prometheus (#1396)
* Include Makefile.common
* Fix the bindata.go files to make the style target happy
* Inline `.PHONY` statements

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-06-13 14:41:52 +02:00
Simon Pasquier b95b32821f ui: replace deprecated InstrumentHandler() (#1302)
This change replaces the deprecated InstrumentHandler function by
the equivalent functions from the promhttp package.

The following metrics are removed:

* http_request_duration_microseconds (Summary).
* http_request_size_bytes (Summary).
* http_requests_total (Counter).

And the following metrics are added instead:

* alertmanager_http_request_duration_seconds (Histogram).
* alertmanager_http_response_size_bytes (Histogram).
* promhttp_metric_handler_requests_in_flight (Gauge).
* promhttp_metric_handler_requests_total (Counter).
2018-03-28 15:28:38 +02:00
Stuart Nelson 85caf29316 Cleanup frontend makefile 2018-03-20 11:54:44 +01:00
Stuart Nelson 5ddf0444c4 Update bindata 2018-03-20 10:48:12 +01:00
Stuart Nelson c300cd9f8d Remove non-empty string validation in frontend 2018-03-20 10:46:03 +01:00
Andrey Kuzmin 1413927c3f Update bindata.go 2018-03-16 11:27:08 +01:00
Andrey Kuzmin 1c9034282c Allow empty matchers 2018-03-16 11:19:57 +01:00
Corentin Chary dd75201f1c Add /-/ready based on mesh status (#1209)
* 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
2018-03-02 15:45:21 +01:00
stuart nelson 2ecd4d6c3c
Prepopulate matchers when recreating a silence (#1270)
* Fix #1268

Pre-populate matches list when recreating expired
silences.

* Update bindata
2018-03-02 10:59:50 +01:00
Stuart Nelson a552afd998 Merge branch 'master' into memberlist 2018-02-13 10:47:17 +01:00
Stuart Nelson 46c6b3f2f1 Update frontend 2018-02-12 11:13:27 +01:00
Andrey Kuzmin 5101d65938 Fix the slowness of the Silence UI (#1235)
* Cache tabs and fix slow css

* update bindata
2018-02-09 10:42:44 +01:00
stuart nelson 3c61fe3fef
Return reload status from http endpoint (#1152) (#1180)
* Return reload status from http endpoint (#1152)

* Use same reload messaging as prometheus
2018-01-08 11:51:05 +01:00
Frederic Branczyk 0b5af7510b
Merge pull request #1159 from simonpasquier/add-healthy-probes
Add /-/healthy endpoint
2018-01-08 11:25:16 +01:00
Conor Broderick a1153e83ff
Merge pull request #1167 from prometheus/fix-error-message
Fix error message
2018-01-03 11:10:39 +00:00
Christian Hoffmann 0e63715b23 UI: Fix JavaScript error in MSIE due to endswith() usage (#1172)
* index: avoid endswith() for MSIE compatibility

MSIE does not support endswith() [1]. substr() can
be used to work around this limitation.

[1] https://docs.microsoft.com/en-us/scripting/javascript/reference/endswith-method-string-javascript

* index: clean up comment

* ui: update bindata
2018-01-02 14:25:54 +01:00
Andrey Kuzmin b8d20dffca Update bindata.go 2018-01-02 12:46:24 +01:00
Andrey Kuzmin 1ccc7b1133 Dont output malformed error body 2018-01-02 12:45:36 +01:00
Andrey Kuzmin 6f8ccb031c
Fix expire buttons on the silences page (#1171)
* Only show confirmation for the specific silence

* Update bindata.go
2018-01-02 12:25:34 +01:00
pasquier-s 364979bbf8 Display connections in the Status page (#1164)
This change shows the status of the local connections in the web UI. It
can be used to troubleshoot mesh issues.
2017-12-22 11:39:27 +01:00
Simon Pasquier e8661f5768 Add /-/healthy endpoint 2017-12-21 12:29:38 +01:00
Andrey Kuzmin 6fa697ae17 Populate the silence form from location (#1148)
* Populate new silence form from location

* Update bindata.go
2017-12-18 10:18:12 +01:00
Andrey Kuzmin 50394569f5 Fix negative duration (#1132)
* Validate ends at

* Update bindata.go
2017-12-14 16:16:42 +01:00
Andrey Kuzmin f9e96fce3d
Use elm reactor for dev assets (#1133)
* Serve assets from elm reactor

* Update bindata.go
2017-12-10 21:59:15 +01:00
Christopher Taylor af63c85161 Let the browser remember the creator of a silence (#1112)
* 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
2017-12-08 12:54:44 +01:00
Julius Volz fdee5fcbfc Fix UI when no silences are present (#1090)
* Explicitly initialize silences list to avoid "null" JSON

* Wrap "No silences found" message in error box

* bindata fixup
2017-11-11 14:48:48 +01:00
Andrey Kuzmin 0fa852217b Toggle silenced and inhibited alerts (#1049)
* Add inhibited checkbox

* Update ui/bindata.go
2017-10-23 11:00:17 +02:00
Julius Volz 947970af44 Convert Alertmanager to use non-global go-kit loggers
Fixes https://github.com/prometheus/alertmanager/issues/1040
2017-10-22 00:20:40 -07:00
Jose Donizetti 0508348fd0 Allow selectable matchers on silence view (#1030) 2017-10-07 12:54:30 +02:00
stuart nelson a7981e4693 Inconsistent use of baseUrl and apiUrl arguments (#1008)
* 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
2017-09-29 14:16:03 +02:00
conorbroderick 5597a76ad4 Added confirmation dialog when expiring silences 2017-09-14 16:41:55 +01:00
conorbroderick 20e19e372c Show total no. of silenced alerts in prev 2017-09-14 14:44:27 +01:00
stuart nelson cb9c9466d9 Stn/edit on silence view page (#970)
* Edit/recreate/destroy silence on view page

* Share stuff from SilenceList

* Update bindata

* Remove unused variable

* Update bindata

* Update silence style

* Update bindata
2017-09-05 11:01:46 +02:00
stuart nelson d33511cb36 macOS requires the template to be at the end (#971)
* macOS requires the template to be at the end

* Update makefile to use .js extension

* see if this works..
2017-09-02 20:19:11 +02:00
Andrey Kuzmin 250bd35c97 Linkify alert annotations (#946)
* Make links in annotations clickable

* Update test script and bindata.go

* Add target = _blank
2017-08-13 19:48:36 +02:00
Andrey Kuzmin 7de7cf38f9 Selectable labels (#932)
* Make the labels selectable

* Update bindata.go
2017-07-31 13:22:30 +02:00
stuart nelson 040b1f9e53 Stn/status page ohne mesh (#920)
* 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
2017-07-22 12:30:19 +02:00
stuart nelson 4f8ef26b28 Update matching algorithm (#910)
* 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
2017-07-19 11:50:33 +02:00
Andrey Kuzmin f4c11751a9 Receiver autocomplete (#900)
* Extract receivers

* Moved Match into Utils

* Implemented autocomplete

* Update bindata.go
2017-07-11 11:25:03 +02:00
Max Leonard Inden b3f3ecf803
Improve front-end build process
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.
2017-07-06 13:43:10 +02:00
Raúl Benencia 41c5aaf3f4 Remove timeout for ui requests (#873) (#890) 2017-06-28 00:03:47 +02:00
stuart nelson a7009a9db7 Stn/add receiver support (#872)
Add ability to filter alerts by receiver in UI. This adds changes both in the Elm UI, as well as the Go backend.
2017-06-26 18:20:26 +02:00
Andrey Kuzmin 6b5fb2dbc9 Parse error message (#866)
* Parse error message

* Update bindata.go
2017-06-18 12:19:40 +02:00
Stuart Nelson 3911168df0 Update bindata 2017-06-12 10:17:22 +02:00
Stuart Nelson ddde5eaacd Use concatMap directly 2017-06-12 10:11:36 +02:00
Max Leonard Inden 46ffad322e
Fix filtering by label
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.
2017-06-08 21:34:26 +02:00
Frederic Branczyk c4c0875ba3
fix config JSON marshaling 2017-06-08 13:37:57 +02:00
Max Leonard Inden dd7ffe0515
Serve FontAwesome & Bootstrap ourself
Instead of using external CDNs for Bootstrap and FontAwesome, this patch
makes Alertmanager serve these libraries itself.
2017-06-07 22:40:18 +02:00
stuart nelson 2cf38e4c2e Fix external web url (#836)
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.
2017-06-07 22:38:39 +02:00
Andrey Kuzmin ffe79ad410 Inhibited indicator in the UI (#838)
* Add inhibited indicator

* Update bindata.go
2017-06-01 10:43:44 +02:00
Andrey Kuzmin 3f60d01592 Add favicon (#839)
* Add favicon

* Fix the node version

* Update bindata.go
2017-06-01 10:13:20 +02:00
Andrey Kuzmin eff5341dec Show alert annotations (#833)
* Show annotations

* Update bindata.go

* Fix the versions of elm modules
2017-05-30 21:04:49 +02:00
Andrey Kuzmin 562f99566e Improved Validation (#827)
* 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
2017-05-28 12:53:25 +02:00
Andrey Kuzmin 30749037a9 Style the silences list (#809)
* Get rid of old css lib

* Cleanup the models and updates

* Styled the silences view

* Update that bindata stuff
2017-05-22 13:36:31 +02:00
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