Skip to content

robrwo/Plack-Middleware-Statsd

Repository files navigation

NAME

Plack::Middleware::Statsd - send statistics to statsd

SYNOPSIS

use Plack::Builder;
use Net::Statsd::Tiny;

builder {

  enable "Statsd",
    client      => Net::Statsd::Tiny->new( ... ),
    sample_rate => 1.0;

  ...

  sub {
    my ($env) = @_;

    # Send statistics via other middleware

    if (my $stats = $env->{'psgix.monitor.statsd'}) {

      $stats->increment('myapp.wibble');

    }

  };

};

DESCRIPTION

This middleware gathers metrics from the application send sends them to a statsd server.

RECENT CHANGES

Changes for version v0.8.2 (2025-08-11)

  • Documentation
    • Removed redundant section.
  • Tests
    • Added more author tests.

See the Changes file for more details.

REQUIREMENTS

This module lists the following modules as runtime dependencies:

See the cpanfile file for the full list of prerequisites.

INSTALLATION

The latest version of this module (along with any dependencies) can be installed from CPAN with the cpan tool that is included with Perl:

cpan Plack::Middleware::Statsd

You can also extract the distribution archive and install this module (along with any dependencies):

cpan .

You can also install this module manually using the following commands:

perl Makefile.PL
make
make test
make install

If you are working with the source repository, then it may not have a Makefile.PL file. But you can use the Dist::Zilla tool in anger to build and install this module:

dzil build
dzil test
dzil install --install-command="cpan ."

For more information, see How to install CPAN modules.

SUPPORT

Only the latest version of this module will be supported.

This module requires Perl v5.20 or later. Future releases may only support Perl versions released in the last ten (10) years.

Reporting Bugs and Submitting Feature Requests

Please report any bugs or feature requests on the bugtracker website https://github.com/robrwo/Plack-Middleware-Statsd/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

If the bug you are reporting has security implications which make it inappropriate to send to a public issue tracker, then see SECURITY.md for instructions how to report security vulnerabilities.

SOURCE

The development version is on github at https://github.com/robrwo/Plack-Middleware-Statsd and may be cloned from git://github.com/robrwo/Plack-Middleware-Statsd.git

Please see CONTRIBUTING.md for more information on how to contribute to this project.

AUTHOR

Robert Rothenberg [email protected]

The initial development of this module was sponsored by Science Photo Library https://www.sciencephoto.com.

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018-2025 by Robert Rothenberg.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

SEE ALSO

Net::Statsd::Client

Net::Statsd::Tiny

PSGI

About

send statistics to statsd from Plack

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages