2016-07-06 21:25:41 +00:00
|
|
|
# Graphite-ish
|
2016-07-06 19:59:26 +00:00
|
|
|
|
2016-07-08 09:27:17 +00:00
|
|
|
[Graphite](http://graphiteapp.org/) project consists of three components that designed to work together:
|
2016-07-06 21:25:41 +00:00
|
|
|
|
2016-07-07 20:02:52 +00:00
|
|
|
* `carbon` daemon that accepts and stores metrics
|
|
|
|
* `whisper` database where metrics are kept
|
|
|
|
* `web` app that reads metrics and processes them using a comprehensive list of
|
|
|
|
supported functions
|
2016-07-07 19:25:43 +00:00
|
|
|
|
2016-07-07 20:02:52 +00:00
|
|
|
Every component exposes several APIs that are used by other components. All of
|
2016-07-08 22:29:36 +00:00
|
|
|
them are written in Python.
|
2016-07-07 20:02:52 +00:00
|
|
|
|
2016-07-08 09:27:17 +00:00
|
|
|
Two more components are often used together with `Graphite`:
|
2016-07-07 20:02:52 +00:00
|
|
|
|
2016-07-08 22:29:36 +00:00
|
|
|
* [StatsD](https://github.com/etsy/statsd) — a Node.js app that accepts metrics
|
2016-07-07 20:02:52 +00:00
|
|
|
and aggregates them before submitting to `carbon`;
|
2016-07-08 09:27:17 +00:00
|
|
|
* [Grafana](https://github.com/grafana/grafana) — web dashboard for `Graphite` (and
|
2016-07-07 20:02:52 +00:00
|
|
|
other backends)
|
2016-07-06 21:25:41 +00:00
|
|
|
|
2016-07-08 22:31:12 +00:00
|
|
|
### So what?
|
|
|
|
|
2016-07-07 20:02:52 +00:00
|
|
|
This set of images replaces original `carbon` daemon and `StatsD` aggregation
|
|
|
|
daemon with other compatible components to improve
|
|
|
|
[performance](https://github.com/lomik/go-carbon/tree/v0.7.2#performance) and
|
|
|
|
[throughput](https://github.com/github/brubeck/tree/5d139a4#faq).
|
|
|
|
|
|
|
|
Grafana 3 is also included.
|
2016-07-06 21:25:41 +00:00
|
|
|
|
2016-07-07 20:02:52 +00:00
|
|
|
### Included images
|
2016-07-08 09:27:17 +00:00
|
|
|
| Component | Version | |
|
|
|
|
|-----------|---------|---|
|
2016-07-08 22:29:36 +00:00
|
|
|
| [go-carbon](https://github.com/lomik/go-carbon/tree/v0.7.2) | `v0.7.2` | Drop-in replacement for original `carbon` daemon, written in Go |
|
|
|
|
| [Brubeck](https://github.com/github/brubeck/tree/5d139a4) | `5d139a4` | Easy replacement for `StatsD`, written in C |
|
|
|
|
| [Graphite API](https://github.com/brutasse/graphite-api) | `latest` | A piece of original `Graphite Web` component with less features |
|
|
|
|
| [Grafana](https://github.com/grafana/grafana/tree/v3.1.0-beta1) | `v3.1.0-beta1` | Beautiful dashboard for all of that |
|
2016-07-06 21:25:41 +00:00
|
|
|
|
2016-07-07 19:33:23 +00:00
|
|
|
## Building
|
2016-07-06 19:59:26 +00:00
|
|
|
|
2016-07-07 19:29:04 +00:00
|
|
|
Make sure [Docker](https://www.docker.com/products/docker) and
|
|
|
|
[Docker Compose](https://www.docker.com/products/docker-compose) are installed.
|
|
|
|
|
2016-07-08 22:21:23 +00:00
|
|
|
```bash
|
2016-07-07 19:33:23 +00:00
|
|
|
$ make graphite fast
|
2016-07-06 19:59:26 +00:00
|
|
|
```
|
2016-07-06 21:25:41 +00:00
|
|
|
|
2016-07-07 19:33:23 +00:00
|
|
|
### Re-building
|
2016-07-06 21:25:41 +00:00
|
|
|
|
2016-07-08 22:21:23 +00:00
|
|
|
```bash
|
2016-07-07 19:33:23 +00:00
|
|
|
$ make graphite fast again
|
|
|
|
```
|
|
|
|
|
|
|
|
## Starting
|
|
|
|
|
2016-07-08 22:21:23 +00:00
|
|
|
```bash
|
2016-07-07 19:33:23 +00:00
|
|
|
$ make run
|
2016-07-06 21:25:41 +00:00
|
|
|
```
|
2016-07-08 14:34:06 +00:00
|
|
|
|
|
|
|
## Using
|
|
|
|
|
2016-07-08 22:29:36 +00:00
|
|
|
* Open `Grafana` dashboard at `http://[docker-host]:3000/`, sign in as `admin`/`admin`
|
2016-07-08 14:34:06 +00:00
|
|
|
* Create new data source of type `Graphite` that points to `http://graphite-api:8000`
|
2016-07-08 22:23:10 +00:00
|
|
|
* Create a new chart with a test metric (`test.ping` in this example)
|
2016-07-08 14:34:06 +00:00
|
|
|
* Start sending metrics to `StatsD`-compatible endpoint
|
2016-07-08 22:29:36 +00:00
|
|
|
* Metrics should show up on `Grafana` dashboard
|
2016-07-08 14:34:06 +00:00
|
|
|
|
|
|
|
You can send metrics right from terminal:
|
|
|
|
|
2016-07-08 22:21:23 +00:00
|
|
|
```bash
|
|
|
|
# 1000 times
|
2016-07-08 22:24:17 +00:00
|
|
|
# Send "test.ping:1|C\n"
|
2016-07-08 22:21:23 +00:00
|
|
|
# Verbose, Using UDP, Timeout 1s
|
|
|
|
# To StatsD port on Docker
|
2016-07-08 22:23:10 +00:00
|
|
|
$ for i in {1..1000}; do echo "test.ping:1|C" | nc -v -u -w1 `docker-machine ip` 8126; done
|
2016-07-08 14:34:06 +00:00
|
|
|
```
|
2016-07-25 12:49:49 +00:00
|
|
|
|
|
|
|
Data is kept in `/data/graphite/whisper` directory on the host machine.
|