Commit Graph

1272 Commits

Author SHA1 Message Date
Max Inden
efb0e870ef Merge pull request #806 from mxinden/silence-form
Rework SilenceForm
2017-05-19 15:09:48 +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
Fazal Majid
2123264b98 updated logrus so alertmanager can build on Solaris/Illumos (#804) 2017-05-18 15:58:30 +02:00
Max Inden
e85d8acbb2 Merge pull request #799 from mxinden/silenced
Add 'silenced' query param to /alerts endpoint
2017-05-18 09:16:07 +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
0370eebb10 Merge pull request #803 from prometheus/tmpl
Remove receiver filtering from backlink
2017-05-17 12:39:37 +02:00
Fabian Reinartz
b3d2ff3688 Remove receiver filtering from backlink 2017-05-17 11:03:32 +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
a8cac65828
Merge pull request #789 from branch 'ui-rewrite' 2017-05-15 10:03:52 +02:00
Max Leonard Inden
7e6de53f3a
Merge branch 'master' into ui-rewrite 2017-05-15 09:58:14 +02:00
Fabian Reinartz
ff346c1ac9 Merge pull request #780 from prometheus/meshup
Update mesh and add it to debug logging
2017-05-15 09:47:17 +02:00
Fabian Reinartz
f43786ec0b Bump Go version used for Travis runs 2017-05-15 09:29:06 +02:00
Max Inden
f298a21e97 Sync master (#791)
* Anchor silence regex rules

When user creates a new silence with regex match it's left to the user to anchor it, which is not consistent with Prometheus regex handling (promql/functions.go#L818).

* Serialize AlertStatus as 'status'

AlertStatus doesn't have json tag with the field name, so it's serialized into 'Status', and it's the only uppercase field in the alert object. Tag it with 'status' name for consistency

* Fix lock usage in the types package

Locking is a bit tricky there since some state-modifying methods will call to other methods that also modify marker state, simple defer won't work.

* Throw error when continue in route root of Alertmanager config

* Fix alert status handling in UI

* Fixes #746

Found that we are only defining MarshalJSON for the Regexp type for
references not for the direct object

Also took the time to simplify the json.Unmarshal usage in cli/config.go

* Added unit test for continue in root route error (#768)

* Added unit test for continue in root route error

* replaced %v with %q

* Fix broken link to silence from alert

* Fix broken link to silence from alert

* *: cut v0.6.2 (#777)

* Show startsAt time for pending silences (#778)

* docs: Add note to not load balance Alert trafic
2017-05-12 13:46:11 +02:00
Max Inden
eae47b5f01 Sync ui-rewrite with master (#790)
* Anchor silence regex rules

When user creates a new silence with regex match it's left to the user to anchor it, which is not consistent with Prometheus regex handling (promql/functions.go#L818).

* Serialize AlertStatus as 'status'

AlertStatus doesn't have json tag with the field name, so it's serialized into 'Status', and it's the only uppercase field in the alert object. Tag it with 'status' name for consistency

* Fix lock usage in the types package

Locking is a bit tricky there since some state-modifying methods will call to other methods that also modify marker state, simple defer won't work.

* Throw error when continue in route root of Alertmanager config

* Fix alert status handling in UI

* Fixes #746

Found that we are only defining MarshalJSON for the Regexp type for
references not for the direct object

Also took the time to simplify the json.Unmarshal usage in cli/config.go

* Added unit test for continue in root route error (#768)

* Added unit test for continue in root route error

* replaced %v with %q

* Fix broken link to silence from alert

* Fix broken link to silence from alert

* *: cut v0.6.2 (#777)

* Show startsAt time for pending silences (#778)
2017-05-12 12:55:29 +02:00
Max Inden
5f2ac0e2ec Merge pull request #788 from mxinden/docs
docs: Add note to not load balance Alert trafic
2017-05-12 11:59:16 +02:00
Max Leonard Inden
765b07c734
docs: Add note to not load balance Alert trafic 2017-05-12 11:56:17 +02:00
Max Inden
e5042e4d3b Merge pull request #785 from mxinden/silence-state
Silence State from API and UI
2017-05-12 11:04:53 +02:00
Max Leonard Inden
3117e69239
Restyle SilenceList view and group by state 2017-05-11 11:30:36 +02:00
Max Leonard Inden
401e440db4
Return silence state on /silences
silenceState = "expired" | "active" | "pending"
```
"status": {
  "state": "expired"
}
```
2017-05-10 12:01:21 +02:00
Max Inden
d463f1c298 Sync ui-rewrite with master (#779) 2017-05-10 11:49:02 +02:00
Fabian Reinartz
8ccb95c9f5 Log mesh messages at debug level 2017-05-09 16:07:27 +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
Fabian Reinartz
672e9b205f vendor: update mesh 2017-05-09 15:03:27 +02:00
stuart nelson
a776bbc720 Show startsAt time for pending silences (#778) 2017-05-09 08:37:39 -04:00
Fabian Reinartz
75b951b072 Merge branch 'release-0.6' 2017-05-09 10:43:49 +02:00
Fabian Reinartz
b011c0a32c *: cut v0.6.2 (#777) 2017-05-09 10:43:24 +02:00
Fabian Reinartz
dc5142c76b Fix broken link to silence from alert 2017-05-09 10:26:51 +02:00
Fabian Reinartz
257ce9ae8f Fix broken link to silence from alert 2017-05-09 10:26:25 +02:00
Conor Broderick
a77bfb44d6 Added unit test for continue in root route error (#768)
* Added unit test for continue in root route error

* replaced %v with %q
2017-05-09 10:11:40 +02:00
Fabian Reinartz
c9163bd689 Merge pull request #748 from prymitive/anchor-rules
Anchor silence regex rules
2017-05-09 10:11:01 +02:00
Fabian Reinartz
5aff15b30f Merge pull request #773 from prometheus/fixalertstat
Fix alert status handling in UI
2017-05-09 10:09:24 +02:00
Fabian Reinartz
b9d455cb9a Merge pull request #774 from Kellel/origin/#746
Fixes #746
2017-05-09 10:08:49 +02:00
Kellen Fox
6aece86ac1 Fixes #746
Found that we are only defining MarshalJSON for the Regexp type for
references not for the direct object

Also took the time to simplify the json.Unmarshal usage in cli/config.go
2017-05-08 11:25:25 -07:00
Fabian Reinartz
8170206070 Fix alert status handling in UI 2017-05-08 12:56:03 +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] c3850708c1f31aad1db9cda355698ecdd4755e39
2017-05-05 09:30:09 +02:00
Fabian Reinartz
cb8b507e62 Merge pull request #760 from prymitive/fix-types-lock
Use proper locks when modifying alert status
2017-05-04 14:11:26 +02:00
Fabian Reinartz
8566c9531b Merge pull request #767 from Conorbro/continue_error_in_root_route
Throw error when continue in route root of Alertmanager config
2017-05-03 15:06:49 +02:00
conorbroderick
dc782f2dd4 Throw error when continue in route root of Alertmanager config 2017-05-03 13:40:54 +01:00
Max Inden
952543b6e8 Merge pull request #763 from prometheus/alertlist-prevent-null
Init result slice to prevent /alerts returning `null`
2017-05-02 15:52:33 +02:00
Max Leonard Inden
96a28bbc36
Init result slice to prevent /alerts returning null
When there are no alerts to return the api endpoint `/alerts` should
return:
```
{
  "status": "success",
  "data": []
}
```
instead of
```
{
  "status": "success",
  "data": null
}
```
2017-05-02 11:51:09 +02:00
Max Inden
02f14775e5 Merge pull request #754 from prometheus/alerts-endpoint
Switch to /alerts endpoint and restlye alerts list page
2017-05-02 11:07:42 +02:00
Max Leonard Inden
ef3cc7b001
Return alert status on /alerts endpoint and enable filtering
This makes the /alerts endpoint return the alert status introduced by PR
 # 717. In addition it enables alert filtering via matchers like on the
/alerts/groups endpoint.
2017-05-02 09:46:20 +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 Inden
233cad6591 Merge pull request #761 from prometheus/status-page
Display more information on status page
2017-05-02 09:45:42 +02:00
Max Leonard Inden
a5a53c46f7
Display more information on status page 2017-05-02 09:18:36 +02:00
Łukasz Mierzwa
2c14247adc Fix lock usage in the types package
Locking is a bit tricky there since some state-modifying methods will call to other methods that also modify marker state, simple defer won't work.
2017-05-01 20:28:54 +01:00
Fabian Reinartz
91a2b9d717 Merge pull request #759 from prymitive/alert-status-case
Serialize AlertStatus as 'status'
2017-04-28 22:35:30 +02:00
Łukasz Mierzwa
8bc5855c87 Serialize AlertStatus as 'status'
AlertStatus doesn't have json tag with the field name, so it's serialized into 'Status', and it's the only uppercase field in the alert object. Tag it with 'status' name for consistency
2017-04-28 11:34:01 -07:00