Alt-NewRelic-Agent-FFI-Empty
view release on metacpan or search on metacpan
lib/NewRelic/Agent/FFI.pm view on Meta::CPAN
)
}
sub begin_external_segment
{
shift @_;
goto &NewRelic::Agent::FFI::Procedural::newrelic_segment_external_begin;
}
sub end_segment
{
shift @_;
goto &NewRelic::Agent::FFI::Procedural::newrelic_segment_end;
}
sub get_license_key { shift->{license_key} }
sub get_app_name { shift->{app_name} }
sub get_app_language { shift->{app_language} }
sub get_app_language_version { shift->{app_language_version} }
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
NewRelic::Agent::FFI - Perl Agent for NewRelic APM
=head1 VERSION
version 0.03
=head1 SYNOPSIS
use NewRelic::Agent::FFI;
my $agent = NewRelic:Agent::FFI->new(
license_key => 'abc123',
app_name => 'REST API',
);
$agent->embed_collector;
$agent->init;
my $txn_id = $agent->begin_transaction;
...
my $err_id = $agent->end_transaction($txn_id);
=head1 DESCRIPTION
B<NOTE>: This module is deprecated. It is based on the NewRelic Agent SDK, which was only
ever released as beta software. Please use L<NewFangle> instead.
This module provides bindings for the L<NewRelic|https://docs.newrelic.com/docs/agents/agent-sdk/getting-started/new-relic-agent-sdk> Agent SDK.
It is a drop in replacement for L<NewRelic::Agent> that is implemented using L<FFI::Platypus> instead of XS and C++. If you are writing
new code, then I highly recommend the procedural interface instead: L<NewRelic::Agent::FFI::Procedural>.
Why use L<NewRelic::Agent::FFI> module instead of L<NewRelic::Agent>?
=over 4
=item Powerful L<Alien> technology
This module uses L<Alien::nragent> to either download the NR agent or to use a locally installed copy. The other module has
L<a serious bug which will break when the install files are removed|https://github.com/aanari/NewRelic-Agent/issues/2>! You
can choose the version of the NR SDK that you want to use instead of relying on the maintainer of L<NewRelic::Agent> to do so.
=item Possible license issues
Related to the last point, the other module bundles the NR SDK, which may have legal risks (I am not a lawyer). In the very least
I think goes against the Open Source philosophy of CPAN.
=item No C++ compiler required!
Since this module is built with powerful FFI and Platypus technology, you don't need to build XS bindings for it. The
other module has its bindings written in C++, which is IMO unnecessary and doesn't add anything.
=item Tests!
The test suite for L<NewRelic::Agent> is IMO insufficient to have confidence in it, especially if the SDK needs to be upgraded.
This module comes with a number of tests that will at least make sure that the calls to NewRelic will not crash your application.
The live test can even be configured (not on by default) to send data to NR so that you can be sure it works.
=item Active Development
At least as of this writing, this module is being actively developed. The other module has a number of unanswered open issues,
bugs and pull requests.
=back
Why use the other module instead of this one?
=over 4
=item This module is newer
The other module has been around for longer, and may have been used in production more. Peoples will probably have noticed if it
were broken by now.
=back
=head1 CONSTRUCTOR
=head2 new
my $agent = NewRelic::Agent::FFI->new(%options);
Instantiates a new NewRelic::Agent client object. Options include:
=over 4
=item C<license_key>
A valid NewRelic license key for your account.
This value is also automatically sourced from the C<NEWRELIC_LICENSE_KEY> environment variable.
=item C<app_name>
The name of your application.
This value is also automatically sourced from the C<NEWRELIC_APP_NAME> environment variable.
=item C<app_language>
The language that your application is written in.
This value defaults to C<perl>, and can also be automatically sourced from the C<NEWRELIC_APP_LANGUAGE> environment variable.
=item C<app_language_version>
The version of the language that your application is written in.
This value defaults to your perl version, and can also be automatically sourced from the C<NEWRELIC_APP_LANGUAGE_VERSION> environment variable.
=back
( run in 1.719 second using v1.01-cache-2.11-cpan-2398b32b56e )