Skip to content

Commit

Permalink
in_opentelemetry: fix groups encoding by closing headers properly
Browse files Browse the repository at this point in the history
Groups encoding where not closing the msgpack map header, additionaly once the
group header was finished instead of closing it we were appending the group finalization
record (-2).

Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Feb 26, 2025
1 parent 127e6cc commit 2baf050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/in_opentelemetry/opentelemetry_logs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ static int binary_payload_to_msgpack(struct flb_opentelemetry *ctx,
msgpack_pack_uint64(&mp_pck, resource->dropped_attributes_count);
}


flb_mp_map_header_end(&mh_tmp);

if (resource_log->schema_url) {
flb_mp_map_header_append(&mh);
Expand Down Expand Up @@ -1396,7 +1396,7 @@ static int binary_payload_to_msgpack(struct flb_opentelemetry *ctx,
goto binary_payload_to_msgpack_end;
}

flb_log_event_encoder_group_end(encoder);
flb_log_event_encoder_group_header_end(encoder);

msgpack_sbuffer_clear(&mp_sbuf);

Expand Down

0 comments on commit 2baf050

Please sign in to comment.