Add tests for feature custom resource attributes

This commit is contained in:
puhre 2024-05-28 14:35:09 +02:00
parent 158c55feff
commit c39f33420b
4 changed files with 32 additions and 4 deletions

View file

@ -46,6 +46,10 @@ http {
batch_count 2;
}
otel_resource_attr {
service.namespace test;
}
otel_service_name test_server;
otel_trace on;
@ -156,7 +160,7 @@ foreach my $name ('localhost') {
or die "Can't create certificate for $name: $!\n";
}
$t->try_run('no OTel module')->plan(69);
$t->try_run('no OTel module')->plan(70);
###############################################################################
@ -203,6 +207,9 @@ is(scalar keys %{$$batch1{scope_spans}}, 5, 'batch1 size - trace on');
#validate general attributes
is(get_attr("service.name", "string_value",
$$batch0{resource}), 'test_server', 'service.name - trace on');
is(get_attr("service.namespace", "string_value",
$$batch0{resource}),
'test', 'service.namespace - trace on');
is($$spans{span0}{name}, '"default_location"', 'span.name - trace on');
#validate http metrics