scobal/seyren — pull request #142 by obazoud (2013-10-08 11:54:05+00:00)
Title: Live feature

Instead of pulling all metrics with http, this feature allows Seyren to listen carbon relay (see pickle protocol http://graphite.readthedocs.org/en/latest/feeding-carbon.html).

I introduce live package where CarbonPickleListener, the TCP server (quick implementation), is located.
It reads inputstream socket, decode pickle protocol (with the help of jython, see maven dependency), and add a MetricsTask to an executor.
MetricsTask find all checks in MongoDb that are enabled and live, both with true value.
And of course, I re-use CheckRunner to store/send alert.

In "Check Dialog" UI, if "live" option is checked, the method for checking the check will be that described above, otherwise a 'classic' http check is used (default behaviour), it is exclusive.

Users are responsible to filter metrics in relay-rules.conf and not send all metrics to Seyren (to avoid performance problem).

Example: How to send to Seyren only 'load' metrics, edit /opt/graphite/conf/relay-rules.conf like and restart carbon-relay:

[seyren]
pattern = .*load.*
destinations = [ip seyren]:[port]:[instance]
continue = true

[default]
default = true
destinations = [ip carbon cache]:[port]:[instance]

Thera are some limitations:
* carbon-relay must have access Seyren (while http is easiest)
* metric sended via carbon-relay are raw value, you can not access to graphite functions

With this feature, Seyren is more reactive.

Enjoy :)