Commit Graph

57 Commits

Author SHA1 Message Date
Łukasz Mierzwa
5602181b0a Add alertmanager 0.11.0 test files 2017-11-17 21:54:22 -08:00
Łukasz Mierzwa
775d836f9f Use alertmanager mock files in 'make run' 2017-11-09 21:54:06 -08:00
Łukasz Mierzwa
030020cf82 Use Alertmanager 0.9.1 test data for 'make run' 2017-10-02 09:03:29 -07:00
Łukasz Mierzwa
853d7d0b1c Use Alertmanager 0.9.0 test data for 'make run' 2017-09-28 19:13:26 -07:00
Łukasz Mierzwa
2a76843700 Use Docker multi-stage builds to reduce final docker image size
For second stage use https://github.com/GoogleCloudPlatform/distroless which provides a minimal image with CA certificates.
Binary is compiled with CGO_ENABLED=0 to prevent dynamical linking to any libraries.
2017-08-22 19:31:56 -07:00
Łukasz Mierzwa
c5bff9d062 Automatically disable webpack production mode when NODE_ENV=test is set
This will speed up local development and CI runs (5s vs 30s)
2017-08-08 11:16:07 -07:00
Łukasz Mierzwa
4aa187674c Call vendor make target when building binary
This will ensure vendor dir is populated
2017-08-08 11:01:29 -07:00
Łukasz Mierzwa
5d4ae47888 Convert all packages to be internal
Internal packages are supported by Go 1.5+, any package in /internal/ dir is only importable from the same repo. This will cleanup main dir a bit and provide better namespace for unsee subpackages
2017-08-04 16:21:27 -07:00
Łukasz Mierzwa
13703d0616 Use webpack & eslint from node_modules dir that we manage 2017-08-04 14:28:01 -07:00
Łukasz Mierzwa
f202232be8 Version all bundles
This will tell webpack to add a hash to all bundles filenames, we generate script tags for loading those and inject them as templates. No more forced cache bypassing
2017-07-29 16:19:48 -07:00
Łukasz Mierzwa
8f5c246297 Move to fully webpack managed assets 2017-07-29 13:52:07 -07:00
Łukasz Mierzwa
2ad3ec18b8 Rebuild assets before compiling binary 2017-07-29 13:49:46 -07:00
Łukasz Mierzwa
68b5c56a76 Install npm deps in Makefile 2017-07-29 13:49:46 -07:00
Łukasz Mierzwa
d91fa473ab Drop jshint, use eslint in es6 mode 2017-07-29 13:43:12 -07:00
Łukasz Mierzwa
0a3d002db8 Use Alertmanager 0.8.0 for default demo mode 2017-07-21 19:11:03 -07:00
Łukasz Mierzwa
e114ceb1ae Use dep instead of govendor for vendor folder management 2017-07-18 09:16:42 -07:00
Ł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