Łukasz Mierzwa
a21be4db4d
Move tab visibility code from grid.js to unsee.js
...
Instead of grid update run a full update, after keeping tab in the background for too long some alert groups are kept in the DOM where they should be purged. Chrome does some really complex background tab throttling, interwebz states that after >=10s in the background a tab can only use 1% of the cpu. Future code might need to use Web Workers API, assuming other vendors will use it too (https://arstechnica.com/information-technology/2017/03/chrome-57-background-tab-suspension-download/ ). For now let's just reload alerts when user switches to a previously background tab after more than a single refresh cycle, this will ensure that there's no dead alerts presents since that can be confusing
2017-07-07 19:49:02 -07:00
Łukasz Mierzwa
938177c3d9
Merge pull request #131 from cloudflare/fix-fingerprints
...
Fix fingerprints
2017-07-07 07:29:55 -07:00
Łukasz Mierzwa
5e0cb18075
Correctly seed alert fingerprints
...
Then need to be set after creating the alert
2017-07-06 22:28:14 -07:00
Łukasz Mierzwa
deaae332ec
Add strict API response test to catch any drift
2017-07-06 22:27:13 -07:00
Łukasz Mierzwa
32553e1581
Merge pull request #127 from cloudflare/page-visibility-change
...
Redraw alert list of user switches to unsee tab
2017-07-06 09:17:43 -07:00
Łukasz Mierzwa
ad47afd47d
Redraw alert list of user switches to unsee tab
...
This should limit UI artifacts when you keep unsee tab inactive (not fucused) for a long time and a browser stops refreshing content
2017-07-06 09:13:01 -07:00
Łukasz Mierzwa
215ece79cb
Merge pull request #128 from cloudflare/fix-metrics
...
Tweak collected metrics
2017-07-06 08:57:17 -07:00
Łukasz Mierzwa
6166fdd474
Expose number of time unsee collected alerts from Alertmanager API
...
This way one can alert if unsee stops collecting alerts.
2017-07-06 08:52:13 -07:00
Łukasz Mierzwa
cd63ee512e
Fix metric updates for alert counters
...
Metrics were incremented but never reset, this fixes it
2017-07-06 08:52:13 -07:00
Łukasz Mierzwa
4fe7835aa3
Merge pull request #129 from cloudflare/speedup-fingerprints
...
Speed up alert fingerprint generation
2017-07-06 08:48:10 -07:00
Łukasz Mierzwa
81ce5d3098
Speed up alert fingerprint generation
...
Dynamic fingerprints made the code much slower, pprof shows they are responsible for ~70% of all cpu usage for any API call. To make it worse they are applied to all alerts, since dedup layer doesn't know which alerts will be filtered later, it operates on all of them. This PR will:
1. add benchmarks to so it's easier to track performance
2. Keep current methods for accessing fingerprints, but use precomputed static fields in those
3. Refactor Alert methods to use pointers, so we're not working on a copy
Benchmark timing went down from ~4000ns to 0.4ns for fingerprint calls and API response times from 1.3s (for my test sample) to 0.2s, which puts it back to the same level as before moving fingerprints to be dynamic. I still don't like this code much, it's all over the place, but I don't have a good idea how to better structure this, let's hope I'll be wiser in the future.
2017-07-05 23:35:00 -07:00
Łukasz Mierzwa
fc04dde5ff
Merge pull request #126 from cloudflare/group-link-icon
...
Use share icon instead of link for alert group links
2017-07-05 09:12:30 -07:00
Łukasz Mierzwa
538249beb0
Use share icon instead of link for alert group links
2017-07-02 12:33:03 -07:00
Łukasz Mierzwa
3884b40667
Merge pull request #125 from cloudflare/vendor-updates
...
Vendor package updates
2017-07-02 11:45:37 -07:00
Łukasz Mierzwa
d64e2505c0
Update vendor packages
2017-07-02 10:19:02 -07:00
Łukasz Mierzwa
71c0dce1f6
Vendor renamed Sirupsen/logrus to sirupsen/logrus, fix imports
2017-07-02 10:12:33 -07:00
Łukasz Mierzwa
7c518c9dfa
Merge pull request #124 from cloudflare/multi-upstream
...
Collect alerts from multiple Alertmanager instances
2017-07-02 09:48:54 -07:00
Łukasz Mierzwa
aee5ec1a2e
Update screenshot using two alertmanager instances
2017-07-01 20:30:24 -07:00
Łukasz Mierzwa
0a06d58e22
Append alert state from the correct object
2017-07-01 20:28:51 -07:00
Łukasz Mierzwa
cb69029c4f
Add @alertmanager filter
2017-07-01 14:02:03 -07:00
Łukasz Mierzwa
812eceed39
Drop label keys from state and receiver button, those are static and we don't need to show them all the time
2017-07-01 13:34:05 -07:00
Łukasz Mierzwa
6f1e58d387
Don't flush cache on failed instances
...
Cache handling is done in the upstream handling code, this isn't needed anymore
2017-07-01 12:54:30 -07:00
Łukasz Mierzwa
4330972277
Color source buttons based on alert state in each
2017-07-01 12:53:51 -07:00
Łukasz Mierzwa
4036137984
Always render silences, if there are any
...
Alert can be silenced in one instance while active in another, always show silences so it's visible
2017-07-01 12:46:19 -07:00
Łukasz Mierzwa
f2b21a60e2
Store alert state per instance
2017-07-01 12:43:15 -07:00
Łukasz Mierzwa
8ef0f3881e
Tweak error message for all Alertmanager instances being down
2017-07-01 12:42:43 -07:00
Łukasz Mierzwa
01c89082dd
Calculate min/max timestamps and store those as globals, keep individual timestamps per instance
2017-07-01 12:09:55 -07:00
Łukasz Mierzwa
5bd03234a0
Clear Alertmanager data on pull error
2017-07-01 11:31:29 -07:00
Łukasz Mierzwa
9fb61086b0
Revert test changes to the Makefile
2017-07-01 10:32:24 -07:00
Łukasz Mierzwa
95ac702274
Fix tests to not use un-exported fields
2017-07-01 10:08:02 -07:00
Łukasz Mierzwa
a8aa900830
Drop global SilencedBy & InhibitedBy from alert, only export per instance data
2017-07-01 10:05:28 -07:00
Łukasz Mierzwa
8ced9d0a1c
Always sort InhibitedBy & SilencedBy to ensure order don't change between update
2017-07-01 10:03:07 -07:00
Łukasz Mierzwa
ca0403ea75
Correctly sort alerts in dedup code
2017-07-01 10:01:35 -07:00
Łukasz Mierzwa
68b8e5fecf
Use labels fp for sorting alerts
...
Labels fp is stable, contant fp will keep changing
2017-07-01 08:33:34 -07:00
Łukasz Mierzwa
c6362ded78
Add Alertmanager 0.7 to supported versions in the README file
2017-07-01 08:17:26 -07:00
Łukasz Mierzwa
72650d4cef
Drop Go 1.7 from travis
...
Go 1.7 is no longer supported by Go developers (since the policy is that only latest version is supported), drop it from travis so we can use 1.8 features. There's very little excuse not to use latest Go and plenty of workarounds if someone can't install it (like using docker).
2017-07-01 08:17:04 -07:00
Łukasz Mierzwa
c29cb2c0a9
Sort alert groups so they are returned in a stable order
2017-06-30 23:41:25 -07:00
Łukasz Mierzwa
175078320e
Tweak silence JSON preview to work better with multiple instances
2017-06-30 23:30:53 -07:00
Łukasz Mierzwa
514eacb81d
Tweak instance errors boxes UI
2017-06-30 23:20:37 -07:00
Łukasz Mierzwa
2420212eb0
Fix tests to setup upstreams only once
2017-06-30 23:01:54 -07:00
Łukasz Mierzwa
6debf574a2
Error on duplicated alertmanager instance names in the ALERTMANAGER_URIS
2017-06-30 23:01:36 -07:00
Łukasz Mierzwa
45067d4c31
Don't fail on extra dirs in the mock folder
2017-06-30 23:01:06 -07:00
Łukasz Mierzwa
db9c28eeba
Hide silence button tooltip when the form is shown
2017-06-30 20:03:57 -07:00
Łukasz Mierzwa
7b21997c19
Split warning box rendering into dedicated template
2017-06-30 19:58:03 -07:00
Łukasz Mierzwa
afb419f4f3
Handle silence request result for multiple Alertmanager instances in the UI
...
Silence result UI will now show all selected upstreams and provide individual results for each
2017-06-30 19:52:42 -07:00
Łukasz Mierzwa
360dece7ad
Disallow multiple Alertmanager instances with the same URI
...
Unique uri is required for silence form result tracking
2017-06-30 19:49:47 -07:00
Łukasz Mierzwa
5e020b9e01
Store alert source link per Alertmanager instance
2017-06-29 21:18:30 -07:00
Łukasz Mierzwa
acc7a07a18
Show commands while running tests
...
This will make it easier to tell which tests are being run, since some are optional and depend on tools being installed
2017-06-28 22:41:35 -07:00
Łukasz Mierzwa
612a0e817f
Rename ALERTMANAGER_URI to ALERTMANAGER_URIS
...
This will make upgrade more explicit since there is a syntax change
2017-06-28 22:36:26 -07:00
Łukasz Mierzwa
0e9d9cee39
Ensure that we fail if there are no upstreams
2017-06-28 22:36:26 -07:00