68 Commits

Author SHA1 Message Date
Łukasz Mierzwa
061ffe3e60 Use bakelite to crosscompile binaries 2018-01-28 20:37:05 -08:00
Łukasz Mierzwa
25e796f2ac Add a make target and Travis CI stage for linting docs
Nobody wants borked markdown syntax in docs
2018-01-20 12:54:45 -08:00
Łukasz Mierzwa
c7a1c9b865 Add Alertmanager 0.13.0 mock resposes for testing
0.13.0 was released, add it to the list of tested versions
2018-01-12 15:47:38 -08:00
Łukasz Mierzwa
2c53b323aa Add missing depenency for test-js
npm install isn't run when test-js is executed on a fresh clone, so travis fails
2018-01-03 16:03:18 -08:00
Łukasz Mierzwa
a3fdaff4ba Add mock files for Alertmanager 0.12.0
Adds 0.12.0 to test coverage
2017-12-22 22:15:38 +01:00
Łukasz Mierzwa
3e6343daa9 Cleanup make targets a bit
Reduce number of targets used internally for building and use less confusing names. Add webpack target that will be needed for node only docker build stage.
2017-12-05 09:23:18 -08:00
Łukasz Mierzwa
336f74e48e Use travis build stages
Split each test target into a dedicated job, add docker build tests
2017-12-04 13:17:19 -08:00
Łukasz Mierzwa
52f0f42aa5 Split test and lint make targets, add a target for generating fake binary assets 2017-12-04 13:17:19 -08:00
Łukasz Mierzwa
65a27b39df Move label coloring config options from 'color' to 'labels' section 2017-12-03 10:09:17 -08:00
Łukasz Mierzwa
a1eab56649 Migrate all old env usages to the new naming scheme 2017-12-02 21:55:43 -08:00
Łukasz Mierzwa
5f904ec99d Move configuration related docs to a dedicated file and rewrite those to match new config file. 2017-12-02 21:10:16 -08:00
Ł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