Coder Social home page Coder Social logo

krux / mod_statsd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jib/mod_statsd

3.0 11.0 1.0 54 KB

Apache module to send statistics to Statsd

License: MIT License

Makefile 0.23% Perl 21.69% C 74.83% PHP 1.07% Shell 0.80% JavaScript 1.37%

mod_statsd's Introduction

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

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

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 build.pl
$ dpkg-buildpackage -d -b

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.

mod_statsd's People

Contributors

jib avatar zimathias avatar sbrimhall-sfdc avatar dllopis-sfdc avatar

Stargazers

Gabriel Francisco avatar  avatar Kevin Le Brun avatar

Watchers

 avatar  avatar Charlie Schluting avatar Rajen Shah avatar James Cloos avatar  avatar  avatar Prashanth Jonnalagadda avatar Wanderley Liu avatar David Richards avatar  avatar

Forkers

arthurzenika

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.