10 Building plugins
This chapter covers
- Implementing custom plugins using the Go language.
- Using the Fluent Bit provided Go binding layer.
- Consuming Fluent Bit configuration data to control our plugin behavior.
- Managing data between method calls using the context object.
- Seeing how contexts are applied for multiple instances of the same plugin type.
So far in the book, we’ve concentrated on using capabilities entirely within a Fluent Bit deployment. The last chapter went through the options for building custom plugins. In this chapter, we will implement input and output plugins using Go.
Figure 10.1 Logical architecture of Fluent Bit, with this Chapter's focus highlighted.

We’ve chosen to use Go for several reasons:
- We’re not bound to the processes and rules expected of us if we produce a C plugin that compiles into the Fluent Bit core. We don’t have to recompile the entirety of Fluent Bit.
- Go frees us from worrying about memory resource management without compromising on performance considerations.
- Go frees us from the additional complexity of WASM and WASI and the constraints for connecting to other services.
- It helps enforce the API layers as the touchpoints are clearly established.