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 22, 2025
1 parent 7abf90b commit e115c08
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 @@ -588,6 +588,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 @@ -611,7 +612,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 @@ -1817,14 +1818,15 @@ 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 e115c08

Please sign in to comment.