Exporter/OTLP/Logs.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond 41.6% 10 / 24 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 58.3% 35 / 60 CC 10 SCAR 27.0
CC
10
Cov
69%
BUILDARGS
19.0
BEGIN
1.0
BEGIN
1.0
CRAP 14.9
↑ Summary Exporter/OTLP/Encoder/JSON.pm »
1 1 ▶use Object::Pad ':experimental(init_expr)';
Subroutine BEGIN: called CC=1 SCAR=0.0
2 # ABSTRACT: An OpenTelemetry Protocol log exporter
3  
4 package OpenTelemetry::Exporter::OTLP::Logs;
5  
6 1 our $VERSION = '0.022';
7  
8 1 ▶class OpenTelemetry::Exporter::OTLP::Logs :isa(OpenTelemetry::Exporter::OTLP) {
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶ use OpenTelemetry::Common 'config';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶ my $COMPRESSION = eval { require Compress::Zlib; 'gzip' } // 'none';
Condition50%1/2
eval { do { require Compress::Zlib; "gzip" } } // "none"
l!l
10
MC/DC0%0/1
eval { do { require Compress::Zlib; "gzip" } } // "none"
eval { do { require Compress::Zlib; "gzip" } }
Truth table50%1/2
A
A= eval { do { require Compress::Zlib; "gzip" } }
Aresult
11
00
12  
13 1 ▶ sub BUILDARGS ( $class, %args ) {
Subroutine BUILDARGS: called CC=10 SCAR=29.4
Pod undocumented
14 $args{endpoint}
15 //= config('EXPORTER_OTLP_LOGS_ENDPOINT')
16 1 ▶ // do {
Condition33%2/6
$args{"endpoint"} //= config("EXPORTER_OTLP_LOGS_ENDPOINT") // do { my $base = config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318"; $base =~ s[/+$][]r . '/v1/logs' }
l!l&&r!l&&!r
010
config("EXPORTER_OTLP_LOGS_ENDPOINT") // do { my $base = config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318"; $base =~ s[/+$][]r . '/v1/logs' }
l!l&&r!l&&!r
010
MC/DC0%0/3
$args{"endpoint"} //= config("EXPORTER_OTLP_LOGS_ENDPOINT") // do { my $base = config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318"; $base =~ s[/+$][]r . '/v1/logs' }
$args{"endpoint"} config("EXPORTER_OTLP_LOGS_ENDPOINT") do { my $base = config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318"; $base =~ s[/+$][]r . '/v1/logs' }
Truth table0%0/4
A //= B // C
A= $args{"endpoint"}B= config("EXPORTER_OTLP_LOGS_ENDPOINT")C= do { my $base = config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318"; $base =~ s[/+$][]r . '/v1/logs' }
ABCresult
1XX1
01X1
0011
0000
17 1 ▶ my $base = config('EXPORTER_OTLP_ENDPOINT')
Condition50%1/2
config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318"
l!l
01
MC/DC0%0/1
config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318"
config("EXPORTER_OTLP_ENDPOINT")
Truth table50%1/2
A
A= config("EXPORTER_OTLP_ENDPOINT")
Aresult
11
00
18 // 'http://localhost:4318';
19  
20 1 ( $base =~ s|/+$||r ) . '/v1/logs';
21 };
22  
23 # We cannot rely on the defaults on the base OTLP exporter
24 # because at least for now, that one defaults to the TRACES
25 # variables. Once it doesn't, we can simplify this to match
26 # the code in the Traces exporter
27 $args{compression}
28 1 ▶ //= config(<EXPORTER_OTLP_{LOGS_,}COMPRESSION>)
Condition33%2/6
$args{"compression"} //= config(glob("EXPORTER_OTLP_{LOGS_,}COMPRESSION")) // $COMPRESSION
l!l&&r!l&&!r
010
config(glob("EXPORTER_OTLP_{LOGS_,}COMPRESSION")) // $COMPRESSION
l!l&&r!l&&!r
010
MC/DC0%0/3
$args{"compression"} //= config(glob("EXPORTER_OTLP_{LOGS_,}COMPRESSION")) // $COMPRESSION
$args{"compression"} config(glob("EXPORTER_OTLP_{LOGS_,}COMPRESSION")) $COMPRESSION
Truth table0%0/4
A //= B // C
A= $args{"compression"}B= config(glob("EXPORTER_OTLP_{LOGS_,}COMPRESSION"))C= $COMPRESSION
ABCresult
1XX1
01X1
0011
0000
29 // $COMPRESSION;
30  
31 1 ▶ $args{timeout} //= config(<EXPORTER_OTLP_{LOGS_,}TIMEOUT>) // 10;
Condition50%2/4
$args{"timeout"} //= config(glob("EXPORTER_OTLP_{LOGS_,}TIMEOUT")) // 10
l!l
01
config(glob("EXPORTER_OTLP_{LOGS_,}TIMEOUT")) // 10
l!l
01
MC/DC0%0/1
$args{"timeout"} //= config(glob("EXPORTER_OTLP_{LOGS_,}TIMEOUT")) // 10
$args{"timeout"}
Truth table50%1/2
A
A= $args{"timeout"}
Aresult
11
00
32 1 ▶ $args{headers} //= config(<EXPORTER_OTLP_{LOGS_,}HEADERS>) // {};
Condition50%2/4
$args{"headers"} //= config(glob("EXPORTER_OTLP_{LOGS_,}HEADERS")) // {}
l!l
01
config(glob("EXPORTER_OTLP_{LOGS_,}HEADERS")) // {}
l!l
01
MC/DC0%0/1
$args{"headers"} //= config(glob("EXPORTER_OTLP_{LOGS_,}HEADERS")) // {}
$args{"headers"}
Truth table50%1/2
A
A= $args{"headers"}
Aresult
11
00
33  
34 1 %args;
35 }
36 1 }
↑ Summary Exporter/OTLP/Encoder/JSON.pm »