-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
fluent-bit shared object go plugin #847
fluent-bit shared object go plugin #847
Conversation
654aee1
to
fba2cfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, looks pretty good so far! Just some minor nits 😄
Regarding the placement of the fluentd / fluent-bit plugins ... Couldn't we place them in a common
|
ac5f16f
to
ad4134f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks a lot 🎉
LGTM
Can you confirm the new code in |
golangci-lint complains the following warning:
But I have no idea what it means. 😓 |
It is Lines 191 to 192 in a22be17
This lints everything it can find |
It should be the import issue passed and I think there is more but the linter seems to be skipping. Let me have quick look. |
You can remove the license file we have the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not able to run the linter, Looking into a solution in the meantime there is still some issues I'd like you to take a look.
3bfb3e7
to
6105916
Compare
@cosmo0920 I'm on vacation for 2 weeks, will review asap when I'm back. |
Yep, thank you for notifying it. |
1d3bb34
to
b3e1e64
Compare
I'm taking another look ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome just a last effort on the config to match fluent. This would ease transition between the two.
When putting together a proof of concept towards Loki, we also had to extend the fluent-bit output plugin due to some issues. I will definitely extract and provide a new PR for some useful parts as soon as this PR is merged (especially added quite some testing code because debugging edge cases is a hassle with CGO shared objects). Mostly, our issues boil down to fluent-bit records not necessarily being flat, but can be a tree-like structure. For example, the fluent-bit Kubernetes filter plugin will add meta information from Kubernetes (pod, namespace, ...) within a This resulted in two issues for us:
I'm currently doing some minor cleanups and will push the code as-is to a fork. We would be glad if we can find some agreements on how to handle nested labels with both of the issues they bring -- and we're ready to provide code to get them running, we just have to align on how to do it properly. |
out of curiosity do you think the same issue also happen in fluentd plugin ? For promtail we have pipeline stage to parse json however we don't yet support This looks like a nice solution but we need to make sure we use the same config across the board unless there is a good argument against. /cc @slim-bean @rfratto WDYT ? |
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
70ab469
to
eae2560
Compare
Thank you for the great work -- I didn't get round checking the code before now again. I really like the solution with separate relabel- and drop configuration though. At first I tried rebasing my changes against the current HEAD (as I somehow was not aware you reimplemented the small recursive function already) -- pretty much puzzled my because you came up with nearly 100% identical code but on the "wrong side" of the diffs until I realized what was going on... :) I ported some of my edge case tests I wrote while drafting my code: |
* Import fluent-bit-go-loki plugin sources * Add fluent-bit-go package constraint * Ensure dependencies with dep ``` $ dep ensure ``` * Update .gitignore * Move fluent-bit-go-loki to fluent-bit/fluent-bit-go-loki directory * Add documentation for fluent-bit-go-loki * Fix for lint * Fix for goimports errors * Display fluent-bit-go-loki plugin version * Use more descriptive description for fluent-bit Loki plugin * Remove needless newlines * Rectify fluent-bit-go-loki makefile Remove needless parts and rename meaningless target * Use more descriptive description in README * refactor(fluent-bit): move make targets into root Makefile * Organize imports * Reorder imports with goimports $ goimports -w out_loki.go * Remove needless LICENSE file Because it is the same for Loki repository. * Rely on Loki client retry mechanism * Make descriptions more clearly * Change default unit * BatchWait: msec -> sec * BatchSize: KiB -> Byte * Use logql to parse Loki native labels format * Use logger instead of fmt.Printf * Update documentation to reflect recent changes * Use prometheus version module to print version * Dump error message with logger * Use DYN_GO_FLAGS instead of custom FLAGS for fluent-bit-plugin * Support RemoveKeys parameter * use logql.ParseMatchers() * refactor fluent-bit go plugin * add ci step for docker image * fix lint issues * fix a failing url test * fix a failing url test * add build images for drone ci * Adding labelmap file to complex record to labels Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com> * Add helm chart and fix a bug with labelmap * New push path * dep sync * Move fluent-bit folder and use jsonnet for drone * fix build * Adds more documentation and include a basic config in the container Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com> * remove binaries * Some readme grammar fixes * docs: really nitpicky grammar change in clients README * Add helm documentation * fixes bad config * bump chart * fixes .gitignore
What this PR does / why we need it:
The first step to merge https://github.com/cosmo0920/fluent-bit-go-loki.
Which issue(s) this PR fixes:
No fixes. This is the first task of #770.
Special notes for your reviewer:
I think that we would have to create
fluent-bit/fluent-bit-go-loki
folder instead ofcmd/fluent-bit
.Because fluent-bit-go-loki Golang plugin uses shared object format.
It is not executable.
Building steps for fluent-bit-go-loki
fluent-bit-go-loki can build with:
$ (cd fluent-bit/fluent-bit-go-loki && go build -buildmode=c-shared -o out_loki.so .)
Or, make with added Makefile(building and testing):
$ (cd fluent-bit/fluent-bit-go-loki && make)
Testing for fluent-bit-go-loki
fluent-bit-go-loki test can execute with:
Or, make with added Makefile:
$ (cd fluent-bit/fluent-bit-go-loki && make test)
Checklist