l2met

command module
v0.0.0-...-de99981 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2014 License: GPL-3.0 Imports: 13 Imported by: 0

README

An Important Update

L2met was born out of the desire to expose an effortless ingress point into Librato's systems. The project boasted no client libraries, 0-configuration (for the app developer), and percentile calculations. Since the inception of this project, the fine folks at Librato have always taken an interest in l2met. Librato has taken their interest to the extreme in that they now offer a hosted version of l2met. You should be using their service for production metrics. For instructions on how to integrate with Librato's log processing tier, see their knowledge base article and their Heroku integration page.

This project is no longer maintained. It will remain here as a historical artifact. If you have a use case that doesn't allow you to use Librato's hosted l2met, please open a support ticket with Librato.

Thanks for all of the contributions. I can take very little credit for the ideas that made l2met what it is today. Such OSS. Thanks to Heroku for providing me a home while I was developing this project. Finally, thanks to Librato for furthering the state of the art in metrics.

– Ryan Smith

l2met

Turn these:

$stdout.puts("measure#db.latency=4ms")
$stdout.puts("count#db.vaccum=1")
$stdout.puts("sample#db.size=100GB")

Into this:

img

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.

Getting Started

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://drone.io/github.com/ryandotsmith/l2met/files/l2met.tar.gz | tar xvz
$ ./scripts/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

Hacking on l2met

L2met is an open source, community project. Patches are welcome. Open an issue prior to submitting a patch to ensure that your patch will be accepted. You will also receive tips & tricks on how to best implement your patch.

Communcation
Documentation
Running Tests

Build Status

$ ./redis-server --version
Redis server v=2.6.14 sha=f2f2b4eb:0 malloc=libc bits=64
$ go version
go version go1.1.1 darwin/amd64
$ git clone git://github.com/ryandotsmith/l2met.git $GOPATH/src/github.com/ryandotsmith/l2met
$ cd $GOPATH/src/github.com/ryandotsmith/l2met
$ export SECRETS=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | openssl base64)
$ export TZ=UTC
$ export REDIS_URL=redis://localhost:6379
$ ./redis-server &
$ go test ./...

Documentation

Overview

L2met converts a formatted log stream into metrics.

Directories

Path Synopsis
Provides helpers for authentication & authorization via HTTP.
Provides helpers for authentication & authorization via HTTP.
A collection of measurements.
A collection of measurements.
Conf exposes a data structure containing all of the l2met configuration data.
Conf exposes a data structure containing all of the l2met configuration data.
An internal metrics channel.
An internal metrics channel.
The outlet pkg is responsible for taking buckets from the reader, formatting them in the Librato format and delivering the formatted librato metrics to Librato's API.
The outlet pkg is responsible for taking buckets from the reader, formatting them in the Librato format and delivering the formatted librato metrics to Librato's API.
The parser is responsible for reading the body of the HTTP request and returning buckets of data.
The parser is responsible for reading the body of the HTTP request and returning buckets of data.
The reader pkg is responsible for reading data from the store, building buckets from the data, and placing the buckets into a user-supplied channel.
The reader pkg is responsible for reading data from the store, building buckets from the data, and placing the buckets into a user-supplied channel.
Receiver provides mechanisms to read log requests, extract measurements from log requests, aggregate measurements in buckets, and flush buckets into a memory store.
Receiver provides mechanisms to read log requests, extract measurements from log requests, aggregate measurements in buckets, and flush buckets into a memory store.
The store pkg is responsible for coordinating bucket transfer between the receivers (front-end) and readers & outlets (back-end).
The store pkg is responsible for coordinating bucket transfer between the receivers (front-end) and readers & outlets (back-end).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL