Alert dashboard for Prometheus Alertmanager
Clone or download
prymitive Merge pull request #370 from prymitive/fix-docker-deploy-on-tag
fix(deploy): trigger docker deploy on new tag
Latest commit 1c1c6be Jan 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo chore(deps): update golang docker tag to v1.11.4 Dec 18, 2018
docs feat(backend): add support for custom headers (#368) Jan 17, 2019
hooks Put the branch name first on the version string for docker master builds Apr 20, 2017
internal feat(backend): add support for custom headers (#368) Jan 17, 2019
ui fix(deps): update dependency @sentry/browser to v4.5.2 Jan 16, 2019
.commitlintrc.js feat(ci): lint commit messages on Travis Sep 26, 2018
.dockerignore fix(docker): remove old dir from dockerignore file Nov 30, 2018
.gitignore feat(backend): add support for custom headers (#368) Jan 17, 2019
.golangci.yml chore(ci): drop gocyclo Dec 1, 2018
.nvmrc chore(deps): update node.js to v10.15.0 Dec 26, 2018
.travis.yml fix(deploy): trigger docker deploy on new tag Jan 17, 2019
.yarnrc chore(yarn): add a yarnrc to enforce add --exact Oct 3, 2018
CONTRIBUTING.md chore(project): migrate from dep to Go modules Dec 21, 2018
Dockerfile chore(deps): update golang docker tag to v1.11.4 Dec 18, 2018
LICENSE Update license file to contain full license Jun 16, 2017
Makefile feat(build): use Go modules to install all cli tools Jan 16, 2019
README.md fix(docs): update docker repository locations Oct 29, 2018
_config.yml Set theme jekyll-theme-cayman Jun 7, 2018
alertGroup.png chore(docs): update screenshots Oct 27, 2018
alerts.go chore(api): drop counters from API response Jan 5, 2019
api_test.go chore(api): drop counters from API response Jan 5, 2019
assets.go chore(backend): rename function for clarity Dec 27, 2018
assets_test.go fix(backend): return 404 if custom asset files are missing Dec 27, 2018
autocomplete.go chore(project): rename from unsee to karma Sep 9, 2018
autocomplete_test.go chore(project): rename from unsee to karma Sep 9, 2018
go.mod feat(build): use Go modules to install all cli tools Jan 16, 2019
go.sum feat(build): use Go modules to install all cli tools Jan 16, 2019
main.go feat(backend): add support for custom headers (#368) Jan 17, 2019
main_test.go chore(project): rename from unsee to karma Sep 9, 2018
proxy.go chore(style): reformat proxy.go Oct 24, 2018
proxy_test.go feat(tests): add a test case for proxying to sub-URI Oct 24, 2018
renovate.json chore(renovate): bump renovate PR limit to 3 Dec 23, 2018
screenshot.png chore(docs): update screenshots Oct 27, 2018
timer.go chore(project): rename from unsee to karma Sep 9, 2018
tools.go feat(build): use Go modules to install all cli tools Jan 16, 2019
views.go chore(api): drop counters from API response Jan 5, 2019
views_test.go chore(api): drop counters from API response Jan 5, 2019

README.md

karma

Alert dashboard for Prometheus Alertmanager.

Alertmanager UI is useful for browsing alerts and managing silences, but it's lacking as a dashboard tool - karma aims to fill this gap. Starting with 0.7.0 release it can also aggregate alerts from multiple Alertmanager instances, running either in HA mode or separate. Duplicated alerts are deduplicated so only unique alerts are displayed. Each alert is tagged with names of all Alertmanager instances it was found at and can be filtered based on those tags (@alertmanager). Note that @alertmanager tags will be visible only if karma is configured with multiple Alertmanager instances.

Screenshot

Alerts are displayed grouped preserving group_by configuration option in Alertmanager. If a group contains multiple alerts only first few alerts will be presented, the rest can be expanded or hidden using - / + buttons. The default number of alerts can be configured in the UI settings module. Each individual alert will only show unique labels and annotations, labels and annotations that are shared between all alerts will be moved to the footer. Example:

Example

Each group can be collapsed to only show the title bar using top right toggle icon.

Online demo

To get notifications about new karma releases you can subscribe to the RSS feed that GitHub provides To get email notifications please use one of the free services providing RSS to email notifications, like Blogtrottr.

History

I created karma while working for Cloudflare, originally it was called unsee. This project is based on that code but the UI part was rewritten from scratch using React. New UI required changes to the backend so the API is also incompatible. Given that the React rewrite resulted in roughly 50% of new code and to avoid confusion for user I've decided to rename it to karma, especially that the original project wasn't being maintained anymore.

Supported Alertmanager versions

Alertmanager's API isn't stable yet and can change between releases, see VERSIONS in internal/mock/Makefile for list of all Alertmanager releases that are tested and supported by karma. Due to API differences between those releases some features will work differently or be missing, it's recommended to use the latest supported Alertmanager version.

Security

The karma process doesn't send any API request to the Alertmanager that could modify alerts or silence state, but it does provide a web interface that allows a user to send such requests directly to the Alertmanager API. If you wish to deploy karma as a read-only tool please ensure that:

  • the karma process is able to connect to the Alertmanager API
  • read-only users are able to connect to the karma web interface
  • read-only users are NOT able to connect to the Alertmanager API

Metrics

karma process metrics are accessible under /metrics path by default. If you set the --listen.prefix option a path relative to it will be used.

Building and running

Building from source

To clone git repo and build the binary yourself run:

git clone https://github.com/prymitive/karma $GOPATH/src/github.com/prymitive/karma
cd $GOPATH/src/github.com/prymitive/karma

To finally compile karma the binary run:

make

Note that building locally from sources requires Go, nodejs and yarn. See Docker build options below for instructions on building from withing docker container.

Running

karma can be configured using config file, command line flags or environment variables. Config file is the recommended method, it's also the only way to configure karma to use multiple Alertmanager servers for collecting alerts. To run karma with a single Alertmanager server set ALERTMANAGER_URI environment variable or pass --alertmanger.uri flag on the command line, with Alertmanager URI as argument, example:

ALERTMANAGER_URI=https://alertmanager.example.com karma
karma --alertmanager.uri https://alertmanager.example.com

There is a make target which will compile and run karma:

make run

By default it will listen on port 8080 and Alertmanager mock data will be used, to override Alertmanager URI set ALERTMANAGER_URI and/or PORT make variables. Example:

make PORT=5000 ALERTMANAGER_URI=https://alertmanager.example.com run

Docker

Running pre-build docker image

Official docker images are built and hosted on hub.docker.com.

Images are built automatically for:

  • release tags in git - lmierzwa/karma:vX.Y.Z
  • master branch commits - lmierzwa/karma:latest

Examples

To start a release image run:

docker run -e ALERTMANAGER_URI=https://alertmanager.example.com lmierzwa/karma:vX.Y.Z

Latest release details can be found on GitHub.

To start docker image build from lastet master branch run:

docker run -e ALERTMANAGER_URI=https://alertmanager.example.com lmierzwa/karma:latest

Note that latest master branch might have bugs or breaking changes. Using release images is strongly recommended for any production use.

Building a Docker image

make docker-image

This will build a Docker image from sources.

Running the Docker image

make run-docker

Will run locally built Docker image. Same defaults and override variables apply as with make run. Example:

make PORT=5000 ALERTMANAGER_URI=https://alertmanager.example.com run-docker

Configuration

Please see CONFIGURATION for full list of available configuration options and example.yaml for a config file example.

Contributing

Please see CONTRIBUTING for details.

License

Apache License 2.0, please see LICENSE.