Skip to content

feat(hosttailer): reduce fluent-bit log level to error #1957

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
Apr 24, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ spec:
type: boolean
skip_long_lines:
type: string
verbose:
type: boolean
required:
- name
type: object
Expand Down Expand Up @@ -723,6 +725,8 @@ spec:
type: string
systemdFilter:
type: string
verbose:
type: boolean
required:
- name
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ spec:
type: boolean
skip_long_lines:
type: string
verbose:
type: boolean
required:
- name
type: object
Expand Down Expand Up @@ -720,6 +722,8 @@ spec:
type: string
systemdFilter:
type: string
verbose:
type: boolean
required:
- name
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ spec:
type: boolean
skip_long_lines:
type: string
verbose:
type: boolean
required:
- name
type: object
Expand Down Expand Up @@ -720,6 +722,8 @@ spec:
type: string
systemdFilter:
type: string
verbose:
type: boolean
required:
- name
type: object
Expand Down
10 changes: 10 additions & 0 deletions docs/configuration/crds/extensions/v1alpha1/hosttailer_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ Start reading from the head of new log files
Skip long line when exceeding Buffer_Max_Size


### verbose (bool, optional) {#filetailer-verbose}

Verbose mode



## SystemdTailer

Expand Down Expand Up @@ -162,4 +167,9 @@ Override systemd log path
Filter to select systemd unit example: kubelet.service


### verbose (bool, optional) {#systemdtailer-verbose}

Verbose mode



3 changes: 3 additions & 0 deletions pkg/sdk/extensions/api/v1alpha1/filetailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func (f FileTailer) Command(Name string) []string {
"-p", "format=template",
"-p", "template={log}",
}
if !f.Verbose {
command = append(command, "-qq")
}
command = append(command, config.HostTailer.VersionedFluentBitPathArgs("/dev/stdout")...)
return command
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/sdk/extensions/api/v1alpha1/hosttailer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ type FileTailer struct {
ContainerBase *types.ContainerBase `json:"containerOverrides,omitempty"`
// Override image field for the given trailer
Image *tailer.ImageSpec `json:"image,omitempty"`
// Verbose mode
Verbose bool `json:"verbose,omitempty"`
}

// SystemdTailer configuration options
Expand All @@ -111,6 +113,8 @@ type SystemdTailer struct {
ContainerBase *types.ContainerBase `json:"containerOverrides,omitempty"`
// Override image field for the given trailer
Image *tailer.ImageSpec `json:"image,omitempty"`
// Verbose mode
Verbose bool `json:"verbose,omitempty"`
}

func init() {
Expand Down
3 changes: 3 additions & 0 deletions pkg/sdk/extensions/api/v1alpha1/systemdtailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ func (s SystemdTailer) Command(Name string) []string {
"-o", "file",
"-p", "format=plain",
)
if !s.Verbose {
command = append(command, "-qq")
}
command = append(command, config.HostTailer.VersionedFluentBitPathArgs("/dev/stdout")...)
return command
}
Expand Down