Skip to content

Commit b74f8c8

Browse files
authored
Merge pull request #1567 from solidDoWant/feat/add-db-locking-tail-input-1
Added the ability to set `DB.locking` on fluentbit tail inputs
2 parents 2d12e04 + 68de372 commit b74f8c8

File tree

6 files changed

+22
-0
lines changed

6 files changed

+22
-0
lines changed

apis/fluentbit/v1alpha2/plugins/input/tail_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ type Tail struct {
5959
// Set a default synchronization (I/O) method. Values: Extra, Full, Normal, Off.
6060
// +kubebuilder:validation:Enum:=Extra;Full;Normal;Off
6161
DBSync string `json:"dbSync,omitempty"`
62+
// Specify that the database will be accessed only by Fluent Bit.
63+
DBLocking *bool `json:"dbLocking,omitempty"`
6264
// Set a limit of memory that Tail plugin can use when appending data to the Engine.
6365
// If the limit is reach, it will be paused; when the data is flushed it resumes.
6466
MemBufLimit string `json:"memBufLimit,omitempty"`
@@ -153,6 +155,9 @@ func (t *Tail) Params(_ plugins.SecretLoader) (*params.KVs, error) {
153155
if t.DBSync != "" {
154156
kvs.Insert("DB.Sync", t.DBSync)
155157
}
158+
if t.DBLocking != nil {
159+
kvs.Insert("DB.locking", fmt.Sprint(*t.DBLocking))
160+
}
156161
if t.MemBufLimit != "" {
157162
kvs.Insert("Mem_Buf_Limit", t.MemBufLimit)
158163
}

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,10 @@ spec:
694694
description: Specify the database file to keep track of monitored
695695
files and offsets.
696696
type: string
697+
dbLocking:
698+
description: Specify that the database will be accessed only by
699+
Fluent Bit.
700+
type: boolean
697701
dbSync:
698702
description: 'Set a default synchronization (I/O) method. Values:
699703
Extra, Full, Normal, Off.'

config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,10 @@ spec:
694694
description: Specify the database file to keep track of monitored
695695
files and offsets.
696696
type: string
697+
dbLocking:
698+
description: Specify that the database will be accessed only by
699+
Fluent Bit.
700+
type: boolean
697701
dbSync:
698702
description: 'Set a default synchronization (I/O) method. Values:
699703
Extra, Full, Normal, Off.'

docs/plugins/fluentbit/input/tail.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The Tail input plugin allows to monitor one or several text files. <br /> It has
1818
| skipLongLines | When a monitored file reach it buffer capacity due to a very long line (Buffer_Max_Size), the default behavior is to stop monitoring that file. Skip_Long_Lines alter that behavior and instruct Fluent Bit to skip long lines and continue processing other lines that fits into the buffer size. | *bool |
1919
| db | Specify the database file to keep track of monitored files and offsets. | string |
2020
| dbSync | Set a default synchronization (I/O) method. Values: Extra, Full, Normal, Off. | string |
21+
| dbLocking | Specify that the database will be accessed only by Fluent Bit. | *bool |
2122
| memBufLimit | Set a limit of memory that Tail 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. | string |
2223
| parser | Specify the name of a parser to interpret the entry as a structured message. | string |
2324
| key | When a message is unstructured (no parser applied), it's appended as a string under the key name log. This option allows to define an alternative name for that key. | string |

manifests/setup/fluent-operator-crd.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,6 +2810,10 @@ spec:
28102810
description: Specify the database file to keep track of monitored
28112811
files and offsets.
28122812
type: string
2813+
dbLocking:
2814+
description: Specify that the database will be accessed only by
2815+
Fluent Bit.
2816+
type: boolean
28132817
dbSync:
28142818
description: 'Set a default synchronization (I/O) method. Values:
28152819
Extra, Full, Normal, Off.'

manifests/setup/setup.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,6 +2810,10 @@ spec:
28102810
description: Specify the database file to keep track of monitored
28112811
files and offsets.
28122812
type: string
2813+
dbLocking:
2814+
description: Specify that the database will be accessed only by
2815+
Fluent Bit.
2816+
type: boolean
28132817
dbSync:
28142818
description: 'Set a default synchronization (I/O) method. Values:
28152819
Extra, Full, Normal, Off.'

0 commit comments

Comments
 (0)