Commit Graph

276 Commits

Author SHA1 Message Date
Łukasz Mierzwa
5a95d869fc Merge pull request #96 from cloudflare/alertmanager-0.6.2
Alertmanager 0.6.2 support
2017-05-10 10:45:21 +01:00
Łukasz Mierzwa
4eb7d2ec71 Update docs on supported AM versions 2017-05-09 21:55:33 +01:00
Łukasz Mierzwa
ee301ffae1 Default to 0.6.2 mock data in 'make run' 2017-05-09 21:53:51 +01:00
Łukasz Mierzwa
2cfe0eaa2a Add 0.6.2 mock data
Generated from live Alertmanager instance
2017-05-09 21:53:07 +01:00
Łukasz Mierzwa
b9de72fc48 Add support for Alertmanager 0.6.2
Minor changes in the API.
2017-05-09 21:52:39 +01:00
Łukasz Mierzwa
f21d8a5c15 Merge pull request #95 from cloudflare/timer-logs-2
Provide more startup logs
2017-05-09 18:05:18 +01:00
Łukasz Mierzwa
9cbf784baf Provide more startup logs
This will help with debugging issues
2017-05-09 18:02:08 +01:00
Łukasz Mierzwa
86671e4823 Merge pull request #94 from cloudflare/timer-logs
Fix race condition in the matcher code
2017-05-09 17:55:28 +01:00
Łukasz Mierzwa
37304d615a Remove unused code
setOperator is no longer used, remove it as it's dangerous and useless
2017-05-09 17:49:24 +01:00
Łukasz Mierzwa
25d457b274 Fix race condition in the matcher code
We have a static list of matchers, one for each kind, but newMatcher() was writing to those on every filter creation. Remove writes, set the attribute on matcher init instead.
2017-05-09 17:47:32 +01:00
Łukasz Mierzwa
b36aa5d35e Merge pull request #93 from cloudflare/dedup
Deduplicate alerts
2017-05-08 15:38:48 +01:00
Łukasz Mierzwa
a4337345b3 Deduplicate alerts
Alertmanager 0.6.1 can return multiple instances of the same alert either in a different block object or as a duplicated alert group, ensure that we deduplicate those
2017-05-08 15:33:17 +01:00
Łukasz Mierzwa
1a3cfc8836 Merge pull request #92 from cloudflare/filters-validation
More strict filter validation
2017-05-06 16:51:38 +01:00
Łukasz Mierzwa
003010f73b Speed up filter matches by re-using global match object
Instead of compiling filter regexp on every filter match pre-compile it and use same instance
2017-05-06 16:46:06 +01:00
Łukasz Mierzwa
7bf0b9d5d0 More strict filter validation
@silenced=true should now be marked as invalid filter, but it isn't, this commit refactors it so that instead of looping over all filters and falling back to fuzzy (which is very relaxed checking and can't find typos in filter names like @statuz=active) we tokenize the expression into '<filter name> <operator> <value>' and only fallback to fuzzy if there's only a static text (no filter name and operator). This is more manual but provides stronger checks so now @silenced=true is correctly marked as invalid
2017-05-06 16:46:06 +01:00
Łukasz Mierzwa
4ade516f57 Merge pull request #91 from cloudflare/fix-grid-clear
Remove all alert groups in Grid.Clear()
2017-05-06 08:24:50 +01:00
Łukasz Mierzwa
817731857a Remove all alert groups in Grid.Clear()
Clear was only hiding elements so div objects were still present, ensure they are removed from the DOM
2017-05-05 17:32:16 +01:00
Łukasz Mierzwa
5e1cebfdaa Merge pull request #90 from cloudflare/status-filter
Replace @silenced & @inhibited filters with @status
2017-05-05 16:53:04 +01:00
Łukasz Mierzwa
0d55311a9d Replace @silenced & @inhibited filters with @status
Now that Alertmanager provides status=(unprocessed|suppressed|active) in the API it doesn't make sense to keep having separate filters for each value, merge @silenced & @inhibited into a single filter, update docs and UI
2017-05-05 13:56:48 +01:00
Łukasz Mierzwa
b65f2a1cc3 Merge pull request #89 from cloudflare/silence-empty-labels
Notify user when there are no labels for a new silence
2017-05-05 07:24:48 +01:00
Łukasz Mierzwa
b1873963df Notify user when there are no labels for a new silence
If user clicks on a silence button we make AJAX call to the /alerts.json endpoint to get all instances of given alert so we can allow user to select from all labels used. But it's possible that this alert will be resolved by the time user clicks on it, when this happens we simply list no labels, which might be confusing, show a message so user knows what happened.
2017-05-04 14:39:06 +01:00
Łukasz Mierzwa
e827b737cf Merge pull request #88 from cloudflare/legacy-classes
Rewrite js classes using prototypes
2017-05-03 10:11:24 +01:00
Łukasz Mierzwa
34c68ffb65 Rewrite js classes using prototypes
This removes the requirement on ES6 support in the browser, which will allow to use unsee on older browsers
2017-05-02 13:50:56 +01:00
Łukasz Mierzwa
f9bd5eb283 Merge pull request #87 from cloudflare/livemocks
Generate mock files from a live Alertmanager instance
2017-05-02 10:34:34 +01:00
Łukasz Mierzwa
cee9b2bef6 Generate mock data using livemock.py
Generate mock data for all Alertmanager releases that we can support (0.4 - 0.6) and switch tests to use them instead of old files
Fixes #67
2017-05-02 10:28:40 +01:00
Łukasz Mierzwa
f4ab8428d8 Add make target for generating mock API data from alertmanager
This will allow moving away from manually captured/edited mock API responses and start generating them by sending alerts & silences to a live Alertmanager instance
2017-05-02 10:28:39 +01:00
Łukasz Mierzwa
5ae8f43227 Merge pull request #86 from cloudflare/refactor-status
Refactor alert status attrs
2017-05-02 10:28:07 +01:00
Łukasz Mierzwa
b42953e87f Add validation tests 2017-05-01 22:20:12 +01:00
Łukasz Mierzwa
72808c0002 Add 0.6.1 mock data 2017-05-01 22:20:12 +01:00
Łukasz Mierzwa
487d7bcde8 Use alert status, inhibitedBy & silencedBy fields instead of silenced & inhibited 2017-05-01 22:20:12 +01:00
Łukasz Mierzwa
5df44def81 Add new attrs for tracking alert status and linking silences / inhibiting alerts
Those will replace Inhibited and Silenced
2017-05-01 18:43:03 +01:00
Łukasz Mierzwa
a001c6ed65 Merge pull request #85 from cloudflare/support-0.6.1
Add basic support for Alertmanager 0.6.1
2017-04-28 13:19:43 -07:00
Łukasz Mierzwa
3a1f6905e0 Add basic support for Alertmanager 0.6.1
This makes unsee work with 0.6.1, but the new status means that we should refactor unsee data model and pull inhibited and silenced into it, with a single filter
2017-04-28 12:40:04 -07:00
Łukasz Mierzwa
a6d2c287dd Merge pull request #84 from cloudflare/jshint-config
Jshint config
2017-04-27 22:54:31 -07:00
Łukasz Mierzwa
12832e2c29 Fix quotation mark inconsistencies
jshint tests passing again
2017-04-27 22:52:05 -07:00
Łukasz Mierzwa
ad897596b2 Enable quotation mark checks in jshint
Require double quote marks
2017-04-27 22:51:55 -07:00
Łukasz Mierzwa
4e97f4f0aa Fix unused and undefined variables warnings 2017-04-27 22:51:53 -07:00
Łukasz Mierzwa
d977c2ff44 Enable development mode
This prevents errors from console, alert and other browser functions
2017-04-27 21:26:34 -07:00
Łukasz Mierzwa
bec2255a59 Add config file for jshint
This will enable more checks, first for undefined or unused variables
2017-04-27 20:53:01 -07:00
Łukasz Mierzwa
410d17e1c2 Merge pull request #83 from cloudflare/fix-regex-silence
Correctly anchor regex silences
2017-04-27 09:29:34 -07:00
Łukasz Mierzwa
dd6c3b1057 Correctly anchor regex silences
Silence regex rules are not anchored, be explicit
2017-04-26 20:00:45 -07:00
Łukasz Mierzwa
106175b756 Merge pull request #82 from cloudflare/event-listener-leak
Don't leak event listeners in the silence form
2017-04-26 18:54:04 -07:00
Łukasz Mierzwa
7f3c414189 Don't leak event listeners in the silence form
Event listeners are setup on the modal div, but that div is not removed when the modal is hidden, only its children. This means that event listeners are stacked every time you show and hide a form. To reproduce this issue:
1. open silence form, click up button above hours, it will increment from 1 to 2
2. hide the form
3. re-open silence form, click up button above hours, it will increment from 1 to 3
4. repeat and every time increment will get a new listener that will cause higher value bump

