NAME
Collectd::Plugin::Read::Message::Passing - Write collectd metrics via Message::Passing
SYNOPSIS
<LoadPlugin perl>
Globals true
</LoadPlugin>
<Plugin perl>
BaseName "Collectd::Plugin"
LoadPlugin "Read::Message::Passing"
<Plugin "Read::Message::Passing">
# MANDATORY - You MUST configure an output class
inputclass "ZeroMQ"
<OutputOptions>
connect "tcp://192.168.0.1:5552"
</OutputOptions>
# OPTIONAL - Defaults to JSON
#decoderclass "JSON"
#<decoderoptions>
#</decoderoptions>
</Plugin>
</Plugin>
Will consume metrics like this:
{
"plugin":"ElasticSearch",
"time":1341656031.18621,
"values":[
{
"value":0,
"min":0,
"name":"indices.get.time",
"max":0,
"type":0
}
],
"type":"indices.get.time",
"interval":10,
"host":"t0m.local"
}
or, for multi-value metrics:
{
"plugin":"load",
"time":1341655869.22588,
"type":"load",
"values":[
{
"value":0.41,
"min":0,"max":100,"name":"shortterm","type":1
},
{
"value":0.13,
"min":0,
"max":100,
"name": "midterm",
"type":1
},
{
"value":0.08
"min":0,
"max":100,
"name":"longterm",
"type":1
}
],
"interval":10,
"host":"t0m.local"
}
DESCRIPTION
A collectd plugin to consume metrics from Message::Passing into collectd.
WARNING: This plugin is pre-alpha, and collectd causes blocking - may only work with ZeroMQ, or not at all.
PACKAGE VARIABLES
%CONFIG
A hash containing the following:
inputclass
The name of the class which will act as the Message::Passing output. Will be used as-is if prefixed with +
, otherwise Message::Passing::Input::
will be prepended. Required.
inputoptions
The hash of options for the input class. Not required, but almost certainly needed.
decoderclass
The name of the class which will act the Message::Passing decoder. Will be used as-is if prefixed with +
, otherwise Message::Passing::Filter::Decoder::
will be prepended. Optional, defaults to JSON.
decoderoptions
The hash of options for the decoder class.
readtimeslice
The amount of time to block in Message::Passing's read loop. Defaults to 0.25 seconds, which could not be enough if you are consuming a lot of metrics..
FUNCTIONS
config
Called first with configuration in the config file, munges it into the format expected and places it into the %CONFIG
hash.
init
Validates the config, and initializes the $INPUT
read
Blocks for a metric to the output in $INPUT
.
BUGS
Blocking collectd for a fixed time to allow the AnyEvent loop to run is a horrible horrible way of reading.