Skip to content

Commit e9999b7

Browse files
authored
feat(tailer): reduce fluent-bit log level to error
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
1 parent 5ff18b4 commit e9999b7

File tree

7 files changed

+32
-0
lines changed

7 files changed

+32
-0
lines changed

charts/logging-operator/charts/logging-operator-crds/templates/logging-extensions.banzaicloud.io_hosttailers.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ spec:
368368
type: boolean
369369
skip_long_lines:
370370
type: string
371+
verbose:
372+
type: boolean
371373
required:
372374
- name
373375
type: object
@@ -723,6 +725,8 @@ spec:
723725
type: string
724726
systemdFilter:
725727
type: string
728+
verbose:
729+
type: boolean
726730
required:
727731
- name
728732
type: object

charts/logging-operator/crds/logging-extensions.banzaicloud.io_hosttailers.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ spec:
365365
type: boolean
366366
skip_long_lines:
367367
type: string
368+
verbose:
369+
type: boolean
368370
required:
369371
- name
370372
type: object
@@ -720,6 +722,8 @@ spec:
720722
type: string
721723
systemdFilter:
722724
type: string
725+
verbose:
726+
type: boolean
723727
required:
724728
- name
725729
type: object

config/crd/bases/logging-extensions.banzaicloud.io_hosttailers.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ spec:
365365
type: boolean
366366
skip_long_lines:
367367
type: string
368+
verbose:
369+
type: boolean
368370
required:
369371
- name
370372
type: object
@@ -720,6 +722,8 @@ spec:
720722
type: string
721723
systemdFilter:
722724
type: string
725+
verbose:
726+
type: boolean
723727
required:
724728
- name
725729
type: object

docs/configuration/crds/extensions/v1alpha1/hosttailer_types.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ Start reading from the head of new log files
122122
Skip long line when exceeding Buffer_Max_Size
123123

124124

125+
### verbose (bool, optional) {#filetailer-verbose}
126+
127+
Verbose mode
128+
129+
125130

126131
## SystemdTailer
127132

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

164169

170+
### verbose (bool, optional) {#systemdtailer-verbose}
171+
172+
Verbose mode
173+
174+
165175

pkg/sdk/extensions/api/v1alpha1/filetailer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ func (f FileTailer) Command(Name string) []string {
5353
"-p", "format=template",
5454
"-p", "template={log}",
5555
}
56+
if !f.Verbose {
57+
command = append(command, "-qq")
58+
}
5659
command = append(command, config.HostTailer.VersionedFluentBitPathArgs("/dev/stdout")...)
5760
return command
5861
}

pkg/sdk/extensions/api/v1alpha1/hosttailer_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ type FileTailer struct {
9393
ContainerBase *types.ContainerBase `json:"containerOverrides,omitempty"`
9494
// Override image field for the given trailer
9595
Image *tailer.ImageSpec `json:"image,omitempty"`
96+
// Verbose mode
97+
Verbose bool `json:"verbose,omitempty"`
9698
}
9799

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

116120
func init() {

pkg/sdk/extensions/api/v1alpha1/systemdtailer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ func (s SystemdTailer) Command(Name string) []string {
5454
"-o", "file",
5555
"-p", "format=plain",
5656
)
57+
if !s.Verbose {
58+
command = append(command, "-qq")
59+
}
5760
command = append(command, config.HostTailer.VersionedFluentBitPathArgs("/dev/stdout")...)
5861
return command
5962
}

0 commit comments

Comments
 (0)