Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Apache module to send statistics to Statsd
C Perl ApacheConf JavaScript PHP Shell Makefile
Tag: upstream/1.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
debian
test
.gitignore
DOCUMENTATION
Makefile
README.md
build.pl
mod_statsd.c
statsd.load

README.md

Introduction

This module enables the sending of Statsd statistics directly from Apache, without the need for a CustomLog processor. It will send one counter and one timer per request received.

For a request to www.example.com/foo/bar?baz=42, the stat format would be:

  <prefix.>foo.bar.GET.200<.suffix>

Where <prefix> and <suffix> are optionally configured (see DOCUMENTATION). The path gets converted from /foo/bar to foo.bar and the HTTP method (GET) and the response code (200) are also part the stat.

The module is implemented as a logging hook into Apache's runtime, meaning it runs after your request backend request is completed and data is already being sent to the client.

On my very mediocre VM on my laptop, the average overhead per call was 400 microseconds, and on an AWS c1.medium about 20 microseconds per call. Any high end server hardware should be able to perform better than that.

I've written a companion module for Varnish as well called libvmod-statsd in case you're running Varnish instead/also.

Installation

Source

Make sure you have apxs2 and perl installed, which on Ubuntu you can get by running:

$ sudo apt-get install apache2-dev perl

From the checkout directory run:

$ sudo ./build.pl

This will build, install & enable the module on your system

Debian/Ubuntu

You can install a Debian package from the Krux OpenSource repository by adding this to your apt sources.list (there is nothing lucid specific in the packaging; it should work on any other Debian/Ubuntu install):

deb http://ops.krxd.net/apt/foss lucid production
deb-src http://ops.krxd.net/apt/foss lucid production

And then running the following installation command:

$ sudo apt-get install libapache2-mod-statsd

Configuration

See the DOCUMENTATION file in the same directory as this README for an example configuration as well as all the documentation on the configuration directives supported.

Something went wrong with that request. Please try again.