Skip to content

Commit

Permalink
out_opentelemetry: fix check for uri sanitization when exiting
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Oct 10, 2024
1 parent 2834552 commit 352c5f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/out_opentelemetry/opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static int process_metrics(struct flb_event_chunk *event_chunk,
diff = off;

/* concat buffer */
flb_sds_cat_safe(&buf, encoded_chunk, flb_sds_len(encoded_chunk));
flb_sds_cat_safe(&buf, encoded_chunk, cfl_sds_len(encoded_chunk));

/* release */
cmt_encode_opentelemetry_destroy(encoded_chunk);
Expand Down
6 changes: 3 additions & 3 deletions plugins/out_opentelemetry/opentelemetry_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,15 @@ void flb_opentelemetry_context_destroy(struct opentelemetry_context *ctx)
flb_upstream_destroy(ctx->u);
}

if (ctx->logs_uri_sanitized != NULL) {
if (ctx->logs_uri_sanitized != NULL && ctx->logs_uri_sanitized != ctx->logs_uri) {
flb_free(ctx->logs_uri_sanitized);
}

if (ctx->traces_uri_sanitized != NULL) {
if (ctx->traces_uri_sanitized != NULL && ctx->traces_uri_sanitized != ctx->traces_uri) {
flb_free(ctx->traces_uri_sanitized);
}

if (ctx->metrics_uri_sanitized != NULL) {
if (ctx->metrics_uri_sanitized != NULL && ctx->metrics_uri_sanitized != ctx->metrics_uri) {
flb_free(ctx->metrics_uri_sanitized);
}

Expand Down

0 comments on commit 352c5f2

Please sign in to comment.