42 Commits

Author SHA1 Message Date
Richard Maynard
ec14be0288 feat(backend): add support for custom headers (#368)
This will allow the AlertManager upstreams to be sent user defined HTTP headers.
2019-01-17 08:53:33 +00:00
Łukasz Mierzwa
e1f9686e3f feat(backend): allow stripping annotations
This allows same filtering we already have with labels. Fixes #312
2019-01-15 22:12:23 +00:00
Łukasz Mierzwa
0d68ea4c3c feat(api): store silences per cluster in the API response 2018-12-01 09:53:47 +00:00
Łukasz Mierzwa
93617b3b18 fix(api): ensure that cluster members are always sorted 2018-11-30 23:59:58 +00:00
Łukasz Mierzwa
76dd51bb92 feat(api): expose Alertmanager instance version and cluster members
Store and expose via API the version of each Alertmanager instance and the list of instances in the same cluster
2018-11-30 18:35:34 +00:00
Łukasz Mierzwa
c4bcc04abf fix(tests): relax ac count test
This needs a better and more explicit test, relax it for now
2018-11-10 13:08:44 +00:00
Łukasz Mierzwa
ade996a6ec refactor(api): move autocomplete code to filters 2018-10-08 23:15:28 +01:00
Łukasz Mierzwa
f03887b56c feat(api): add @silence_id filter
This allows to filter alerts by silence ID, only matches silenced alerts
2018-10-08 23:02:38 +01:00
Łukasz Mierzwa
80e7caf627 fix(ui): expose Alertmanager instance public URI in upstreams list 2018-09-11 21:03:54 +01:00
Łukasz Mierzwa
9c16ffa447 chore(project): rename from unsee to karma
Fixes prymitive/unsee#23
2018-09-09 14:12:26 +01:00
Łukasz Mierzwa
c6dc362186 fix(style): error strings should not be capitalized or end with punctuation or a newline 2018-08-11 23:03:02 +01:00
Łukasz Mierzwa
b2a0f61d4e fix(style): simplify append code 2018-08-11 22:46:34 +01:00
Łukasz Mierzwa
2ec3df93d7 fix(style): check for alertmanager.RegisterAlertmanager error return 2018-08-11 22:43:22 +01:00
Łukasz Mierzwa
b3709927f7 feat(api): add an enpoint that returns all known label values for given label name
This will be used in the silence form, to provide a list of suggestions
2018-08-10 17:36:00 +01:00
Łukasz Mierzwa
d934dbb053 feat(api): add /labelNames.json endpoint
This endpoint will be used for label name autocomplete in the silence form
2018-08-10 17:36:00 +01:00
Łukasz Mierzwa
6c7ba5551c refactor(api): move silences into a dedicated key in API response
A single silence can supress multiple alerts so to reduce response size and the amount of data react UI needs to track move it out of alert instance (which will deduplicate it) and on each alert only store a reference. In the API return all silences as a global dict and each alert only contains the ID of silences suppressing it.
2018-07-19 23:38:11 +02:00
Łukasz Mierzwa
b71883f1ef Migrate to new repo
Forked unsee from cloudflare, so import paths needs to be updated
2018-06-07 15:30:57 +02:00
Łukasz Mierzwa
fd0eb46adf Sanitize Alertmanager URI before putting it in /alerts.json reponse
Alertmanager URI might contain basic auth username & password, we should replace password with 'xxx' in logs and and error messages.
Go will still print it in HTTP request errors, but that will be fixed in the next Go release - https://go-review.googlesource.com/c/go/+/102855
Fixes #259
2018-04-27 09:36:12 -07:00
Łukasz Mierzwa
0f73b20bc6 Allow passing query args to HTTP requests send to the Alertmanager API
Alertmanager 0.4.x silences endpoint uses pagination, code for this was incorrectly dropped in #216, re-add it. Requires a way for mapper packages to signal the need for passing query args to HTTP requests
2018-01-24 19:09:02 -08:00
Łukasz Mierzwa
60b1c696a3 Too many 'T' in NewHTTTPTransport 2018-01-24 13:04:27 -08:00
Łukasz Mierzwa
a0cf3cc43c Add a JSON tag for ProxyRequests attr 2018-01-23 21:38:46 -08:00
Łukasz Mierzwa
49d1ed2e1e Pass HTTP transport to the proxy
When we proxy requests we should use same transport as we use when collecting alerts & silences
2018-01-23 21:37:56 -08:00
Łukasz Mierzwa
d5a7cb9ace Rename Transport interface to Reader 2018-01-23 19:40:24 -08:00
Łukasz Mierzwa
6f89a77f8d Rename 'transport' package to 'uri'
This package adds handlers for different URI schemes, name clashes with http.Transport which is now passed around. Rename it to make it more obvious what it does
2018-01-23 19:32:39 -08:00
Łukasz Mierzwa
338a4c38a6 Drop duplicated function
There's identical method on the Alertmanager instance that's being used
2018-01-23 19:22:50 -08:00
Łukasz Mierzwa
24335ebf1f Add support for passing path to custom TLS CA cert & client key/cert pair
This adds support for passing a custom http.RoundTripper so in effect we can customize TLS client config for HTTPS requests.
Fixes #184
2018-01-23 19:22:12 -08:00
Łukasz Mierzwa
1f89ba05fe Migrate rest of the code to new mapper and transport packages 2018-01-22 11:26:36 -08:00
Łukasz Mierzwa
983c7f50ee Refactor NewAlertmanager() to not register new instance by default
This makes it easier to test code
2018-01-08 14:28:28 -08:00
Łukasz Mierzwa
efda91f542 Rename Alertmanager.Timeout -> Alertmanager.RequestTimeout 2018-01-08 13:51:38 -08:00
Łukasz Mierzwa
c8b7b3bcd0 Implement functional options, this time for real 2018-01-08 13:30:46 -08:00
Łukasz Mierzwa
3eb28b3a6f Use functional options pattern when creating Alertmanager instances 2018-01-06 17:19:05 -08:00
Łukasz Mierzwa
b6dd993c2b Add support for proxying user connection to Alertmanager
Fixes #190.

With this feature unsee can be configured to proxy requests to selected Alertmanager instances, if it's enabled unsee silence form will send a request via unsee rather than directly. This allows users to manage silences in environments where they have access to unsee but not to Alertmanager. Only silences endpoints on Alertmanager API are proxied.
2018-01-03 16:17:58 -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
860375650e Add --receivers.keep for consistency with other options
there's --labels.keep so same should apply to receivers, add new option, tests and fixes as it wasn't working properly
2017-12-02 21:51:31 -08:00
Łukasz Mierzwa
6273a5a585 Rewrite flag & env handling to use viper
This adds support for reading configuration from file, env support is still there and legacy env variables will still work, but flags are now following config schema, so they don't match old flags.
Having a config file allows to express more complex configuration options, which is needed for some feature requests.
2017-11-27 20:34:36 -08:00
Luke Overend
f8c327c2d7 Add REMOVE_RECEIVERS option
This option allows for all alerts for a specified receiver, or list of
receivers, to be removed from unsee.

My use case for this is using a receiver for auto-remediation which will
contain information that the user will never need to see in the UI.
2017-11-24 07:51:07 +00:00
Łukasz Mierzwa
54b1455276 Use dedicated struct for storing alert annotations
Annotations are just string maps, but to render those we need a bit more information (is it a link, should it be visible by default). Store them as more complex structs internally, this also allows us to drop alert.Links since we now have enough information to tell if annotation is a link
2017-09-07 12:15:32 -07:00
Łukasz Mierzwa
3608ccba21 Strip labels in dedup, not on pull
Strippling labels should be done after alerts are deduplicated, when user requests some alerts with a filter, not during data collection from Alertmanager. When labels are stripped before dedup then they are merged into one, because labels are needed to calculate uniqueness, which means we will return wrong data
2017-08-11 12:28:02 -07:00
Łukasz Mierzwa
d1d4a85409 Add a test for total number of alerts we get from mock, should be 24 2017-08-11 12:28:02 -07:00
Łukasz Mierzwa
549ff9eefd Add KEEP_LABELS option for whitelisting labels
This allows to provide a list of labels that are the only labels allowed in the UI, reversing the logic of STRIP_LABELS.
Fixes #170
2017-08-11 12:28:02 -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