Skip to content

feat: Emitter storage_type and mem_buf_limit config #1069

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

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/filter/multiline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ type Multi struct {
//Key name that holds the content to process.
//Note that a Multiline Parser definition can already specify the key_content to use, but this option allows to overwrite that value for the purpose of the filter.
KeyContent string `json:"keyContent,omitempty"`
EmitterName string `json:"emitterName,omitempty"`
EmitterMemBufLimit string `json:"emitterMemBufLimit,omitempty"`
EmitterStorageType string `json:"emitterStorageType,omitempty"`
}

func (_ *Multiline) Name() string {
Expand All @@ -41,6 +44,15 @@ func (m *Multiline) Params(_ plugins.SecretLoader) (*params.KVs, error) {
if m.Multi.KeyContent != "" {
kvs.Insert("multiline.key_content", m.Multi.KeyContent)
}
if m.Multi.EmitterName != "" {
kvs.Insert("Emitter_Name", m.Multi.EmitterName)
}
if m.Multi.EmitterMemBufLimit != "" {
kvs.Insert("Emitter_Mem_Buf_Limit", m.Multi.EmitterMemBufLimit)
}
if m.Multi.EmitterStorageType != "" {
kvs.Insert("Emitter_Storage.type", m.Multi.EmitterStorageType)
}
}
return kvs, nil
}
8 changes: 8 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/filter/rewritetag_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type RewriteTag struct {
// plugin that takes care of the job. Since this emitter expose metrics as any other
// component of the pipeline, you can use this property to configure an optional name for it.
EmitterName string `json:"emitterName,omitempty"`
EmitterMemBufLimit string `json:"emitterMemBufLimit,omitempty"`
EmitterStorageType string `json:"emitterStorageType,omitempty"`
}

func (_ *RewriteTag) Name() string {
Expand All @@ -37,5 +39,11 @@ func (r *RewriteTag) Params(_ plugins.SecretLoader) (*params.KVs, error) {
if r.EmitterName != "" {
kvs.Insert("Emitter_Name", r.EmitterName)
}
if r.EmitterMemBufLimit != "" {
kvs.Insert("Emitter_Mem_Buf_Limit", r.EmitterMemBufLimit)
}
if r.EmitterStorageType != "" {
kvs.Insert("Emitter_Storage.type", r.EmitterStorageType)
}
return kvs, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,25 @@ spec:
alias:
description: Alias for the plugin
type: string
emitterName:
description: When the filter emits a record under the new
Tag, there is an internal emitter plugin that takes care
of the job. Since this emitter expose metrics as any other
component of the pipeline, you can use this property to
configure an optional name for it.
type: string
emitterStorageType:
description: Specify the emitter buffering mechanism to use. It can be
memory or filesystem
enum:
- filesystem
- memory
type: string
emitterMemBufLimit:
description: Set a limit of memory that Emitter plugin can use when
appending data to the Engine. If the limit is reach, it will
be paused; when the data is flushed it resumes.
type: string
keyContent:
description: Key name that holds the content to process.
Note that a Multiline Parser definition can already specify
Expand Down Expand Up @@ -647,6 +666,18 @@ spec:
component of the pipeline, you can use this property to
configure an optional name for it.
type: string
emitterStorageType:
description: Specify the emitter buffering mechanism to use. It can be
memory or filesystem
enum:
- filesystem
- memory
type: string
emitterMemBufLimit:
description: Set a limit of memory that Emitter plugin can use when
appending data to the Engine. If the limit is reach, it will
be paused; when the data is flushed it resumes.
type: string
retryLimit:
description: 'RetryLimit describes how many times fluent-bit
should retry to send data to a specific output. If set
Expand Down