| 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"
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"
}
}
| |||||||||||||||||||||||||||||||||||
| 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'
}
config("EXPORTER_OTLP_LOGS_ENDPOINT") // do {
my $base = config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318";
$base =~ s[/+$][]r . '/v1/logs'
}
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'
}
| |||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | my $base = config('EXPORTER_OTLP_ENDPOINT') | ||||||||||||||||||||||||||||||||
|
Condition50%1/2
config("EXPORTER_OTLP_ENDPOINT") // "http://localhost:4318"
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")
| |||||||||||||||||||||||||||||||||||
| 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
config(glob("EXPORTER_OTLP_{LOGS_,}COMPRESSION")) // $COMPRESSION
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
| |||||||||||||||||||||||||||||||||||
| 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
config(glob("EXPORTER_OTLP_{LOGS_,}TIMEOUT")) // 10
MC/DC0%0/1
$args{"timeout"} //= config(glob("EXPORTER_OTLP_{LOGS_,}TIMEOUT")) // 10
$args{"timeout"}
Truth table50%1/2
A
A= $args{"timeout"}
| |||||||||||||||||||||||||||||||||||
| 32 | 1 | ▶ | $args{headers} //= config(<EXPORTER_OTLP_{LOGS_,}HEADERS>) // {}; | ||||||||||||||||||||||||||||||||
|
Condition50%2/4
$args{"headers"} //= config(glob("EXPORTER_OTLP_{LOGS_,}HEADERS")) // {}
config(glob("EXPORTER_OTLP_{LOGS_,}HEADERS")) // {}
MC/DC0%0/1
$args{"headers"} //= config(glob("EXPORTER_OTLP_{LOGS_,}HEADERS")) // {}
$args{"headers"}
Truth table50%1/2
A
A= $args{"headers"}
| |||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||
| 34 | 1 | %args; | |||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||
| 36 | 1 | } | |||||||||||||||||||||||||||||||||