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

plugin_proxy: allow metrics type for output plugin proxy #9735

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 <[email protected]>
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.

1 participant