41 Commits

Author SHA1 Message Date
Łukasz Mierzwa
300c1ea2f9 Refactor Makefile targets to make it easier to add build tool deps
If I would add a new 'go get foo' line in the build/deps.ok target it wouldn't install anything since the file we touch at the end already exist. Split all 'go get foo' lines into dedicated targets and make build/deps.ok depend on it. This way when you add a new build time dependency make will be able to do the magic and just install what's missing.
I made those change to add github.com/cespare/prettybench, it ended up adding little value so I dropped it, but Makefile refactor still seems like a good idea
2017-07-10 08:54:19 -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
9fb61086b0 Revert test changes to the Makefile 2017-07-01 10:32:24 -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
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
26d14d1bd2 Refactor Alertmanager API client code to use multiple upstream instances
Alerts are stored per instance and deduplicated on read.
2017-06-28 22:35:16 -07:00
Łukasz Mierzwa
0573823d75 Add mock data generated using Alertmanager 0.7.1 2017-06-09 19:53:11 -07:00
Łukasz Mierzwa
5500af422a Add mock data generated using Alertmanager 0.7.0
All tests passing so doesn't look like we need any special support for 0.7.0
2017-06-08 16:53:31 -07:00
Łukasz Mierzwa
6d15a82e89 Support multiple receivers 2017-06-03 13:23:51 -07:00
Łukasz Mierzwa
aadcaeb9b5 Fix issues reported by eslint 2017-06-01 20:24:47 -07:00
Łukasz Mierzwa
50fd2238d0 Add eslint config and run eslint if installed 2017-06-01 19:58:49 -07:00
Łukasz Mierzwa
8a77d620fd Rename @status to @state
Fixes #104

@status filter was added to the master branch to support new status key from Alertmanager >=0.6.1
status ended up being nested in Alertmanager (it was added to solve AM issue 609 and that was a long PR with lots of changes), current unsee implementation ended being slightly off with how Alertmanager is naming this, it should actually be @state rather than @status.
2017-05-23 21:52:08 +01:00
Łukasz Mierzwa
0497e82128 Move assets target to a dedicated Makefile 2017-05-10 15:10:29 +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
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
72808c0002 Add 0.6.1 mock data 2017-05-01 22:20:12 +01:00
Łukasz Mierzwa
9f7a7dd899 Run optional jshint tests if it's installed 2017-04-25 20:15:27 -07:00
Łukasz Mierzwa
087458b767 Allow selecting multiple label values when creating silence.
This commit turns label checkboxes into multiselect dropdowns that are populated from all labels of all instances of current alert (matched by alertname label). There is also a cocollapsible preview box that allows user to inspect raw silence JSON object we will send to the Alertmanager API. Fixes #69
2017-04-23 09:02:27 -07:00
Łukasz Mierzwa
0e7b40c995 Reformat run-docker target 2017-04-23 08:53:48 -07:00
Łukasz Mierzwa
bfbba7ecb6 Fix mock data usage with 'make run-docker'
docker target doesn't work with file:// based ALERTMANAGER_URI since it doesn't have same paths inside the image, fix it by mapping a volume
2017-04-22 22:33:12 -07:00
Łukasz Mierzwa
d5916c81cf Add support for creating silences directly from unsee UI
It adds a button next to the @silenced filter that shows a modal window with a silence form. API request is send via AJAX call from user browser.
2017-04-20 17:01:52 -07:00
Łukasz Mierzwa
a95d9a9f43 Switch typeahead.js to a maintained fork
Module was abandoned by Twitter and have some bugs that are fixed in the fork, switch over as it's a drop in replacement
2017-04-18 13:25:37 -07:00
Łukasz Mierzwa
03523641ed Set default filter for 'make run'
Use @inhibited=false as the default filter
2017-04-17 16:52:54 -07:00
Łukasz Mierzwa
72651bb53d Add missing /
Fis issue introduced in commit 7612a8a
2017-04-16 18:11:56 +01:00
Łukasz Mierzwa
7612a8a8aa Use local files for 'make run' 2017-04-16 08:31:07 -07:00
Łukasz Mierzwa
f1e90e054d Rewrite clientside-haml-js templates using underscore
Drop haml templates in favor of underscore. Haml templates are harder to maintain and require extra dependencies, we already have underscore.js included and it provides a fast templating engine. Rewrite all client side templates using it.
Performance with underscore is pretty much the same as with haml (with 10k alerts).
2017-04-10 11:38:34 -07:00
Łukasz Mierzwa
bb7f491acb Update Alertmanager URI to use new mock data
So that 'make run' works with new mock data
2017-04-06 21:06:50 -07:00
Łukasz Mierzwa
a0375a243d Fix 'make vendor-update' to work as documented
make vendor-update should update everything inside the vendor dir, to do this 'govendor fetch' needs to be used, current command ('govendor update') is used to copy packages from /home/lukasz/work/go to vendor dir
2017-03-30 13:21:24 -07:00
Łukasz Mierzwa
b458f63713 Switch from manul to govendor for maintaining vendor directory
Manul works great, but using git submodules creates some problems (like https://github.com/travis-ci/travis-ci/issues/5806), switch to govendor to have reproducible builds
2017-03-28 20:09:26 -07:00
Łukasz Mierzwa
e0279ebe5e Add more details about make variable 'DEBUG'
Make 'make DEBUG=true ...' work with run-docker target and provide more details of what it will do
2017-03-28 11:25:27 -07:00
Łukasz Mierzwa
f810ec31d8 Don't enable debug mode by default
This should only be enabled when needed, it's mentioned in the docs
2017-03-28 09:10:15 -07:00
Łukasz Mierzwa
d6189955b2 Add mock data for testing 2017-03-27 19:36:56 -07:00
Łukasz Mierzwa
81197861dd Enable more features for mock data 2017-03-27 10:40:03 -07:00
Łukasz Mierzwa
9322b8ab0b Add CONTRIBUTING.md file
This file explains how to get started with unsee development
2017-03-27 07:46:42 -07:00
Łukasz Mierzwa
57ae5299a3 Add make targets for handling vendor dir via manul
This will install manul and run allow to run all commands needed to maintain all vendor deps
2017-03-27 07:46:42 -07:00
Łukasz Mierzwa
f8420d4632 Use go-bindata-assetfs for static files
This allows unsee to be compiled into a single self-contained binary, without any need to external static files or templates
2017-03-26 17:41:17 -07:00
Łukasz Mierzwa
3027137a96 Cleanup make targets and update readme to match it
Refactor make targets to make it easier to follow, add missing PORT env variable to the readme.
2017-03-26 17:41:16 -07:00
Łukasz Mierzwa
9525cbcbe0 Cleanup Makefile
Rename 'make build' to 'make docker-image' so it's more obvious what it's doing
Initialize git submodules automatically when needed, so users don't need to do it manually
2017-03-23 22:56:17 -07:00
Łukasz Mierzwa
2d2eec0567 Fix missing quote in 'make dev' target 2017-03-23 19:57:54 -07:00
Łukasz Mierzwa
e239fd05fd Import code from internal repository (#1)
Import code from internal repository
2017-03-23 16:58:04 -07:00