Saturday, June 8, 2013

Riemann and Bernhard, a distributed systems monitor and Python client


(Updated the post to fix two errors; see below.)

Riemann is a monitoring tool for distributed systems.

https://github.com/aphyr/riemann

It seems to be named after the famous mathematician Riemann:

http://www.google.com/m?q=riemann

Riemann and its configuration files are written in Clojure.

I saw Riemann recently and took a brief look at it, also looked at some of the related links below, and found it pretty interesting.

A brief overview of Riemann:

You write a Riemann configuration file in Clojure.

This file describes what events from what systems (i.e. hosts on your network) you are interested in, and how you want Riemann to handle them.

Though Clojure is a Lisp, the Riemann config file syntax is easy to understand, even without looking at the documentation (for simple uses, anyway, such as in the easier examples).

Processing can include things like summarization (within or across hosts, event types, threshholds, etc.), grouping, filtering, emailing alerts to concerned entities based on events or the (conditional) results of processing events, and even some support for taking action on events, such as restarting a process that has failed.

Riemann also has integrations with Graphite and Librato Metrics.

(It was interesting to see that Librato is headed by Fred van den Bosch, who was earlier a senior technology executive (CTO, SVP) at Veritas Software (now part of Symantec), where I worked earlier.)

Riemann clients, which can of course be servers of various kinds, send events to Riemann using (Google's) Protocol Buffers, over TCP or UDP.

http://en.m.wikipedia.org/wiki/Protocol_Buffers

http://code.google.com/p/protobuf/

Client libraries for Riemann are available for several popular languages, and there is a guide to writing your own client.

http://riemann.io/clients.html

Bernhard is a Python client library for Riemann.

https://github.com/banjiewen/bernhard

It seems straightforward to use for simple cases:
you import the Client class from Bernhard, create an instance of it, and call methods on it, to send events that are of interest to Riemann, to be processed and acted upon.

Riemann also comes with a web dashboard written with Ruby and Sinatra.

(Updated the paragraph below for errors in the spelling of the Riemann author's name, and the names of the big users.)

I wrote to Kyle Kingsbury (@aphyr on Twitter), the creator of Riemann; he said that there are at least a few big Riemann users, like The Guardian and the New York Times.

Related links for Riemann:

https://news.ycombinator.org/item?id=4962849

A Python wrapper for Riemann that used Bernhard:

https://github.com/exoscale/python-riemann-wrapper

http://www.spootnik.org/entries/2013/05/21_using-riemann-to-monitor-
python-apps.html

A Node.js tool inspired partly by Riemann:

http://blog.nodejitsu.com/waiting-for-godot

- Vasudev Ram
dancingbison.com

No comments: