Skip to content

Commit

Permalink
in_opentelemetry: add missing group footer when processing protobuf
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Jan 21, 2025
1 parent 391ce85 commit 6d9071f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/in_opentelemetry/opentelemetry_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ static int binary_payload_to_msgpack(struct flb_opentelemetry *ctx,
msgpack_pack_str(&mp_pck, 8);
msgpack_pack_str_body(&mp_pck, "resource", 8);

/* resource header content */
flb_mp_map_header_init(&mh_tmp, &mp_pck);

/* look for OTel resource attributes */
Expand All @@ -612,7 +613,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 @@ -1819,13 +1820,14 @@ static int process_payload_logs(struct flb_opentelemetry *ctx, struct http_conn
struct mk_http_request *request)
{
struct flb_log_event_encoder *encoder;
int ret;
int ret = -1;

encoder = flb_log_event_encoder_create(FLB_LOG_EVENT_FORMAT_FLUENT_BIT_V2);
if (encoder == NULL) {
return -1;
}


/* Check if the incoming payload is a valid JSON message and convert it to msgpack */
if (strncasecmp(request->content_type.data,
"application/json",
Expand Down

0 comments on commit 6d9071f

Please sign in to comment.