Skip to content

Commit c76b937

Browse files
committed
remove client folder, make proto smaller, other fixes
1 parent 30413d7 commit c76b937

File tree

7 files changed

+50
-147
lines changed

7 files changed

+50
-147
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ riemann-relay
22
riemann-relay.exe
33
riemann-relay.dev.toml
44
vendor*
5+
client*

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
language: go
22

3-
sudo: false
43
go:
5-
- tip
4+
- 1.x
65
before_install:
76
- go get github.com/mattn/goveralls
87
script:

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go)
55

66
# riemann-relay
7-
This is a service that receives a Riemann Protobuf-formatted event stream and sends it to a one or more targets in Riemann or Graphite format.
7+
This is a service that receives a Riemann Protobuf-formatted event stream and sends it to one or more targets in Riemann or Graphite format.
88
Although that can be done in Riemann itself, this service is simpler, probably faster and lightweight (no Java)
99

1010
## Features
@@ -16,19 +16,23 @@ Although that can be done in Riemann itself, this service is simpler, probably f
1616
- Hash
1717
- Failover
1818
- Broadcast
19+
* Optional failover to other targets if the selected one is down (in Hash and Round-Robin modes)
1920
* Prometheus metrics
2021
* Log stats periodically
2122
* Configurable batch and buffer sizes, flush intervals, timeouts
2223

23-
See *riemann-relay.toml* for more details on these features and how to configure them
24+
See *riemann-relay.toml* for more details on features and how to configure them
2425

2526
## Performance
26-
On 2 average CPU cores it's able to handle about 500k events per second, depending on batch size and incoming riemann message sizes.
27+
On 2 average CPU cores it's able to handle about 500k events per second, depending on batch size and incoming Riemann message sizes.
2728
It will scale to more CPUs when using more targets and clients (each target and client gets it's own thread).
2829
There's a room for optimizations, though.
2930

31+
## Install
32+
For now in the releases only binaries for *linux-amd64* are available. For other platforms see the *Build* section below.
33+
3034
## Build
31-
**riemann-relay** is written in Go and uses Dep as a dependency manager, so you need to install them first.
35+
**riemann-relay** is written in [Go](https://golang.org/) and uses [dep](https://github.com/golang/dep) as a dependency manager, so you need to install them first.
3236

3337
Then:
3438
```bash

client/main.go

Lines changed: 0 additions & 47 deletions
This file was deleted.

riemann-relay.toml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ type = "carbon"
3434
algo = "hash"
3535

3636
# Try to send to a random live target if the target selected by roundrobin/hash algorithms is dead.
37-
# Obviously makes no sense for broadcast/failover algorithms.
37+
# Obviously this makes no sense for broadcast/failover algorithms.
3838
#
39-
# If this is false then the events for the down targets will be accumulated in their buffers and,
39+
# If this is 'false' then the events for the down targets will be accumulated in their buffers and,
4040
# if the target is down for an extended period of time, new events will be discarded.
4141
#
42-
# Be aware that the status of the target is not be reflected instantly and some metrics might anyway
43-
# go to target's buffer while it's considered alive.
42+
# Be aware that the status of the target is not be reflected instantly and some small number of metrics
43+
# might anyway go to target's buffer while it's still considered alive.
4444
algo_failover = false
4545

4646
# List of Riemann event fields to use as a hashing key, required if the 'algo' is 'hash'
47-
# These are evaluated left-to-right.
47+
# These are evaluated left-to-right, although for hashing purposes it does not matter.
4848
#
4949
# Possible values:
5050
# - state
@@ -63,8 +63,8 @@ algo_failover = false
6363
# If there's no tag/attribute found by this name then it's ignored
6464
hash_fields = [ "attr:foo", "host", "service", "tag:bar" ]
6565

66-
# List of Riemann event fields to use to form a Carbon metric name, required if output type is 'carbon'
67-
# The values of the fields are joined together with a '.' separator per Carbon specs
66+
# List of Riemann event fields to use to form a Carbon metric name, required if output type is 'carbon'.
67+
# The values of the fields are joined together with a '.' separator per Carbon specs.
6868
#
6969
# For syntax see 'hash_fields' parameter up there.
7070
carbon_fields = [ "attr:prefix", "host", "service" ]
@@ -77,7 +77,7 @@ carbon_fields = [ "attr:prefix", "host", "service" ]
7777
# - float
7878
# - double
7979
# - any
80-
#
80+
#
8181
# If you specify 'any' then all fields are checked (double -> int -> float)
8282
# and first non-zero is used as a value. If all of them are zero then zero is used.
8383
# This is probably the same that Riemann itself does according to docs.
@@ -88,18 +88,19 @@ carbon_value = "any"
8888
# List of IP:Port targets
8989
targets = [ "1.1.1.1:1234", "2.2.2.2:1234", "3.3.3.3:1234" ]
9090

91-
# Output metric buffer size *per target* (count of events)
91+
# Output metric buffer size *per target* (number of events)
9292
#
93-
# If the target is down then the metrics are accumulated in this buffer until the target is up again
94-
# If the buffer is full then new metrics will be discarded
93+
# If the target is down then the metrics are accumulated in this buffer until
94+
# the target is up again (unless 'algo_failover' is 'true')
95+
# If the buffer is full then new metrics will be discarded.
9596
buffer_size = 2000000
9697

97-
# Count of metrics/events to send in one iteration
98+
# Number of metrics/events to send in one iteration.
9899
#
99100
# For Carbon this is a number of metrics in a single TCP write (larger batch -> fewer system calls)
100-
# For Riemann this is a number of events sent in a single Protobuf message
101-
#
102-
# If the amount of pending metrics is equal to this value then they're flushed immediately
101+
# For Riemann this is a number of events sent in a single Protobuf message.
102+
#
103+
# If the amount of pending metrics is equal to this value then they're flushed immediately.
103104
# If it's less then it will be flushed every 'batch_timeout'
104105
batch_size = 50
105106

riemann.pb.go

Lines changed: 24 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

riemann.proto

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ message Event {
1616
float metric_f = 15;
1717
}
1818

19-
message Query {
20-
string string = 1;
21-
}
22-
2319
message Msg {
2420
bool ok = 2;
2521
string error = 3;
26-
Query query = 5;
2722
repeated Event events = 6;
2823
}
2924

0 commit comments

Comments
 (0)