fluent / fluent-bit-go

Fluent Bit Golang package to build plugins
Apache License 2.0
189 stars 52 forks source link

input: Implement Golang Input plugin interface and added input example #52

Closed cosmo0920 closed 1 year ago

cosmo0920 commented 2 years ago

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

Signed-off-by: Hiroshi Hatake hatake@calyptia.com

cosmo0920 commented 2 years ago

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.

nicolasparada commented 2 years ago

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

nicolasparada commented 2 years ago

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.

cosmo0920 commented 2 years ago

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.

nokute78 commented 2 years ago

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

cosmo0920 commented 2 years ago

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.

jan-zajic commented 1 year ago

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

edsiper commented 1 year ago

thanks!