Showing posts with label Clojure. Show all posts
Showing posts with label Clojure. Show all posts

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

Thursday, August 9, 2012

clj-pdf, Clojure PDF library and instant-pdf, a RESTful PDF generation service

By Vasudev Ram


[ UPDATE: I emailed the author of clj-pdf and instant-pdf, and he told me two things: 1) the instant-pdf bug mentioned below seems to be due to a Clojure JSON library (see the comments on this post), and does not occur when clj-pdf is used directly, and 2) clj-pdf uses the iText PDF library for generating PDF. ]

Saw this via proggit (programming.reddit.com):

clj-pdf is a Clojure library for PDF generation.

instant-pdf is a RESTful web service for PDF generation, built using clj-pdf. It supports JSON for markup. Interesting approach.
It has a fairly large JSON syntax for many elements of PDF, like metadata, text, paragraphs, chapters, colors, tables, etc.

I tried it out a bit. What I tried mostly worked, except for one issue - pasting a DOS directory listing into the text box (for the content section), resulted in PDF output that contained the string "null" instead of backslashes, e.g. for a path like C:\abc\def\some-file.

clj-pdf uses JFreeChart.

P.S. I liked this blog post: WHY ALL THE PARENS, by yogthos, the author of clj-pdf.

- Vasudev Ram - Dancing Bison Enterprises

Friday, March 16, 2012

Python becoming a platform for Clojure