Skip to content
Apache module to send statistics to Statsd
Branch: master
Clone or download
jib Merge pull request #12 from jib/optional-install
* make it build a newer version, just for apt to pick it up
Latest commit a502e1f Mar 24, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
debian * make it build a newer version, just for apt to pick it up Mar 24, 2015
test * make it possible to filter on HTTP verbs Jun 29, 2014
.gitignore * ignore test log files Jul 21, 2013
DOCUMENTATION * typo Jul 2, 2014
LICENSE Create LICENSE Oct 18, 2013
Makefile * initial import Jul 13, 2013 * update the readme to show how to build packages and to build withou… Mar 4, 2015 * make the install optional; now requires the --install flag to be pa… Mar 4, 2015
statsd.load * initial import Jul 13, 2013


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, the stat format would be:


Where <prefix> and <suffix> are optionally configured (see DOCUMENTATION). The path gets converted from /foo/bar to 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.



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 ./ --install

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


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 lucid production
deb-src lucid production

And then running the following installation command:

$ sudo apt-get install libapache2-mod-statsd

Building your own package

Make sure you have dpkg-dev, cdbs and debhelper installed, which on Ubuntu you can get by running:

$ sudo apt-get install dpkg-dev cdbs debhelper

Then build the package by first compiling the module, then running buildpackage:

$ perl
$ dpkg-buildpackage -d -b


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.

You can’t perform that action at this time.