Plugin:Write Riemann

From collectd Wiki
Jump to: navigation, search
Write Riemann plugin
Type: write
Callbacks: config, notification, write
Status: supported
First version: 5.3
Copyright: 2012,2013 Pierre-Yves Ritschard
2013 Florian Forster
License: MIT license
Manpage: collectd.conf(5)
List of Plugins

The Write Riemann plugin stores values in Riemann, a stream processing and monitoring system.

Riemann is a stream processing system that can be used for querying, manipulating and visualizing value streams. This makes Riemann a powerful and useful companion for collectd because it allows more sophisticated alerting than is possible with collectd's built-in thresholds.

The Write Riemann plugin uses UDP packets or a TCP connection to send data to Riemann. The data is binary encoded using Protocol Buffers (protobuf), see section #Example data below.

You can configure multiple Node blocks to send data to multiple instances of Riemann. You can use the name specified in the block to send data selectively, using filters. For example, if you configure the connection to an instance of Riemann with

<Node "foobar">
  # ...

you can write to this instance only using the block syntax of the Write target:

<Target "write">
  Plugin "write_riemann/foobar"


<Plugin "write_riemann">
 <Node "example">
   Host "localhost"
   Port "5555"
   Protocol UDP
   StoreRates true
   AlwaysAppendDS false
 Tag "foobar"

This will register a writer with the name write_riemann/example.

Example data

Data is sent as Msg objects, encoded in a protobuf. You can find the definition of the message types in src/riemann.proto.

events {
  time: 1358875608
  service: "cpu-0/cpu-idle"
  host: ""
  attribute {
    key: "plugin"
    value: "cpu"
  attribute {
    key: "plugin_instance"
    value: "0"
  attribute {
    key: "type"
    value: "cpu"
  attribute {
    key: "type_instance"
    value: "idle"
  attribute {
    key: "ds_type"
    value: "derive:rate"
  attribute {
    key: "ds_name"
    value: "value"
  attribute {
    key: "ds_index"
    value: "0"
  ttl: 20
  metric_d: 66.600990955859146


  • The <google/protobuf-c/protobuf-c.h> header file.



Currently, Riemann provides a precision of one second. We recommend to use at least a two-second interval when sending data to Riemann, to avoid "duplicate" metrics when the time is rounded to the nearest second.

See also