Skip to content
Open
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
65 changes: 65 additions & 0 deletions apis/fluentbit/v1alpha2/clusteroutput_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,3 +571,68 @@ func TestForwardOutput_RetainMetadataInForwardMode(t *testing.T) {
g.Expect(err).NotTo(HaveOccurred())
g.Expect(resultTrue).To(ContainSubstring("Retain_Metadata_In_Forward_Mode true"))
}

func httpOutputWithWorkers() ClusterOutputList {
return ClusterOutputList{
Items: []ClusterOutput{{
TypeMeta: metav1.TypeMeta{
APIVersion: "fluentbit.fluent.io/v1alpha2",
Kind: "ClusterOutput",
},
ObjectMeta: metav1.ObjectMeta{
Name: "http_output_with_workers",
},
Spec: OutputSpec{
MatchRegex: "app.*",
RetryLimit: "8",
HTTP: &output.HTTP{
Host: "example.com",
Port: new(int32(9481)),
Uri: "/insert/jsonline",
Format: "json_lines",
Workers: new(int32(4)),
},
},
}},
}
}

func TestHTTPOutputWithWorkers_Load(t *testing.T) {
g := NewGomegaWithT(t)
sl := plugins.NewSecretLoader(nil, "testnamespace")

expected := `[Output]
Name http
Match_Regex app.*
Retry_Limit 8
host example.com
port 9481
uri /insert/jsonline
format json_lines
workers 4
`

result, err := httpOutputWithWorkers().Load(sl)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(result).To(Equal(expected))
}

func TestHTTPOutputWithWorkers_LoadAsYaml(t *testing.T) {
g := NewGomegaWithT(t)
sl := plugins.NewSecretLoader(nil, "testnamespace")

expected := `outputs:
- name: http
match_regex: app.*
retry_limit: 8
host: example.com
port: 9481
uri: /insert/jsonline
format: json_lines
workers: 4
`

result, err := httpOutputWithWorkers().LoadAsYaml(sl, 0)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(result).To(Equal(expected))
}
3 changes: 3 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/http_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ type HTTP struct {
*plugins.Networking `json:"networking,omitempty"`
// Limit the maximum number of Chunks in the filesystem for the current output logical destination.
TotalLimitSize string `json:"totalLimitSize,omitempty"`
// Enables dedicated thread(s) for this output. Default value is set since version 1.8.13. For previous versions is 0.
Workers *int32 `json:"workers,omitempty"`
}

// implement Name method
Expand Down Expand Up @@ -125,6 +127,7 @@ func (h *HTTP) Params(sl plugins.SecretLoader) (*params.KVs, error) {
}

plugins.InsertKVString(kvs, "storage.total_limit_size", h.TotalLimitSize)
plugins.InsertKVField(kvs, "workers", h.Workers)

return kvs, nil
}
2 changes: 2 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/http_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestHTTP_Params(t *testing.T) {
TLS: &plugins.TLS{Verify: new(false)},
Networking: &plugins.Networking{SourceAddress: new("expected_source_address")},
TotalLimitSize: "512M",
Workers: new(int32(4)),
}

expected := params.NewKVs()
Expand All @@ -50,6 +51,7 @@ func TestHTTP_Params(t *testing.T) {
expected.Insert("tls.verify", "false")
expected.Insert("net.source_address", "expected_source_address")
expected.Insert("storage.total_limit_size", "512M")
expected.Insert("workers", "4")

kvs, err := h.Params(sl)
g.Expect(err).NotTo(HaveOccurred())
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,12 @@ spec:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
type: string
workers:
description: Enables dedicated thread(s) for this output. Default
value is set since version 1.8.13. For previous versions is
0.
format: int32
type: integer
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,12 @@ spec:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
type: string
workers:
description: Enables dedicated thread(s) for this output. Default
value is set since version 1.8.13. For previous versions is
0.
format: int32
type: integer
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,12 @@ spec:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
type: string
workers:
description: Enables dedicated thread(s) for this output. Default
value is set since version 1.8.13. For previous versions is
0.
format: int32
type: integer
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
Expand Down
6 changes: 6 additions & 0 deletions charts/fluent-operator/crds/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,12 @@ spec:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
type: string
workers:
description: Enables dedicated thread(s) for this output. Default
value is set since version 1.8.13. For previous versions is
0.
format: int32
type: integer
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,12 @@ spec:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
type: string
workers:
description: Enables dedicated thread(s) for this output. Default
value is set since version 1.8.13. For previous versions is
0.
format: int32
type: integer
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,12 @@ spec:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
type: string
workers:
description: Enables dedicated thread(s) for this output. Default
value is set since version 1.8.13. For previous versions is
0.
format: int32
type: integer
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
Expand Down
1 change: 1 addition & 0 deletions docs/plugins/fluentbit/output/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ The http output plugin allows to flush your records into a HTTP endpoint. <br />
| tls | HTTP output plugin supports TTL/SSL, for more details about the properties available and general configuration, please refer to the TLS/SSL section. | *[plugins.TLS](../tls.md) |
| networking | Include fluentbit networking options for this output-plugin | *[plugins.Networking](../net.md) |
| totalLimitSize | Limit the maximum number of Chunks in the filesystem for the current output logical destination. | string |
| workers | Enables dedicated thread(s) for this output. Default value is set since version 1.8.13. For previous versions is 0. | *int32 |
12 changes: 12 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6140,6 +6140,12 @@ spec:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
type: string
workers:
description: Enables dedicated thread(s) for this output. Default
value is set since version 1.8.13. For previous versions is
0.
format: int32
type: integer
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
Expand Down Expand Up @@ -37627,6 +37633,12 @@ spec:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
type: string
workers:
description: Enables dedicated thread(s) for this output. Default
value is set since version 1.8.13. For previous versions is
0.
format: int32
type: integer
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
Expand Down
Loading