This PR moves all listeners to the silence form element, which is removed when modal is closed, so all even listeners are destroyed properly and this bug no longer gets triggered.
Same fix is applied to the quick filter modal, it's present there but the effect there isn't as visible
2017-04-26 17:37:13 -07:00
Łukasz Mierzwa
2fa9c5cffe Merge pull request #81 from cloudflare/really-fix-events
This should be the real fix for the even recursion
2017-04-26 17:07:32 -07:00
Łukasz Mierzwa
0e7fe10b46 This should be the real fix for the even recursion
There's a bogus duplicated mouse event for a.silence-duration-btn, which I added to fix css issues, get rid of it and replace with proper css selectors. And with that drop the event.stopPropagation call as it shouldn't be needed anymore
2017-04-26 16:56:54 -07:00
Łukasz Mierzwa
efa1c2025b Merge pull request #80 from cloudflare/fix-silence-json-padding
Add some space between submit button and the silence JSON preview
v0.4.0
2017-04-26 14:59:35 -07:00
Łukasz Mierzwa
aed3cf1f29 Add some space between submit button and the silence JSON preview 2017-04-26 14:17:33 -07:00
Łukasz Mierzwa
47b245efcf Merge pull request #79 from cloudflare/raven-init
Better sentry javascript handling
2017-04-26 07:50:36 -07:00
Łukasz Mierzwa
bd5b9688ac Handle load exceptions better
If js fails on startup (syntax error, can't load some files) then instead of showing blank page that doesn't work render a message with exception
2017-04-25 23:05:22 -07:00
Łukasz Mierzwa
45ba69cf76 Ensure raven-js is loaded first and works if enabled
This moves raven init into a dedicated file where it's configured on load, we no longer load it on /help, but there's only css there so there wasn't anything that could fail anyway. We will also now fail in the most visible way if the value passed to raven is invalid (as in invalid syntax)
2017-04-25 23:05:22 -07:00