Turn these:
$stdout.puts("measure#db.latency=4ms")
$stdout.puts("count#db.vaccum=1")
$stdout.puts("sample#db.size=100GB")
Into this:
L2met receives HTTP requests that contain a body of RFC5424 formatted data. Commonly, data is drained into l2met by logplex or log-shuttle. Once data is delivered, l2met extracts and parses the log lines using the logging conventions and then stores the data in redis so that l2met outlets can read the data, build metrics, and deliver the metrics to your Librato account.
Checkout the wiki for information related to: usage, architecture, and administration.
The easiest way to get l2met up and running is to deploy to Heroku. This guide assumes you have already created a Heroku & Librato account.
$ curl https://s3-us-west-2.amazonaws.com/l2met/v2.0beta/linux/amd64/l2met.tar.gz | tar xvz
$ ./setup my-l2met e@foo.com abc123
...
Drain URL: https://long-token@my-l2met.herokuapp.com/logs
This command will create Heroku app named my-l2met and return a drain URL with encrypted Librato credentials for a Librato account with email e@foo.com and an API token of abc123. After you have created my-l2met, you can add the drain URL to a Heroku app. A copy of the log stream will be delivered to my-l2met and metrics will be sent to the Librato account which your provided in the setup.
$ heroku drains:add https://long-token@my-l2met.herokuapp.com/logs -a myapp
Before working on a new feature, send your proposal to the mailing list for tips & feedback. Be sure to work on a feature branch and submit a PR when ready.
$ go version
go version go1.1.1 darwin/amd64
$ git clone git://github.com/ryandotsmith/l2met.git
$ cd l2met
$ export SECRETS=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | openssl base64)
$ export TZ=UTC
$ go test ./...