Skip to content

Conversation

@gracewehner
Copy link

@gracewehner gracewehner commented Dec 17, 2024

This change allows the fluent-bit metrics type to be routed to output proxy plugins such as the golang proxy plugin.

Currently the proxy output plugin registration does not include the out->event_type setting for what types it accepts:

/* Plugin registration */
out->type = FLB_OUTPUT_PLUGIN_PROXY;
out->proxy = proxy;
out->flags = def->flags;
out->name = flb_strdup(def->name);
out->description = def->description;
mk_list_add(&out->_head, &config->out_plugins);

For output plugins that have no value for event_type, those plugins default to supporting only the logs datatype:

fluent-bit/src/flb_output.c

Lines 605 to 607 in faf7da1

if (plugin->event_type == 0) {
instance->event_type = FLB_OUTPUT_LOGS;
}

The fluent-bit router will enforce datatypes between input and output plugins and drop any data that has the type mismatch:

fluent-bit/src/flb_task.c

Lines 435 to 438 in faf7da1

/* skip output plugins that don't handle proper event types */
if (!flb_router_match_type(ic->event_type, o_ins)) {
continue;
}

Addresses fluent/fluent-bit-go#75, fluent/fluent-bit-go#77


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [] Example configuration file for the change
  • [] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

fluent/fluent-bit-docs#1531

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@gracewehner
Copy link
Author

I have a PR for the fluent-bit-go repo fluent/fluent-bit-go#79 that decodes and uses the metric type. It depends on the PR in this repo for metrics to be allowed to flow to the output plugin.

Previously, the output plugin proxy supported only logs types as this is the default if no event_type is specified. This allows the metrics type to also be routed to output proxy plugins such as the golang proxy plugin.

Signed-off-by: Grace Wehner <grace.wehner@microsoft.com>
@gracewehner
Copy link
Author

Hi @edsiper @leonardo-albertovich @fujimotos @koleini would I be able to get a review on this?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2025

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Sep 7, 2025
@gracewehner
Copy link
Author

Hi @edsiper @leonardo-albertovich @fujimotos @koleini would you be able to review this still?

@eschabell
Copy link
Contributor

@gracewehner not that there are errors on the tests that need to be addressed.

@edsiper
Copy link
Member

edsiper commented Feb 4, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cf7c7a8f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 364 to +366
/* Plugin registration */
out->type = FLB_OUTPUT_PLUGIN_PROXY;
out->event_type = FLB_OUTPUT_LOGS | FLB_OUTPUT_METRICS;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid routing metrics to log-only proxy outputs

By unconditionally setting out->event_type to FLB_OUTPUT_LOGS | FLB_OUTPUT_METRICS for all proxy outputs, any proxy output configured for logs will now also accept metrics when a metrics input matches the same output. Because the proxy definition has no way to declare supported event types, log-only proxy plugins (e.g., Go outputs that only implement log decoding) will start receiving metrics chunks they cannot parse, leading to dropped data or flush errors when metrics inputs are present alongside log inputs. This is a behavioral regression for existing deployments that used proxy outputs for logs only and now have metrics enabled; consider making the event type configurable or derived from the proxy/plugin registration instead of forcing metrics support for every proxy output.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants