ganglia/monitor-core — pull request #124 by satterly (2013-11-03 02:49:55+00:00)
Title: Add support for forwarding Ganglia metrics to Riemann event stream processor

Previously, to forward metrics from Ganglia to Riemann the Graphite carbon protocol had to be used. This was not ideal because string metrics weren't supported and much of the meta data associated with a Ganglia metric were lost.

It is possible to encode some of this meta data (like grid, cluster and host) into the carbon metric name but this does not work for the host IP address, location data or any tags configured for that cluster or host. In addition there is no way to pass arbitrary key-value attributes with a metric.

Using the native Riemann protocol based on Google Protocol Buffers solves these issues and mapping Ganglia metric attributes to Riemann fields is straight-forward.

# +-------------------+----------------+
# | Ganglia | Riemann |
# |-------------------|----------------|
# | grid | grid |
# | cluster | cluster |
# | host | host* |
# | ip | ip |
# | metric | service* |
# | value(int,float) | metric* |
# | type | (internal) |
# | units | description* |
# | value(string) | state* |
# | reported | time* |
# | tags(comma-sep) | tags* |
# | location | location |
# | tmax | ttl* |
# +-------------------+----------------+

For example, a Ganglia metric like the following:
```
LOCATION="madrid" GMOND_STARTED="1383444832">

```
Will be marshalled by Riemann as:
```
#riemann.codec.Event{
:host "myhost",
:service "swap_free",
:state nil,
:description "KB",
:metric 391768.0,
:tags ["os:linux,cloud=AWS/EC2"],
:time 345861311493/250,
:ttl 180.0,
:environment "PROD",
:customer "Acme Corp",
:location "madrid",
:ip "10.0.2.15",
:cluster "unspecified",
:grid "MyGrid"
}
```