Giter VIP home page Giter VIP logo

plack-middleware-statsd's Introduction

NAME

Plack::Middleware::StatsD - Plack middleware for logging request/response data with StatsD

VERSION

version 0.0200

SYNOPSIS

use Plack::Builder;
use Plack::Middleware::StatsD;

my $app = sub { ... } # as usual

# StatsD Options
my %options = (
    host => '127.0.0.1',
    port => 8125,
    sample_rate => 0.5,
    prefix => 'myapp',
    whitelist => sub {
        my ($req) = @_;
        ...
        # Return true to process, false to ignore
    },
    stat_name_mapper => sub {
        my ($req) = @_;
        ...
        # Return what to name the stat for this request
        return $req->path;
    },
);

builder {
    enable "Plack::Middleware::StatsD", %options;
    $app;
};

With the above in place, Plack::Middleware::StatsD will increment counters to PREFIX.STATUS_CODE and PREFIX./url/path.STATUS_CODE to your statsd server.

It will also time your responses under PREFIX./url/path.time to your statsd server as well.

AUTHOR

William Wolf [email protected]

COPYRIGHT AND LICENSE

William Wolf has dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law.

Works under CC0 do not require attribution. When citing the work, you should not imply endorsement by the author.

plack-middleware-statsd's People

Contributors

throughnothing avatar

Watchers

 avatar James Cloos avatar

plack-middleware-statsd's Issues

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.