There is one supported backend for now: Graphite, the opensource timeseries database. Cerebro currently integrates with Seyren to store alarms, schedule checks and send alerts. Why not use vanilla Seyren? Because we thought an on-top interface would better meet our requirements for managing large sets of alarms in a collaborative manner, and making alerting over various types of metrics more accessible to Graphite non-experts.
We try to keep Cerebro as stateless as possible (over backends): no user profile, no ownership over alarms (this one is more a 'DevOps decision' than a 'stateless decision'), stateless authentication (we currently use JWT with Keycloak for auth).
Expect Cerebro to integrate with other backends in the future: Elasticsearch / ElastAlert, possibly Grafana 4 alerting feature, etc.
Code structure (Maven modules) :
Runtime dependencies (see the Run section):
$ mvn clean verify $ cd docker $ docker-compose up
Links:
-
Dashboard: http://localhost
-
Services healthcheck: http://localhost:8080/cerebro-services/health
-
Services API contract: http://localhost:8080/cerebro-services/v2/api-docs
-
Services API Swagger UI: http://localhost:8080/cerebro-services/swagger-ui.html
Note
|
Local IP may be different for Docker Toolbox users. |
You may want to check the sources in the docker
module: Dockerfile
, default properties, backends versions, etc.
The docker-compose up
command builds the src image (which contains sources and config files) then runs lots of things:
-
Graphite (v0.9.14): http://localhost:8081/
-
Docker image for Graphite: sitespeedio/graphite:0.9.14
-
-
collectd to feed Graphite with metrics
-
MongoDB (v3.2), required by Seyren
-
Seyren (v1.5.0): http://localhost:8000/
$ curl http://localhost:8888/api/checks $ curl http://localhost:8888/api/alerts?start=0&items=20
-
Cerebro Services: http://localhost:8080/cerebro-services
-
Cerebro Dashboard: http://localhost
For development and local tests, we often use spring-boot:run
or standard java -jar
, plus NPM to run the dashboard (Graphite and Seyren services must be running).
Services layer:
$ cd services $ mvn spring-boot:run
Dashboard:
$ cd dashboard $ npm install $ npm start
Links:
-
Dashboard: http://localhost:51010/
-
Services healthcheck: http://localhost:8080/cerebro-services/health
-
Services API contract: http://localhost:8080/cerebro-services/v2/api-docs
-
Services API Swagger UI: http://localhost:8080/cerebro-services/swagger-ui.html
For standard deployment run scenarios (meaning without Docker, Maven or NPM), we use standard java -jar
(services) and Apache HTTPd (dashboard).
Services layer:
$ cd services $ java -jar target/cerebro-services-1.0.0-SNAPSHOT.jar
Note
|
that is not what we do (make JAR not WAR), but some might prefer to build a WAR then deploy it to <insert_best_java_server_available>. |
Dashboard:
To run the dashboard (Angular 2 with routing) with Apache 2, extract the TAR.GZ file to HTTPd and check the .htaccess
instructions:
RewriteEngine On # If an existing asset or directory is requested go to it as it is RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ - [L] # If the requested resource doesn't exist, use index.html RewriteRule ^ /index.html
Note
|
Any static resource Web server should do the job. |
Location: services/src/main/resources/config
.
Main properties are:
-
From
email.properties
:-
server
- The SMTP service host -
port
- The SMTP service port -
sender
- The notification 'from' email
-
-
From
instance.properties
:-
seyren.host
- The Seyren backend instance -
graphite.sources[0].url
- The Graphite backend instance
-
Location: dashboard/config
.
Main properties are:
-
From
globals.json
:-
services_url
- The Cerebro service layer URL -
theme.headerImage
- The Cerebro top-background image URL -
theme.logo
- The Cerebro loading-logo image URL -
contacts.xxxxxx
- Insert your own wiki, email, issue tracker, etc. here, for users to get these links in the Learn more… page- IMPORTANT
-
the Cerebro default logo/background images are links to external images from the X-Men licence/movies. Those images are not part of Cerebro sources, only their URL is embedded, merely illustrating a possible look’n’feel for the application. Please replace them with other resources of your own and customize the logo/background for your needs.
-