AWS::XRay - AWS X-Ray tracing library
use AWS::XRay qw/ trace /; trace "myApp", sub { trace "remote", sub { # do something ... trace "nested", sub { # ... }; }; trace "myHTTP", sub { my $segment = shift; # ... $segment->{http} = { # modify segument document request => { method => "GET", url => "http://localhost/", }, response => { status => 200, }, }; }; };
AWS::XRay is a tracing library with AWS X-Ray.
AWS::XRay sends segment data to AWS X-Ray Daemon.
Generate a Trace ID. (e.g. "1-581cf771-a006649127e371903a2de979")
Document
trace() executes $code->($segment) and send the segment document to X-Ray daemon.
$segment is a AWS::XRay::Segment object.
When $AWS::XRay::TRACE_ID is not set, generates TRACE_ID automatically.
When trace() called in parent trace(), $segment is a sub segment document.
See also AWS X-Ray Segment Documents.
Set a address for X-Ray daemon. defult "127.0.0.1".
AWS::XRay->daemon_host("example.com");
Set a UDP port number for X-Ray daemon. defult 2000.
AWS::XRay->daemon_port(2002);
Default true. When set false, trace() executes sub but do not send segument documents to X-Ray daemon.
Copyright (C) FUJIWARA Shunichiro.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
FUJIWARA Shunichiro <fujiwara.shunichiro@gmail.com>
To install AWS::XRay, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AWS::XRay
CPAN shell
perl -MCPAN -e shell install AWS::XRay
For more information on module installation, please visit the detailed CPAN module installation guide.