Plack::Middleware::NewRelic - Plack middleware for NewRelic APM instrumentation
version 0.0502
use Plack::Builder; use Plack::Middleware::NewRelic; my $app = sub { ... } # as usual # NewRelic Options my %options = ( license_key => 'asdf1234', app_name => 'REST API', ); builder { enable "Plack::Middleware::NewRelic", %options; $app; };
With the above in place, Plack::Middleware::NewRelic will instrument your Plack application and send information to NewRelic, using the NewRelic::Agent module.
Parameters
license_key
A valid NewRelic license key for your account.
This value is also automatically sourced from the NEWRELIC_LICENSE_KEY environment variable.
NEWRELIC_LICENSE_KEY
app_name
The name of your application.
This value is also automatically sourced from the NEWRELIC_APP_NAME environment variable.
NEWRELIC_APP_NAME
path_rules
A HashRef containing path replacement rules, containing case-insensitive regex patterns as string keys, and evaluatable strings as replacement values.
Regex capturing groups work as intended, so you can specify something like this in your ruleset:
# Replaces '/pages/new/asdf' with '/pages/new' '(\/pages\/new)\/\S+' => '$1'
Please report any bugs or feature requests on the bugtracker website https://github.com/aanari/Plack-Middleware-NewRelic/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.
Ali Anari <ali@anari.me>
This software is copyright (c) 2015 by Ali Anari.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Plack::Middleware::NewRelic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::NewRelic
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::NewRelic
For more information on module installation, please visit the detailed CPAN module installation guide.