Skip to content

Commit 4afb808

Browse files
authored
Merge pull request #1 from innogames/multi_servers
Multiple carbon receivers
2 parents add9652 + 112e35a commit 4afb808

File tree

13 files changed

+646
-459
lines changed

13 files changed

+646
-459
lines changed

.travis.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
language: go
22

33
go:
4-
- 1.7
5-
- master
4+
- 1.10.x
5+
- 1.11.x
6+
- 1.12.x
7+
- 1.x
68

79
before_install:
810
- sudo apt-get -qq update
911
- sudo apt-get install -y libacl1-dev
12+
- go get golang.org/x/lint/golint
1013

11-
script: go install ./...
14+
before_script:
15+
- go vet ./...
16+
- golint ./...
17+
- go test -v ./...
18+
19+
script:
20+
- go install ./grafsy

README.md

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Description [![Build Status](https://travis-ci.org/leoleovich/grafsy.svg?branch=master)](https://travis-ci.org/leoleovich/grafsy)
1+
# Description [![Build Status](https://travis-ci.org/innogames/grafsy.svg?branch=master)](https://travis-ci.org/innogames/grafsy)
22

33
This is a very light proxy for graphite metrics with additional features:
4-
- Taking metrics from network (see [configuration](https://github.com/leoleovich/grafsy#configuration)) or from file directly
4+
- Taking metrics from network (see [configuration](https://github.com/innogames/grafsy#configuration)) or from file directly
55
- Buffering metrics if Graphite itself is down
6-
- Function of summing/averaging metrics with a special prefix (see [configuration](https://github.com/leoleovich/grafsy#configuration))
6+
- Function of summing/averaging metrics with a special prefix (see [configuration](https://github.com/innogames/grafsy#configuration))
77
- Filtering 'bad' metrics, which are not passing check against regexp
88
- Periodical sending to Graphite server to avoid traffic pikes
99

@@ -24,54 +24,54 @@ Also I recommend you to see the presentation https://prezi.com/giwit3kyy0vu/graf
2424
We are using release-based workflow with tags. Please do not add in your CI `master` branch. Use latest tag. For jenkins it might look like this (`+refs/tags/*:refs/remotes/uw/tags/*` and `*/tags/*`):
2525
<img src="https://raw.githubusercontent.com/leoleovich/images/master/Grafsy_jenkins.png" width="500" height="230" />
2626

27-
Please look at [releases](https://github.com/leoleovich/grafsy/releases)
27+
Please look at [releases](https://github.com/innogames/grafsy/releases)
2828

2929
# Configuration
3030

31-
There is a config file which must be located under */etc/grafsy/grafsy.toml*
32-
But you can redefine it with option *-c*
31+
There is a config file which must be located under `/etc/grafsy/grafsy.toml`
32+
But you can redefine it with option `-c`
3333
Most of the time you need to use default (recommended) configuration of grafsy, but you can always modify params:
3434

3535
## Base
3636

37-
- supervisor - Supervisor manager which is used to run Grafsy. e.g. systemd or supervisord. Default is none
38-
- clientSendInterval - The interval, after which client will send data to graphite. In seconds
39-
- metricsPerSecond - Maximum amount of metrics which can be processed per second
40-
In case of problems with connection/amount of metrics, this configuration will take save up to maxMetrics\*clientSendInterval metrics in retryFile
37+
- `supervisor` - supervisor manager which is used to run Grafsy. e.g. systemd or supervisord. Default is none
38+
- `clientSendInterval` - the interval, after which client will send data to graphite. In seconds
39+
- `metricsPerSecond` - maximum amount of metrics which can be processed per second
40+
In case of problems with connection/amount of metrics, this configuration will take save up to `maxMetrics*clientSendInterval` metrics in retryDir
4141
Also these 2 params are exactly allocating memory
42-
- allowedMetrics - Regexp of allowed metric. Every metric which is not passing check against regexp will be removed
43-
- log - Main log file
44-
- hostname - alias to use instead of os.Hostname() result
42+
- `allowedMetrics` - regexp of allowed metric. Every metric which is not passing check against regexp will be removed
43+
- `log` - main log file
44+
- `hostname` - alias to use instead of os.Hostname() result
4545

4646
## Sending and cache
4747

48-
- graphiteAddr - Real Graphite server to which client will send all data
49-
- connectTimeout - Timeout for connecting to graphiteAddr. Timeout for writing metrics themselves will be clientSendInterval-connectTimeout-1. Default 7. In seconds
50-
- localBind - Local address:port for local daemon
51-
- metricDir - Directory, in which developers/admins... can write any file with metrics
52-
- useACL - Enables ACL for metricDir to let grafsy read files there with any permissions. Default is false
53-
- retryFile - Data, which was not sent will be buffered in this file
48+
- `carbonAddrs` - array of carbon metrics receivers.
49+
- `connectTimeout` - timeout for connecting to `carbonAddrs`. Timeout for writing metrics themselves will be `clientSendInterval-connectTimeout-1`. Default 7. In seconds
50+
- `localBind` - local address:port for local daemon
51+
- `metricDir` - directory, in which developers or admins can write any file with metrics
52+
- `useACL` - enables ACL for metricDir to let grafsy read files there with any permissions. Default is false
53+
- `retryDir` - data, which was not sent will be buffered in this directory per carbon server
5454

5555
## Aggregation
5656

57-
- sumPrefix - Prefix for metric to sum. Do not forget to include it in allowedMetrics if you change it
58-
- avgPrefix - Prefix for metric to calculate average. Do not forget to include it in allowedMetrics if you change it
59-
- minPrefix - Prefix for metric to find minimal value. Do not forget to include it in allowedMetrics if you change it
60-
- maxPrefix - Prefix for metric to find maximum value. Do not forget to include it in allowedMetrics if you change it
61-
- aggrInterval - Summing up interval for metrics with all prefixes. In seconds
62-
- aggrPerSecond - Amount of aggregations which grafsy performs per second. If grafsy receives more metrics than aggrPerSecond*aggrInterval - rest will be dropped
57+
- `sumPrefix` - prefix for metric to sum. Do not forget to include it in allowedMetrics if you change it
58+
- `avgPrefix` - prefix for metric to calculate average. Do not forget to include it in allowedMetrics if you change it
59+
- `minPrefix` - prefix for metric to find minimal value. Do not forget to include it in allowedMetrics if you change it
60+
- `maxPrefix` - prefix for metric to find maximum value. Do not forget to include it in allowedMetrics if you change it
61+
- `aggrInterval` - summing up interval for metrics with all prefixes. In seconds
62+
- `aggrPerSecond` - amount of aggregations which grafsy performs per second. If grafsy receives more metrics than `aggrPerSecond * aggrInterval` - rest will be dropped
6363

6464
## Monitoring
6565

66-
- monitoringPath - Full path for metrics, send by grafsy itself. "HOSTNAME" will be replaced with os.Hostname() result from GO.
67-
If os.Hostname() returns result with dots in it - they will be replaced with "_".
68-
You can define your own path. If it does not contain magic "HOSTNAME" word, it will be preserved.
69-
At the end of your path grafsy will append **grafsy.{sent,dropped,got...}**
70-
E.g **servers.HOSTNAME.software** or **servers.my-awesome-hostname**
71-
Default is "HOSTNAME"
66+
- `monitoringPath` - full path for metrics, send by grafsy itself. "HOSTNAME" will be replaced with `os.Hostname()` result from GO.
67+
If os.Hostname() returns result with dots in it - they will be replaced with `_`.
68+
You can define your own path. If it does not contain magic "HOSTNAME" word, it will be preserved.
69+
At the end of your path grafsy will append **grafsy.{sent,dropped,got...}**
70+
E.g **servers.HOSTNAME.software** or **servers.my-awesome-hostname**
71+
Default is "HOSTNAME"
7272

7373
## Overwrite
74-
Grafsy can overwrite metric name. It might be very useful if you have a software, which has hardcoded path. E.g., PowerDNS 3.
74+
Grafsy can overwrite metric name. It might be very useful if you have a software, which has hardcoded path. E.g., PowerDNS 3.
7575
You can specify as many overwrites as you want. Each of them must be in separate section:
7676
```toml
7777
[[overwrite]]
@@ -86,16 +86,15 @@ This will ask Grafsy to replace all kinds of metric starting with **pdns** or ag
8686
# Installation
8787

8888
- Install go https://golang.org/doc/install
89-
- Make a proper structure of directories: ```mkdir -p /opt/go/src /opt/go/bin /opt/go/pkg```
90-
- Setup g GOPATH variable: ```export GOPATH=/opt/go```
91-
- Clone this project to src: ```go get github.com/leoleovich/grafsy```
92-
- Fetch dependencies: ```cd /opt/go/github.com/leoleovich/grafsy && go get ./...```
93-
- Compile project: ```go install github.com/leoleovich/grafsy```
94-
- Copy config file: ```mkdir /etc/grafsy && cp /opt/go/src/github.com/leoleovich/grafsy/grafsy.toml /etc/grafsy/```
95-
- Change your settings, e.g. ```graphiteAddr```
96-
- Create a log folder: ```mkdir -p /var/log/grafsy``` or run grafsy from user, which has permissions to create logfiledir
97-
- Run it ```/opt/go/bin/grafsy```
89+
- Make a proper structure of directories: `mkdir -p /opt/go/src /opt/go/bin /opt/go/pkg`
90+
- Setup g GOPATH variable: `export GOPATH=/opt/go`
91+
- Clone this project to src: `go get github.com/innogames/grafsy`
92+
- Fetch dependencies: `cd /opt/go/github.com/innogames/grafsy && go get ./...`
93+
- Compile project: `go install github.com/innogames/grafsy/grafsy`
94+
- Copy config file: `mkdir /etc/grafsy && cp /opt/go/src/github.com/innogames/grafsy/grafsy.toml /etc/grafsy/`
95+
- Change your settings, e.g. `carbonAddrs`
96+
- Run it `/opt/go/bin/grafsy`
9897

9998
# Godocs
10099

101-
https://godoc.org/github.com/leoleovich/grafsy/grafsy
100+
https://godoc.org/github.com/innogames/grafsy

0 commit comments

Comments
 (0)