Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_opentelemetry: fix finalization of group for gRPC payload (backport for v3.2) #9883

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions plugins/in_opentelemetry/opentelemetry_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static int process_payload_raw_traces(struct flb_opentelemetry *ctx, struct http
msgpack_pack_array(&mp_pck, 2);
flb_pack_time_now(&mp_pck);

/* Check if the incoming payload is a valid JSON message and convert it to msgpack */
/* Check if the incoming payload is a valid message and convert it to msgpack */
ret = flb_pack_json(request->data.data, request->data.len,
&out_buf, &out_size, &root_type, NULL);

Expand Down Expand Up @@ -686,7 +686,8 @@ static int binary_payload_to_msgpack(struct flb_opentelemetry *ctx,
flb_plg_error(ctx->ins, "could not set group content metadata");
goto binary_payload_to_msgpack_end;
}
flb_log_event_encoder_group_header_end(encoder);

flb_log_event_encoder_group_end(encoder);

msgpack_sbuffer_clear(&mp_sbuf);

Expand Down Expand Up @@ -2856,7 +2857,6 @@ int opentelemetry_prot_handle_ng(struct flb_http_request *request,
strcmp(request->path, "/opentelemetry.proto.collector.metric.v1.MetricService/Export") == 0 ||
strcmp(request->path, "/opentelemetry.proto.collector.trace.v1.TraceService/Export") == 0 ||
strcmp(request->path, "/opentelemetry.proto.collector.log.v1.LogService/Export") == 0) {

grpc_request = FLB_TRUE;
}
else if (context->profile_support_enabled &&
Expand Down Expand Up @@ -2914,6 +2914,7 @@ int opentelemetry_prot_handle_ng(struct flb_http_request *request,
else {
tag = flb_sds_create(context->ins->tag);
}

result = process_payload_logs_ng(context, tag, request, response);
}
else if (context->profile_support_enabled &&
Expand Down
Loading