Skip to content

Commit 8569b75

Browse files
committed
in_opentelemetry: if scope is not set, pack an empty map
Signed-off-by: Eduardo Silva <[email protected]>
1 parent cad68ff commit 8569b75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/in_opentelemetry/opentelemetry_logs.c

+5
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,7 @@ static int binary_payload_to_msgpack(struct flb_opentelemetry *ctx,
13421342

13431343
/* Scope */
13441344
scope = scope_log->scope;
1345+
13451346
if (scope && (scope->name || scope->version || scope->n_attributes > 0)) {
13461347
flb_mp_map_header_init(&mh_tmp, &mp_pck);
13471348

@@ -1386,6 +1387,10 @@ static int binary_payload_to_msgpack(struct flb_opentelemetry *ctx,
13861387

13871388
flb_mp_map_header_end(&mh_tmp);
13881389
}
1390+
else {
1391+
/* set an empty scope */
1392+
msgpack_pack_map(&mp_pck, 0);
1393+
}
13891394

13901395
flb_mp_map_header_end(&mh);
13911396

0 commit comments

Comments
 (0)