-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
out_kafka: Add dynamic/static headers support #8583
Open
DIFRIN
wants to merge
3
commits into
fluent:master
Choose a base branch
from
DIFRIN:output-kafka-add_headers
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIFRIN
requested review from
edsiper,
leonardo-albertovich,
fujimotos and
koleini
as code owners
March 15, 2024 12:49
DIFRIN
force-pushed
the
output-kafka-add_headers
branch
2 times, most recently
from
March 15, 2024 20:00
627834f
to
3d7ad58
Compare
Can you sort the DCO failure? This cannot be merged without it |
Signed-off-by: difrin <[email protected]>
Signed-off-by: difrin <[email protected]>
DIFRIN
force-pushed
the
output-kafka-add_headers
branch
from
March 28, 2024 06:21
8482d45
to
1f1ea15
Compare
@patrick-stephens DCO added to the commits |
@patrick-stephens @edsiper this is the message of the failed check
it's not linked to the PR content |
Possibly the test failure is related to #9023 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently,the output kafka plugin not support headers. The goal of this pull-request is to add support for dynamic/static headers to the output kafka plugin
No issue
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
-###################################################
Fluent Bit v3.0.0
. __ . __ ________
_ ____/| | __ __ ____ / | _ _|/ | ___ _
| __) | | | | _/ __ \ / \ __\ | | / \ _\ \ / / ( <
| \ | || | /\ /| | \ | | | \ || | \ / /
_ / |/____/ _ >| /| |____ /||| _/ /______ /
/ / / / /
[2024/03/15 12:25:59] [ info] Configuration:
[2024/03/15 12:25:59] [ info] flush time | 1.000000 seconds
[2024/03/15 12:25:59] [ info] grace | 5 seconds
[2024/03/15 12:25:59] [ info] daemon | 0
[2024/03/15 12:25:59] [ info] ___________
[2024/03/15 12:25:59] [ info] inputs:
[2024/03/15 12:25:59] [ info] dummy
[2024/03/15 12:25:59] [ info] ___________
[2024/03/15 12:25:59] [ info] filters:
[2024/03/15 12:25:59] [ info] ___________
[2024/03/15 12:25:59] [ info] outputs:
[2024/03/15 12:25:59] [ info] kafka.0
[2024/03/15 12:25:59] [ info] ___________
[2024/03/15 12:25:59] [ info] collectors:
[2024/03/15 12:25:59] [ info] [fluent bit] version=3.0.0, commit=9d9ac68a2b, pid=1
[2024/03/15 12:25:59] [debug] [engine] coroutine stack size: 24576 bytes (24.0K)
[2024/03/15 12:25:59] [ info] [storage] ver=1.5.1, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2024/03/15 12:25:59] [ info] [cmetrics] version=0.7.0
[2024/03/15 12:25:59] [ info] [ctraces ] version=0.4.0
[2024/03/15 12:25:59] [ info] [input:dummy:dummy.0] initializing
[2024/03/15 12:25:59] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2024/03/15 12:25:59] [debug] [dummy:dummy.0] created event channels: read=21 write=22
[2024/03/15 12:25:59] [debug] [kafka:kafka.0] created event channels: read=23 write=24
[2024/03/15 12:25:59] [ info] [output:kafka:kafka.0] Starting kafka output init
[2024/03/15 12:25:59] [ info] [output:kafka:kafka.0] brokers='kafka:9092' topics='test_fluentbit'
[2024/03/15 12:25:59] [ info] [sp] stream processor started
[2024/03/15 12:26:00] [debug] [input chunk] update output instances with new chunk size diff=39, records=1, input=dummy.0
{"text"=>"hello world"}[2024/03/15 12:26:01] [debug] [task] created task=0x7f423f8366e0 id=0 OK
[2024/03/15 12:26:01] [debug] in produce_message
[2024/03/15 12:26:01] [debug] setting message headers
[2024/03/15 12:26:01] [debug] found header key2 with value
[2024/03/15 12:26:01] [debug] header key2 is part of the msg, field name :
[2024/03/15 12:26:01] [debug] key matches a field in the message
[2024/03/15 12:26:01] [ info] [output:kafka:kafka.0] Sending message completed
[2024/03/15 12:26:01] [debug] [output:kafka:kafka.0] enqueued message (53 bytes) for topic 'test_fluentbit'
[2024/03/15 12:26:01] [debug] [out flush] cb_destroy coro_id=0
[2024/03/15 12:26:01] [debug] [task] destroy task=0x7f423f8366e0 (task_id=0)
############################################################
Resulting records in kafka:
kafka-console-consumer --topic test_fluentbit --bootstrap-server kafka:9092 --property print.headers=true
key2:hello world {"@timestamp":1710505560.027627,"text":"hello world"}
[N/A ] Attached Valgrind output that shows no leaks or memory corruption was found
Documentation
[https://github.com/fluent/fluent-bit-docs/pull/1341]
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.