Skip to content

Commit

Permalink
processor_content_modifier: allow 'fluent-bit' as a producer in metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Nov 5, 2024
1 parent 4532ef4 commit df81bf4
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions plugins/processor_content_modifier/cm_metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,6 @@ int cm_metrics_process(struct flb_processor_instance *ins,
int ret = -1;
struct cfl_variant *var = NULL;

printf("\n\n==== BEFORE =====\n");
cfl_kvlist_print(stdout, in_cmt->internal_metadata);
printf("\n");
printf("-----external----\n");
cfl_kvlist_print(stdout, in_cmt->external_metadata);
fflush(stdout);


if (ctx->context_type == CM_CONTEXT_OTEL_RESOURCE_ATTR) {
/* Internal metadata must be valid */
var = cfl_kvlist_fetch(in_cmt->internal_metadata, "producer");
Expand All @@ -282,7 +274,8 @@ int cm_metrics_process(struct flb_processor_instance *ins,
}

/* validate that the value is 'opentelemetry' */
if (strcmp(var->data.as_string, "opentelemetry") != 0) {
if (strcmp(var->data.as_string, "opentelemetry") != 0 &&
strcmp(var->data.as_string, "fluent-bit") != 0) {
return FLB_PROCESSOR_FAILURE;
}

Expand Down Expand Up @@ -335,12 +328,5 @@ int cm_metrics_process(struct flb_processor_instance *ins,
return FLB_PROCESSOR_FAILURE;
}

printf("\n\n==== AFTER =====\n");
cfl_kvlist_print(stdout, in_cmt->internal_metadata);
printf("\n");
printf("-----external----\n");
cfl_kvlist_print(stdout, in_cmt->external_metadata);
fflush(stdout);

return FLB_PROCESSOR_SUCCESS;
}

0 comments on commit df81bf4

Please sign in to comment.