Skip to content

Commit 979a112

Browse files
hercyniumcw-Guo
authored andcommitted
Add 'Workers' parameter for S3 Output plugin
Signed-off-by: Steve Scaffidi <[email protected]>
1 parent 59ac9ea commit 979a112

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

apis/fluentbit/v1alpha2/plugins/output/s3_types.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ type S3 struct {
6565
// Specify an external ID for the STS API, can be used with the role_arn parameter if your role requires an external ID.
6666
ExternalId string `json:"ExternalId,omitempty"`
6767
// Option to specify an AWS Profile for credentials.
68-
Profile string `json:"Profile,omitempty"`
68+
Profile string `json:"Profile,omitempty"`
69+
// Specify number of worker threads to use to output to S3
70+
Workers *int32 `json:"Workers,omitempty"`
6971
*plugins.TLS `json:"tls,omitempty"`
7072
}
7173

@@ -159,6 +161,9 @@ func (o *S3) Params(sl plugins.SecretLoader) (*params.KVs, error) {
159161
if o.Profile != "" {
160162
kvs.Insert("profile", o.Profile)
161163
}
164+
if o.Workers != nil {
165+
kvs.Insert("workers", fmt.Sprint(*o.Workers))
166+
}
162167
if o.TLS != nil {
163168
tls, err := o.TLS.Params(sl)
164169
if err != nil {

apis/fluentbit/v1alpha2/plugins/output/s3_types_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func TestOutput_S3_Params(t *testing.T) {
4141
RetryLimit: ptrAny(int32(1)),
4242
ExternalId: "external_id",
4343
Profile: "my-profile",
44+
Workers: ptrAny(int32(1)),
4445
}
4546

4647
expected := params.NewKVs()
@@ -71,6 +72,7 @@ func TestOutput_S3_Params(t *testing.T) {
7172
expected.Insert("retry_limit", "1")
7273
expected.Insert("external_id", "external_id")
7374
expected.Insert("profile", "my-profile")
75+
expected.Insert("workers", "1")
7476

7577
kvs, err := s3.Params(sl)
7678
g.Expect(err).NotTo(HaveOccurred())

docs/plugins/fluentbit/output/s3.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ The S3 output plugin, allows to flush your records into a S3 time series databas
3232
| RetryLimit | Integer value to set the maximum number of retries allowed. | *int32 |
3333
| ExternalId | Specify an external ID for the STS API, can be used with the role_arn parameter if your role requires an external ID. | string |
3434
| Profile | Option to specify an AWS Profile for credentials. | string |
35+
| Workers | Specify number of worker threads to use to output to S3 | *int32 |
3536
| tls | | *[plugins.TLS](../tls.md) |

0 commit comments

Comments
 (0)