fluent / fluent/fluent-bit

feat: flb_plugin_proxy input plugins should support metrics event type

Open
#11,914 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
8.1k
Forks
2k
Avg merge
4d 16h
Merged PRs (30d)
58

Description

**Is your feature request related to a problem? Please describe.**

When writing an input plugin using flb_plugin_proxy (e.g. via fluent-bit-go), there is no way to emit metrics events. The proxy input collect callback in src/flb_plugin_proxy.c unconditionally calls flb_input_log_append(), so all data produced by proxy input plugins is treated as logs regardless of its actual type.

**Describe the solution you'd like**

Proxy input plugins should be able to declare an event_type and have the collect callback dispatch to the appropriate append function (flb_input_metrics_append(), flb_input_trace_append(), etc.) accordingly — mirroring how output proxy plugins already work:

```c
// src/flb_plugin_proxy.c — output side already does this
if (def->event_type == 0) {
out->event_type = FLB_OUTPUT_LOGS;
} else {
out->event_type = def->event_type;
}
```

Concretely, this would require:
1. Using the event_type field in the proxy input plugin definition struct.
2. Modifying flb_proxy_input_cb_collect() to call the correct append function based on that field.
3. Exposing the metrics/trace append APIs through fluent-bit-go (and other language SDKs).

**Describe alternatives you've considered**

The only current alternative is to rewrite the plugin as a native C input plugin, which defeats the purpose of the proxy/SDK layer. Native plugins like in_opentelemetry already call flb_input_metrics_append() directly, but that API is not accessible to proxy plugins.

**Additional context**

The goal is to write a Go input plugin that collects metrics and forwards them as FLB_INPUT_METRICS events so they can be routed through a metrics pipeline to a metrics-aware output. Today this is impossible via the proxy layer — proxy input plugins can only feed the logs pipeline.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.