riemann.influxdb

Forwards events to InfluxDB. Supports both 0.8 and 0.9 APIs.

event->point-8

(event->point-8 event)

Transform a Riemann event to an InfluxDB point, or nil if the event is missing a metric or service.

event->point-9

(event->point-9 tag-fields event)

Converts a Riemann event into an InfluxDB point if it has a time, service, and metric.

event-fields

(event-fields tag-fields event)

Generates a map of InfluxDB fields from a Riemann event. The event’s metric is converted to the value field, and any additional event fields which are not standard Riemann properties or in tag-fields will also be present.

event-tags

(event-tags tag-fields event)

Generates a map of InfluxDB tags from a Riemann event. Any fields in the event which are named in tag-fields will be converted to a string key/value entry in the tag map.

events->points-8

(events->points-8 series-fn events)

Takes a series fn that finds the series for a given event, and a sequence of events, and emits a map of series names to vectors of points for that series.

events->points-9

(events->points-9 tag-fields events)

Converts a collection of Riemann events into InfluxDB points. Events which map to nil are removed from the final collection. Also filter out NaNs that influxdb can’t deal with currently.

influxdb

(influxdb opts)

Returns a function which accepts an event, or sequence of events, and writes them to InfluxDB as a batch of measurement points. For performance, you should wrap this stream with batch or an asynchronous queue.

(influxdb {:host “influxdb.example.com” :db “my_db” :user “riemann” :password “secret”})

General Options:

:version Version of InfluxDB client to use. Should be one of :0.8 or :0.9. (default: :0.8)

:db Name of the database to write to. (default: "riemann")

:scheme URL scheme for endpoint. (default: "http")

:host Hostname to write points to. (default: "localhost")

:port API port number. (default: 8086)

:username Database user to authenticate as. (optional)

:password Password to authenticate with. (optional)

:insecure If scheme is https and certficate is self-signed. (optional)

See influxdb-8 and influxdb-9 for version-specific options.

influxdb-8

(influxdb-8 opts)

Returns a function which accepts an event, or sequence of events, and sends it to InfluxDB. Compatible with the 0.8.x series.

; For giving series name as the concatenation of :host and :service fields ; with dot separator.

(influxdb-8 {:host “play.influxdb.org” :port 8086 :series #(str (:host %) “.” (:service %))})

0.8 Options:

:name Name of the metric which is same as the series name.

:series Function which takes an event and returns the InfluxDB series name to use. Defaults to :service. If this function returns nil, series names default to “riemann-events”.

influxdb-9

(influxdb-9 opts)

Returns a function which accepts an event, or sequence of events, and writes them to InfluxDB. Compatible with the 0.9.x series. (influxdb-9 {:host “influxdb.example.com” :db “my_db” :retention “raw” :tag-fields #{:host :sys :env}}) 0.9 Options: :retention Name of retention policy to use. (optional) :tag-fields A set of event fields to map into InfluxDB series tags. (default: #{:host}) :tags A common map of tags to apply to all points. (optional) :timeout HTTP timeout in milliseconds. (default: 5000)

kv-encode-9

(kv-encode-9 kv)

lineprotocol-encode-9

(lineprotocol-encode-9 event)

replace-disallowed-9

(replace-disallowed-9 field)

special-fields

A set of event fields in Riemann with special handling logic.