Skip to content

Commit 6d9071f

Browse files
committed
in_opentelemetry: add missing group footer when processing protobuf
Signed-off-by: Eduardo Silva <eduardo@calyptia.com>
1 parent 391ce85 commit 6d9071f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/in_opentelemetry/opentelemetry_prot.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ static int binary_payload_to_msgpack(struct flb_opentelemetry *ctx,
589589
msgpack_pack_str(&mp_pck, 8);
590590
msgpack_pack_str_body(&mp_pck, "resource", 8);
591591

592+
/* resource header content */
592593
flb_mp_map_header_init(&mh_tmp, &mp_pck);
593594

594595
/* look for OTel resource attributes */
@@ -612,7 +613,7 @@ static int binary_payload_to_msgpack(struct flb_opentelemetry *ctx,
612613
msgpack_pack_uint64(&mp_pck, resource->dropped_attributes_count);
613614
}
614615

615-
616+
flb_mp_map_header_end(&mh_tmp);
616617

617618
if (resource_log->schema_url) {
618619
flb_mp_map_header_append(&mh);
@@ -1819,13 +1820,14 @@ static int process_payload_logs(struct flb_opentelemetry *ctx, struct http_conn
18191820
struct mk_http_request *request)
18201821
{
18211822
struct flb_log_event_encoder *encoder;
1822-
int ret;
1823+
int ret = -1;
18231824

18241825
encoder = flb_log_event_encoder_create(FLB_LOG_EVENT_FORMAT_FLUENT_BIT_V2);
18251826
if (encoder == NULL) {
18261827
return -1;
18271828
}
18281829

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

0 commit comments

Comments
 (0)