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
Add Fluent Bit source and sink operators #3461
Conversation
That build system work is quite a feat! I had started something local using |
I just assumed that we would go to bytes first, but looking at the included minimal API it seems to make more sense to go to directly to events. This is an implementation choice that you should make as the main implementer or the feature. |
Alrighty, can I take it from here? |
@tobim I've split the outstanding todos in two tasklists for clearer responsibilities. In particular, please review da417f1, which I needed to get things to link on macOS. I'm surprised that the Docker build fails, as the script that installs the dev deps runs through just fine, and the plain Debian CI build works. Here I have no intuition how to proceed and would probably not invest any time myself. Any help would be appreciated. |
dd77a10
to
a44f8f7
Compare
I managed to get rid of any custom Fluent Bit plugins. This now works with a stock Fluent Bit package that you get on your system. The consequence is that we now have to go through JSON when using Fluent Bit as sink (Fluent Bit input), because the library function Net effect: we have the potential to tune performance as source operator, but not as sink operator. I've asked @edsiper in Slack:
With a bit of luck, this will be a welcome future contribution as it doesn't change anything about the public API. |
4405d39
to
41dfdf8
Compare
bd7a9b7
to
0c3ab14
Compare
0c3ab14
to
b6c67ed
Compare
The regular debian CI job does not build any plugins except for The issue in the docker build was quite hairy and took me longer to fix than the static build. Behold: https://github.com/tenzir/tenzir/pull/3461/files#diff-4f95d2e348b638a037c80301070df229e817aaba51d9cd3b868976c7ae96c695R37-R69 |
CI error:
@tobim IIRC we don't have that function in plugins. @dominiklohmann once told me to just remove it. |
This has been bugging us often enough. I refactored the functionality so it can be reused for standalone plugins in the latest commit. |
52ca0c5
to
872e4cd
Compare
86a7c67
to
89a3c90
Compare
The plugin scaffold requires static plugins to have identical plugin and project names.
We need to work around the limitations of the upstream build and installation logic, which is done by collecting all necessary archives into the plugin linker command line. See the code comments for details.
The fluent bit shared library contains a private copy of jemalloc which can't be loaded with `dlopen()` at runtime. We work around the issue by preloading fluent bit with the Tenzir binary when possible. The proper fix would be to use the system jemalloc instead of vendoring a private copy in the fluent-bit package.
These are no longer necessary because there's not more shared state between our plugin and a third-party Fluent Bit plugin. Phew.
0dcdd6c
to
75a26c0
Compare
The official fluent-bit package contains a bundeld copy of jemalloc that poses 2 problems: First, it is built in a way that makes it impossible to load `libfluent-bit.so` with `dlopen()`. And second, the way it initializes thread local variables creates problems with the jemalloc present in `libarrow.so`, specifically it causes a segfault when initializing the s3 filesystem. I'm trying to resolve this issue upstream at fluent/fluent-bit#8005, but until it is fixed we have to rely on this fallback. Signed-off-by: Tobias Mayer <tobim@fastmail.fm>
75a26c0
to
7919561
Compare
This will add fluent-bit loaders and savers.
This PR is in a very early stage right now, the actual functionality is not implemented yet.
We include a custom
fluent-bit-minimal.h
from fluent/fluent-bit#7165 (comment) because the public API of fluent-bit is currently unusable. This will hopefully be included upstream in the near future.Business Logic
fluentbit
sink operatorfluentbit
source operatorfluent-bit xxx
Scaffolding
flb_lib_push