Skip to content

Commit

Permalink
out_opentelemetry: set grpc flag when paylaod is compressed
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Jan 17, 2025
1 parent 56567e5 commit f37d4cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/out_opentelemetry/opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <fluent-bit/flb_output_plugin.h>
#include <fluent-bit/flb_input_event.h>
#include <fluent-bit/flb_snappy.h>
#include <fluent-bit/flb_gzip.h>
#include <fluent-bit/flb_zstd.h>
#include <fluent-bit/flb_metrics.h>
#include <fluent-bit/flb_time.h>
#include <fluent-bit/flb_kv.h>
Expand Down Expand Up @@ -305,6 +307,10 @@ int opentelemetry_post(struct opentelemetry_context *ctx,

grpc_body = sds_result;

if(compression_algorithm != NULL) {
((uint8_t *) grpc_body)[0] = 0x01;
}

((uint8_t *) grpc_body)[1] = (wire_message_length & 0xFF000000) >> 24;
((uint8_t *) grpc_body)[2] = (wire_message_length & 0x00FF0000) >> 16;
((uint8_t *) grpc_body)[3] = (wire_message_length & 0x0000FF00) >> 8;
Expand Down

0 comments on commit f37d4cc

Please sign in to comment.