I've been setting up an ELK stack to collect various metrics. Most of them will come from hosts where I can't afford installing Logstash, so I plan to use Beats.
For logs, it's quite trivial, thanks to Filebeat, but I also want to ship data that are currently stored in RRD files (created by Munin, SmokePing…).
For those who don't know, RRD is a simplified database, with constant very efficient disk usage. A lot of data can fit in a small file and the granularity increases over time. The most recent metrics are quite precise (for example 5 minutes of granularity) and the most ancient metrics are reaggregated in 1 day buckets. There is a rock solid library to manipulate RRD files : rrdtools (http://oss.oetiker.ch/rrdtool/index.en.html).
I'd like to start developing a beat for shipping RRD data to ES or Logstash, using the libbeat framework. I'm an experienced developer (mostly Ruby) but I'm brand new to Go and its ecosystem.
I've noticed the beat-generator project, but there is a lot coming with it : Docker, Python virtualenv, Glide, Go, libbeat… and it's a bit overwhelming. Is it the best way to begin with Beats ? Or is it too young and not enough stable/documented for a Go beginner ?
Glad to hear you are building a beat. I think what went wrong here is setting the full go path to your repository. The line here (https://github.com/jlecour/rrdbeat/blob/master/main.go#L8) should be github.com/jlecour/rrdbeat/beater
I'm not sure if here something went wrong during the generation (did you set your github name?) or if it si a problem in the generator. Normally it should work
This is definitively the right way to start with a beat. I'm currently working on making it even easier. Let me know if changes above work.
@Jeremy_Lecour There are probably more incorrect paths, as the path was probably not set correctly during the setup. See also here: https://github.com/jlecour/rrdbeat/blob/master/beater/rrdbeat.go#L12 Best is to search for it and replace it. Or in case you haven't made changes to the repo yet, you could generate a new version and make sure the path is correct.
Let me know in case you hit some more issues so we can fix it.
I just made a fork of your repo and tried it locally. All seems to work as expected. I think there is an issue with where you have placed your sources:
You have your source code in:
~/code/go/github.com/jlecour/rrdbeat
But the GOPATH is:
~/code/go/src/github.com/jlecour/rrdbeat
You are missing the src in your path. Setting up the GOPATH and where to place the sources is often confusing when getting started with Golang Placing all your code under src should get it working.
I've managed (code not pushed yet) to use the RRD library.
Now I have to find how to use a registry (like Filebeat does) to keep track of RRD files and offsets.
Is there some documentation or extracted code about that or I have to dive deep in Filebeat's source code (which seems a bit complicated, with lots of parts) ?
Some notes on the long term development: We introduced the data.path recently as we expect more beats to need to persist data / state. One of the ideas is to have a generic support for the registry in libbeat (obviously not the case yet). Second TBH it would be very nice if RRD would just be one more prospector in filebeat, like an extension. I'm in the process on abstracting more and more parts of the prospector and harvester to make it easier to extend filebeat (like you can do with module in Metricbeat), but that is also not right around the corner yet.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.