fluent-bit-go icon indicating copy to clipboard operation
fluent-bit-go copied to clipboard

input: Implement Golang Input plugin interface and added input example

Open cosmo0920 opened this issue 2 years ago • 6 comments

This PR can work with https://github.com/fluent/fluent-bit/pull/5056.

Signed-off-by: Hiroshi Hatake [email protected]

cosmo0920 avatar Mar 11 '22 08:03 cosmo0920

Using Golang plugin mechanism is quite reasonable. But, in this golang module ("github.com/fluent/fluent-bit-go/input"), we should keep it as very thin package. Providing another wrapper module is reasonable for me.

cosmo0920 avatar Apr 07 '22 07:04 cosmo0920

I think that package should be part of the bridge code. Since it uses CGO and shares memory with fluentbit.

nicolasparada avatar Apr 08 '22 02:04 nicolasparada

Plugin authors should not have to import any code that includes CGO. As soon as you use CGO, you loose most of the golang goodies.

nicolasparada avatar Apr 08 '22 02:04 nicolasparada

I mean, plugin authors can choose to import plugin bridge code something like "github.com/fluent/fluent-bit-go/bridge/input" but this PR shouldn't include patches for bridging code. We should do it in another PR. Already, output Golang plugin uses CGO included code. We should unify the behavior and coding style for output and input modules. Additionally, we should provide bridging code for simplifying to write Golang input plugin.

cosmo0920 avatar Apr 08 '22 03:04 cosmo0920

Note: A patch https://github.com/fluent/fluent-bit/pull/5056 to support golang input plugin was merged.

nokute78 avatar Aug 05 '22 22:08 nokute78

Yeah, we noticed that but current fluent-bit is pointed for 2.0 development. If we will merge this PR, we have to create 2.0 branch for now.

cosmo0920 avatar Aug 08 '22 00:08 cosmo0920

Hi guys, 2.0 version has been out for a while now, so please merge this PR, thank you.

jan-zajic avatar Nov 28 '22 13:11 jan-zajic

thanks!

edsiper avatar Nov 28 '22 14:11 edsiper