feat: add raw format and rawLogKey support for Fluent Bit Kafka#2000
Open
Vaibhav-C-S wants to merge 6 commits into
Open
feat: add raw format and rawLogKey support for Fluent Bit Kafka#2000Vaibhav-C-S wants to merge 6 commits into
Vaibhav-C-S wants to merge 6 commits into
Conversation
Signed-off-by: Vaibhav-C-S <vaibhavsharma.c@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Fluent Operator’s Fluent Bit Kafka output plugin surface area to support Fluent Bit’s raw output mode, enabling users to send a selected record field as the Kafka message payload via Raw_Log_Key.
Changes:
- Add
rawLogKeyto the Kafka output plugin API and render it asRaw_Log_Keyin generated Fluent Bit config. - Document
format: rawandrawLogKeyin the Kafka output plugin docs. - Regenerate CRDs and bundled manifests/Helm CRDs to include the new field and updated format description.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| manifests/setup/setup.yaml | Regenerated install manifest to include raw in format description and add rawLogKey schema/docs. |
| docs/plugins/fluentbit/output/kafka.md | Document format: raw and rawLogKey in the Kafka output plugin doc table. |
| config/crd/bases/fluentbit.fluent.io_outputs.yaml | Regenerated CRD base for Output to include rawLogKey and updated format description. |
| config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml | Regenerated CRD base for ClusterOutput to include rawLogKey and updated format description. |
| charts/fluent-operator/crds/fluentbit.fluent.io_outputs.yaml | Regenerated Helm CRD for Output with rawLogKey and updated format description. |
| charts/fluent-operator/crds/fluentbit.fluent.io_clusteroutputs.yaml | Regenerated Helm CRD for ClusterOutput with rawLogKey and updated format description. |
| charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_outputs.yaml | Regenerated Fluent Bit CRD chart template for Output with rawLogKey and updated format description. |
| charts/fluent-operator-fluent-bit-crds/templates/fluentbit.fluent.io_clusteroutputs.yaml | Regenerated Fluent Bit CRD chart template for ClusterOutput with rawLogKey and updated format description. |
| apis/fluentbit/v1alpha2/plugins/output/kafka_types.go | Add RawLogKey to the Kafka output API and emit Raw_Log_Key in Params. |
Comment on lines
+15
to
+18
| // Specify data format, options available: json, msgpack, raw. | ||
| Format string `json:"format,omitempty"` | ||
| // When using the raw format, the value of raw_log_key in the record is sent to Kafka as the payload. | ||
| RawLogKey string `json:"rawLogKey,omitempty"` |
| | ----- | ----------- | ------ | | ||
| | format | Specify data format, options available: json, msgpack. | string | | ||
| | format | Specify data format, options available: json, msgpack, raw. | string | | ||
| | rawLogKey | When using the raw format, the value of raw_log_key in the record is sent to Kafka as the payload. | string | |
Signed-off-by: Vaibhav-C-S <vaibhavsharma.c@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vaibhav Cheruvu <123824888+Vaibhav-C-S@users.noreply.github.com>
| | ----- | ----------- | ------ | | ||
| | format | Specify data format, options available: json, msgpack. | string | | ||
| | format | Specify data format, options available: json, msgpack, raw. | string | | ||
| | rawLogKey | When using the `raw` format, the value of `raw_log_key` in the record is sent to Kafka as the payload. | string | |
Comment on lines
+2280
to
+2282
| rawLogKey: | ||
| description: When using the raw format, the value of raw_log_key | ||
| in the record is sent to Kafka as the payload. |
Comment on lines
+2280
to
+2282
| rawLogKey: | ||
| description: When using the raw format, the value of raw_log_key | ||
| in the record is sent to Kafka as the payload. |
Comment on lines
+15
to
16
| // Specify data format, options available: json, msgpack, raw. | ||
| Format string `json:"format,omitempty"` |
Signed-off-by: Vaibhav-C-S <vaibhavsharma.c@gmail.com>
Signed-off-by: Vaibhav-C-S <vaibhavsharma.c@gmail.com>
| // Specify data format, options available: json, msgpack. | ||
| // Specify data format, options available: json, msgpack, raw. | ||
| Format string `json:"format,omitempty"` | ||
| // When using the raw format, the value of the record field specified by RawLogKey is sent to Kafka as the payload. |
Comment on lines
+65
to
+67
| if k.RawLogKey != "" { | ||
| kvs.Insert("Raw_Log_Key", k.RawLogKey) | ||
| } |
Comment on lines
+65
to
+67
| if k.RawLogKey != "" { | ||
| kvs.Insert("Raw_Log_Key", k.RawLogKey) | ||
| } |
| | ----- | ----------- | ------ | | ||
| | format | Specify data format, options available: json, msgpack. | string | | ||
| | format | Specify data format, options available: json, msgpack, raw. | string | | ||
| | rawLogKey | When using the raw format, the value of the record field specified by RawLogKey is sent to Kafka as the payload. | string | |
This file contains hidden or 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
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.
What this PR does / why we need it:
Adds support for Fluent Bit Kafka raw output mode in fluent-operator.
Fluent Bit's Kafka output supports
Format rawtogether withRaw_Log_Key, where the value of the configured record key is sent as the Kafka message payload. However, fluent-operator's Kafka output spec did not exposerawLogKey, and the documentedformatoptions did not includeraw.This PR adds support for:
kafka.format: rawkafka.rawLogKeyWhich issue(s) this PR fixes:
Fixes #1878
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.:
Testing
Testing
Message received at kafka consumer:
Input
Message received at kafka consumer