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

processor_labels: Process operations for output purposed contexts of metrics instead of the original one #9632

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
29 changes: 13 additions & 16 deletions plugins/processor_labels/labels.c
Original file line number Diff line number Diff line change
Expand Up @@ -1713,44 +1713,41 @@ static int cb_process_metrics(struct flb_processor_instance *processor_instance,
return FLB_PROCESSOR_FAILURE;
}

result = delete_labels(metrics_context,
result = cmt_cat(out_cmt, metrics_context);
if (result != 0) {
cmt_destroy(out_cmt);

return FLB_PROCESSOR_FAILURE;
}

result = delete_labels(out_cmt,
&processor_context->delete_labels);

if (result == FLB_PROCESSOR_SUCCESS) {
result = update_labels(metrics_context,
result = update_labels(out_cmt,
&processor_context->update_labels);
}

if (result == FLB_PROCESSOR_SUCCESS) {
result = upsert_labels(metrics_context,
result = upsert_labels(out_cmt,
&processor_context->upsert_labels);
}

if (result == FLB_PROCESSOR_SUCCESS) {
result = insert_labels(metrics_context,
result = insert_labels(out_cmt,
&processor_context->insert_labels);
}

if (result == FLB_PROCESSOR_SUCCESS) {
result = hash_labels(metrics_context,
result = hash_labels(out_cmt,
&processor_context->hash_labels);
}

if (result == FLB_PROCESSOR_SUCCESS) {
result = cmt_cat(out_cmt, metrics_context);
if (result != 0) {
cmt_destroy(out_cmt);

return FLB_PROCESSOR_FAILURE;
}

*out_context = out_cmt;
}

if (result != FLB_PROCESSOR_SUCCESS) {
return FLB_PROCESSOR_FAILURE;
}

*out_context = out_cmt;
return FLB_PROCESSOR_SUCCESS;
}

Expand Down
Loading