32 Commits
Author SHA1 Message Date
Łukasz Mierzwa c1a4e30bbd Add --version flag
This is useful to get the version from the compiled binary without the need to run it
2018-01-26 18:21:40 -08:00
Łukasz Mierzwa 60b1c696a3 Too many 'T' in NewHTTTPTransport 2018-01-24 13:04:27 -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 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 e23b00c080 Fix listen address and port passing
Only HOST & PORT env variables used by gin internally were really used, pass resulting config to gin so we match documentation, and log it on startup
2017-12-03 10:26:41 -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 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
Łukasz Mierzwa 38339c887e Use gzip middlerware to compress responses if client can accept compressed content
Some alert.json responses are going to be big, compress it to save bandwidth
2017-08-08 11:28:17 -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 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 32a1145150 We'll get a panic if user sets zero or negative TTL value, add a check 2017-07-10 09:05:47 -07:00
Łukasz Mierzwa 71c0dce1f6 Vendor renamed Sirupsen/logrus to sirupsen/logrus, fix imports 2017-07-02 10:12:33 -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 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
Ł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 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 9cbf784baf Provide more startup logs
This will help with debugging issues
2017-05-09 18:02:08 +01:00
Łukasz Mierzwa 487d7bcde8 Use alert status, inhibitedBy & silencedBy fields instead of silenced & inhibited 2017-05-01 22:20:12 +01:00
Łukasz Mierzwa acea192a3d Obey WEB_PREFIX for metrics endpoint 2017-04-23 08:56:53 -07:00
Łukasz Mierzwa 8f3fd319f4 Add inbibited label to exposed metrics 2017-04-17 14:06:30 -07:00
Łukasz Mierzwa 0936f1b9c1 We issue 3 requests on startup now, update log message 2017-04-06 19:24:48 -07:00
Łukasz MierzwaandJeppe Toustrup 0d82cffd79 Add -web.prefix / WEB_PREFIX option
This allows people to use unsee with a sub uri setup, which is pretty common usa case, fixes #22
2017-03-30 19:35:52 +01:00
Łukasz Mierzwa 1ba5228cb1 Move view setup after all middleware
prometheus middleware needs to be initialized first, before any view is created
2017-03-28 10:26:13 -07:00
Łukasz Mierzwa fd7d3a3585 Move runtime config logging into separate function
This should only happen when needed, so moving this to a dedicated function that is called on startup
2017-03-28 09:10:15 -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 3de3a9c481 Generate flag for each environment key
This allows to set config keys via flags, in additions to current env variable only configuration. Flags are autogenerated from supported env keys.
2017-03-26 13:38:37 -07:00
Łukasz MierzwaandGitHub e239fd05fd Import code from internal repository (#1)
Import code from internal repository
2017-03-23 16:58:04 -07:00