A grafana dashboard front with graphite datasource and statsd collector as UDP listener
This image contains a sensible default configuration of StatsD, Graphite, Grafana and Cabot alerting.
You should have docker
, docker-compose
installed on your machine. The container exposes the following ports:
80
: the Grafana web interface.8080
: the Graphite web port2003
: the Graphite data port8125
: the StatsD UDP port.9125
: the StatsD repeater’s UDP port.8126
: the StatsD administrative port.9102
: statsD prometheus metrics9090
: prometheus metrics9093
: alertmanagerTo start everything, you need to type following command in your terminal:
docker-compose up -d
To start specifically graphite (or grafana), you can type the service names as:
docker-compose up -d grafana
NOTE Alerts are not started by default
To start alerting, start the alerting containers
docker-compose -f docker-compose-cabot.yml up -d
This repo also contains a makefile to ease interacting with containers.
Starting all services:
$ make up
To stop the container
$ make down
To run container’s shell
$ make shell
To view the container log
$ make tail
Once your container is running all you need to do is:
docker-machine ip
instead of localhost
Adding dashboards is easy. All you need to do is:
+
icon from left menu, click “dashboard”Add Query
and select “graphite” as the datasourcestats.counters.myapp.foo.bar.count
Open localhost:5000 in your browser. It will ask for default credentials for the first timers.
Step 1 - Create instance check
The first step is to check if your alerting system can ping the graphite
service. To do so,
Step 2 - Create instance
graphite
in the Address field (without http://
)Now, once done, visit Checks page again and hopefully you’ll be seeing a passing
status on the check
Cabot has three basic modules:
Since cabot’s take on these modules and how to use them, is very obscure, I will try to document it here and give a rough idea
of how it should be used with this project’s configuration. The whole idea revolves around the “Service based architecture”.
First, we create instances. Name them by their hostname or logical names. For instance, memcache-1, redis-1, redis-2 etc.
Second, create services based on those instances. For instance, memcache service may run on memcache-1. API service may run on api-1, api-2 and memcache-1 (say memcache server has spaces)
Third, create checks to run. Checks can be based on services, or on instances. For ex-
Graphite check
that runs on API service.HTTP check
that runs on memcache-1
instanceChecks are of following types: