Tuesday, November 4, 2014

Netty decoder for the collectd binary protocol

EDIT: February, 12 2015

The netty-collectd repository has been deprecated and the code is now maintained in the Hawkular metrics repository.

The first snapshot of netty-collectd, our Netty decoder for the collectd binary protocol, has been pushed to the JBoss.org Maven repository!

What is it?

netty-collectd decodes collectd UDP datagrams. The decoding process results in the creation of so-called Event object instances.

Each Event instance wraps:
  • the sender host (see Hostname in the collectd.conf Global Options)
  • a metric timestamp (when it was collected)
  • the plugin data (plugin and plugin instance names)
  • the type data (type and instance names)
  • the values
  • the interval (how often this metric is collected)

Why was it started?

The RHQ project team is working on turning some of  RHQ's core features into re-usable services. One of them is the RHQ Metrics project, a time-series database with charting.

While RHQ was historically dependent on its agent plugins to gather metrics data, we'd like RHQ Metrics to support some popular collectors/transmitters as well.

Its is planned to re-use netty-collectd in ptrans, our protocol translator (from collect/statsd/... etc to RHQ-Metrics).

How to use it?

The snapshot binaries are hosted in the JBoss Snapshots repository. Refer to the JBoss.org Maven repository guide for setup instructions. Releases will be pushed to Central.

First, add the dependency to your project. For Maven projects:

Then configure your Netty server :

Your handler will look like:


Development is in its early stage, so we're still missing important features, a good test suite... and community feedback!


The decoder is not able to read type files yet. Consequently:
  • sample types cannot be verified
  • it’s not possible to give the sample’s name


The decoder does not yet understand notification messages. They are ignored.

Signed or encrypted traffic

The decoder does not yet support signed or encrypted data.


Like the idea and want to give a hand?
Join us in #rhq.next on Freenode
Twitter: https://twitter.com/RHQ_Project
Forum: https://developer.jboss.org/en/rhq/rhq-metrics


  1. Nice!

    (How) can this be used with pTrans from https://github.com/rhq-project/rhq-metrics/tree/master/clients/ptranslator

  2. Sure. Look at the "Why was it started?" section. Integration with ptrans is what I'm working on starting today.