line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Application::Plugin::OpenTracing::DataDog; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
1824679
|
use parent 'CGI::Application::Plugin::OpenTracing'; |
|
10
|
|
|
|
|
1334
|
|
|
10
|
|
|
|
|
64
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = 'v0.1.0'; |
6
|
|
|
|
|
|
|
|
7
|
10
|
|
|
10
|
|
485670
|
use Carp qw( croak carp ); |
|
10
|
|
|
|
|
30
|
|
|
10
|
|
|
|
|
550
|
|
8
|
10
|
|
|
10
|
|
4982
|
use Import::Into; |
|
10
|
|
|
|
|
5330
|
|
|
10
|
|
|
|
|
310
|
|
9
|
|
|
|
|
|
|
|
10
|
10
|
|
|
10
|
|
5447
|
use Readonly; |
|
10
|
|
|
|
|
40894
|
|
|
10
|
|
|
|
|
2349
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Readonly $IMPLEMENTATION_NAME_PACKAGE => 'DataDog'; |
13
|
|
|
|
|
|
|
Readonly $IMPLEMENTATION_NAME_NOOP => 'NoOp'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
10
|
|
|
10
|
|
124
|
my $package = shift; |
19
|
10
|
|
|
|
|
35
|
my @implementation_import_opts = @_; |
20
|
|
|
|
|
|
|
|
21
|
10
|
|
|
|
|
39
|
my $caller = caller; |
22
|
10
|
|
|
|
|
195
|
my $implementation_name = _get_implementation_name(); |
23
|
|
|
|
|
|
|
|
24
|
9
|
|
|
|
|
168
|
CGI::Application::Plugin::OpenTracing->import::into( |
25
|
|
|
|
|
|
|
$caller, |
26
|
|
|
|
|
|
|
$implementation_name, |
27
|
|
|
|
|
|
|
default_service_name => $caller, |
28
|
|
|
|
|
|
|
default_service_type => 'web', |
29
|
|
|
|
|
|
|
default_resource_name => '', |
30
|
|
|
|
|
|
|
@implementation_import_opts |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
9
|
|
|
|
|
15133
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _get_implementation_name { |
39
|
|
|
|
|
|
|
defined ($ENV{OPENTRACING_IMPLEMENTATION} ) |
40
|
10
|
100
|
|
10
|
|
88
|
or |
41
|
|
|
|
|
|
|
return $IMPLEMENTATION_NAME_PACKAGE; |
42
|
|
|
|
|
|
|
|
43
|
3
|
100
|
|
|
|
16
|
$ENV{OPENTRACING_IMPLEMENTATION} eq $IMPLEMENTATION_NAME_PACKAGE |
44
|
|
|
|
|
|
|
and |
45
|
|
|
|
|
|
|
return $IMPLEMENTATION_NAME_PACKAGE; |
46
|
|
|
|
|
|
|
|
47
|
2
|
100
|
|
|
|
30
|
$ENV{OPENTRACING_IMPLEMENTATION} eq $IMPLEMENTATION_NAME_NOOP |
48
|
|
|
|
|
|
|
and |
49
|
|
|
|
|
|
|
return $IMPLEMENTATION_NAME_NOOP; |
50
|
|
|
|
|
|
|
|
51
|
1
|
|
|
|
|
8
|
croak join q{ }, |
52
|
|
|
|
|
|
|
"Environment variable 'OPENTRACING_IMPLEMENTION' must be", |
53
|
|
|
|
|
|
|
"'$IMPLEMENTATION_NAME_PACKAGE' or '$IMPLEMENTATION_NAME_NOOP'", |
54
|
|
|
|
|
|
|
"not '$ENV{OPENTRACING_IMPLEMENTATION}'", |
55
|
|
|
|
|
|
|
; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |