fluent-plugin-kinesis 3.2.1 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87249672c8b4c4b51c61c09275f9b0a4a3fd91ed730360c7b1d6f59114832bc4
4
- data.tar.gz: ebafe8d59f1dd4e6321f7489c8df8ba5e012ecfc0ed6cab2ee22037b263cb5a1
3
+ metadata.gz: 7a56428085f3d1f60d243071976cf17ef81ae64cc02176aa9106e0f38763e8c2
4
+ data.tar.gz: d7176edca0e7fd26c7e6724a1c63c8817c7104666e1ed7108c25ef91e7449662
5
5
  SHA512:
6
- metadata.gz: 83eebfea01f821aaab9c8d9771253ed4b8e30c4c6430547696f19c462789c1bba51c36d9a2d57f63bb83c3f8d87379fe9d9f6561f6fc71bff01edb3f87f8ce5b
7
- data.tar.gz: 82b7b17dc7b4960cb221bc2e69b603770c44334a08ce3643acdbe8c033ccd2871bd4136eaa614dec8ccd0c3a6ecee9576f14bc7ee2bb465d519889505ebd9a44
6
+ metadata.gz: 332e9a47297b9ee84f03527119b6e286301378ffce699c5fa3d0f23549f4e345754e439f2afc540190415bc02cb4bd466b15a17498560c564701115dc2698a51
7
+ data.tar.gz: 7979f2ea6cdbda52973fd13f1b403f99ae3852ce9a1e3112b144a45e63af21b43b9bc3f6591f5f5004a5fe8df3c3f77cc7d85fbc4aa2150a92563ac1dc3fc4a7
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  /gemfiles/Gemfile*.lock
5
5
  /_yardoc/
6
6
  /coverage/
7
+ /vendor/
7
8
  /doc/
8
9
  /pkg/
9
10
  /spec/reports/
data/.travis.yml CHANGED
@@ -2,34 +2,50 @@ language: ruby
2
2
  os: linux
3
3
  sudo: false
4
4
 
5
- gemfile:
6
- - Gemfile
7
- - gemfiles/Gemfile.td-agent-3.5.1
8
-
9
5
  # Test with supported td-agent versions
10
- # https://support.treasuredata.com/hc/en-us/articles/360001479187-The-td-agent-ChangeLog
6
+ # https://docs.fluentd.org/quickstart/support#change-logs
7
+ # https://docs.treasuredata.com/display/public/PD/The+td-agent+Change+Log
8
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/master/CHANGELOG.md
11
9
  matrix:
12
10
  include:
13
- - rvm: 2.6.5
14
- gemfile: gemfiles/Gemfile.fluentd-1.9.1 # Latest Fluentd
15
- - rvm: 2.4.1
16
- gemfile: gemfiles/Gemfile.fluentd-0.14.22 # Oldest supported Fluentd
17
- - rvm: 2.4.2 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.0/config/projects/td-agent3.rb#L20
18
- gemfile: gemfiles/Gemfile.td-agent-3.1.0
19
- - rvm: 2.4.2 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.1/config/projects/td-agent3.rb#L17
20
- gemfile: gemfiles/Gemfile.td-agent-3.1.1
21
- - rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.0/config/projects/td-agent3.rb#L22
22
- gemfile: gemfiles/Gemfile.td-agent-3.2.0
23
- - rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.1/config/projects/td-agent3.rb#L22
24
- gemfile: gemfiles/Gemfile.td-agent-3.2.1
25
- - rvm: 2.4.5 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.3.0/config/projects/td-agent3.rb#L22
26
- gemfile: gemfiles/Gemfile.td-agent-3.3.0
27
- - rvm: 2.4.6 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/config/projects/td-agent3.rb#L22
28
- gemfile: gemfiles/Gemfile.td-agent-3.4.1
29
- - rvm: 2.4.6 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.0/config/projects/td-agent3.rb#L22
30
- gemfile: gemfiles/Gemfile.td-agent-3.5.0
31
- - rvm: 2.4.9 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.1/config/projects/td-agent3.rb#L22
32
- gemfile: gemfiles/Gemfile.td-agent-3.5.1
11
+ - gemfile: gemfiles/Gemfile.fluentd-1.12.3 # Latest Fluentd / https://www.fluentd.org/download
12
+ rvm: 2.7.3 # Latest supported Ruby (less than v3.0.0) / https://www.ruby-lang.org/en/downloads
13
+ - gemfile: gemfiles/Gemfile.fluentd-0.14.22 # Oldest supported Fluentd
14
+ rvm: 2.3.0 # Oldest supported Ruby
15
+ - gemfile: gemfiles/Gemfile.td-agent-3.1.0
16
+ rvm: 2.4.2 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.0/config/projects/td-agent3.rb#L20
17
+ # - gemfile: gemfiles/Gemfile.td-agent-3.1.1
18
+ # rvm: 2.4.2 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.1.1/config/projects/td-agent3.rb#L17
19
+ # - gemfile: gemfiles/Gemfile.td-agent-3.2.0
20
+ # rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.0/config/projects/td-agent3.rb#L22
21
+ - gemfile: gemfiles/Gemfile.td-agent-3.2.1
22
+ rvm: 2.4.4 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.2.1/config/projects/td-agent3.rb#L22
23
+ - gemfile: gemfiles/Gemfile.td-agent-3.3.0
24
+ rvm: 2.4.5 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.3.0/config/projects/td-agent3.rb#L22
25
+ # - gemfile: gemfiles/Gemfile.td-agent-3.4.0
26
+ # rvm: 2.4.5 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/config/projects/td-agent3.rb#L22
27
+ - gemfile: gemfiles/Gemfile.td-agent-3.4.1
28
+ rvm: 2.4.6 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/config/projects/td-agent3.rb#L22
29
+ # - gemfile: gemfiles/Gemfile.td-agent-3.5.0
30
+ # rvm: 2.4.6 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.0/config/projects/td-agent3.rb#L22
31
+ - gemfile: gemfiles/Gemfile.td-agent-3.5.1
32
+ rvm: 2.4.9 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.5.1/config/projects/td-agent3.rb#L22
33
+ - gemfile: gemfiles/Gemfile.td-agent-3.6.0
34
+ rvm: 2.4.9 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/config/projects/td-agent3.rb#L22
35
+ # - gemfile: gemfiles/Gemfile.td-agent-3.7.0
36
+ # rvm: 2.4.9 # https://github.com/treasure-data/omnibus-td-agent/commit/da5cb39ec5396f652cd30bad5bb8ef4ec19071a9#diff-f73e763ace61e7c4bf48bf94bd6e295bc2cfd1ce5f9e38a4d19e266353e37498R22
37
+ - gemfile: gemfiles/Gemfile.td-agent-3.7.1
38
+ rvm: 2.4.10 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/config/projects/td-agent3.rb#L22
39
+ - gemfile: gemfiles/Gemfile.td-agent-3.8.0 # Latest official release of td-agent v3
40
+ rvm: 2.4.10 # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/config/projects/td-agent3.rb#L22
41
+ - gemfile: gemfiles/Gemfile.td-agent-3.8.1 # Maintenance release of td-agent v3
42
+ rvm: 2.4.10 # https://github.com/treasure-data/omnibus-td-agent/pull/273/files#diff-f73e763ace61e7c4bf48bf94bd6e295bc2cfd1ce5f9e38a4d19e266353e37498R22
43
+ # - gemfile: gemfiles/Gemfile.td-agent-4.0.0
44
+ # rvm: 2.7.1 # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/41b3436d43c21e48a9cf34c58ae640f0e3dfb44c/td-agent/config.rb#L16
45
+ - gemfile: gemfiles/Gemfile.td-agent-4.0.1
46
+ rvm: 2.7.1 # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.0.1/td-agent/config.rb#L16
47
+ - gemfile: gemfiles/Gemfile.td-agent-4.1.0
48
+ rvm: 2.7.2 # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.1.0/td-agent/config.rb#L19
33
49
  fast_finish: true
34
50
 
35
51
  script: bundle exec rake test
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.4.0
4
+
5
+ - Enhancement - Enable to monitor batch request failure and retries : [#150](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/150) [#211](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/211)
6
+ - Enhancement - Make sleep reliable by measuring actual slept time : [#162](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/162)
7
+ - Enhancement - Add td-agent 4.1.0 and Fluentd 1.12.3 to test cases
8
+
9
+ ## 3.3.0
10
+
11
+ - Feature - Add web_identity_credentials configuration for IRSA : [#208](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/208) [#209](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/209)
12
+ - Enhancement - Remove strict gem pinning of google-protobuf to support Ruby 2.7 : [#199](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/199) [#206](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/206)
13
+ - Enhancement - Add td-agent v4 (4.0.1) and Fluentd 1.11.2 to test cases
14
+
15
+ ## 3.2.3
16
+
17
+ - Enhancement - Add placeholder support for delivery_stream_name of kinesis_firehose : [#203](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/203) [#204](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/204)
18
+
19
+ ## 3.2.2
20
+
21
+ - Enhancement - Make more strict gem pinning to deal with google-protobuf requiring Ruby 2.5+ : [#199](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/199)
22
+ - Bug - Fix MissingRegionError when http_proxy and endpoint_url are specified : [#197](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/197)
23
+
3
24
  ## 3.2.1
4
25
 
5
26
  - Enhancement - Use Fluent::MessagePackFactory class methods instead of Mixin with Fluentd >= v1.8 : [#194](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/194) [#195](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/195)
data/CONTRIBUTORS.txt CHANGED
@@ -4,3 +4,5 @@ to the Fluent Plugin for Amazon Kinesis Streams and Amazon Kinesis Firehose. Giv
4
4
  Genki Sugawara
5
5
  sgwr_dts@yahoo.co.jp
6
6
  https://github.com/winebarrel
7
+ https://github.com/adammw
8
+ https://github.com/cosmo0920
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Fluent plugin for Amazon Kinesis
2
2
 
3
- [![Gitter](https://badges.gitter.im/awslabs/aws-fluent-plugin-kinesis.svg)](https://gitter.im/awslabs/aws-fluent-plugin-kinesis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
4
- [![Build Status](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis.svg?branch=master)](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis)
3
+ [![Build Status](https://travis-ci.com/awslabs/aws-fluent-plugin-kinesis.svg?branch=master)](https://travis-ci.com/awslabs/aws-fluent-plugin-kinesis)
5
4
  [![Gem Version](https://badge.fury.io/rb/fluent-plugin-kinesis.svg)](https://rubygems.org/gems/fluent-plugin-kinesis)
6
5
  [![Gem Downloads](https://img.shields.io/gem/dt/fluent-plugin-kinesis.svg)](https://rubygems.org/gems/fluent-plugin-kinesis)
7
6
 
@@ -186,6 +185,50 @@ It should be added to assume_role_credentials configuration stanza in the next f
186
185
 
187
186
  STS API endpoint url. This can be used to override the default global STS API endpoint of sts.amazonaws.com. Using regional endpoints may be preferred to reduce latency, and are required if utilizing a PrivateLink VPC Endpoint for STS API calls.
188
187
 
188
+
189
+ ### web_identity_credentials
190
+
191
+ Similar to the assume_role_credentials, but for usage in EKS.
192
+
193
+ <match *>
194
+ @type kinesis_streams
195
+
196
+ <web_identity_credentials>
197
+ role_arn ROLE_ARN
198
+ role_session_name ROLE_SESSION_NAME
199
+ web_identity_token_file AWS_WEB_IDENTITY_TOKEN_FILE
200
+ </web_identity_credentials>
201
+ </match>
202
+
203
+ See also:
204
+
205
+ * [Using IAM Roles - AWS Identity and Access Management](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
206
+ * [IAM Roles For Service Accounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html)
207
+ * [Aws::STS::Client](http://docs.aws.amazon.com/sdkforruby/api/Aws/STS/Client.html)
208
+ * [Aws::AssumeRoleWebIdentityCredentials](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/AssumeRoleWebIdentityCredentials.html)
209
+
210
+ **role_arn (required)**
211
+
212
+ The Amazon Resource Name (ARN) of the role to assume.
213
+
214
+ **role_session_name (required)**
215
+
216
+ An identifier for the assumed role session.
217
+
218
+ **web_identity_token_file (required)**
219
+
220
+ The absolute path to the file on disk containing the OIDC token
221
+
222
+ **policy**
223
+
224
+ An IAM policy in JSON format.
225
+
226
+ **duration_seconds**
227
+
228
+ The duration, in seconds, of the role session. The value can range from
229
+ 900 seconds (15 minutes) to 43200 seconds (12 hours). By default, the value
230
+ is set to 3600 seconds (1 hour).
231
+
189
232
  ### instance_profile_credentials
190
233
 
191
234
  Retrieve temporary security credentials via HTTP request. This is useful on EC2 instance.
@@ -365,6 +408,16 @@ Default:
365
408
  - `kinesis_firehose`: 4 MB
366
409
  - `kinesis_streams_aggregated`: 1 MB
367
410
 
411
+ ### drop_failed_records_after_batch_request_retries
412
+ Boolean, default `true`.
413
+
414
+ If *drop_failed_records_after_batch_request_retries* is enabled (default), the plugin will drop failed records when batch request fails after retrying max times configured as *retries_on_batch_request*. This dropping can be monitored from [monitor_agent](https://docs.fluentd.org/input/monitor_agent) or [fluent-plugin-prometheus](https://docs.fluentd.org/monitoring-fluentd/monitoring-prometheus) as *retry_count* or *num_errors* metrics.
415
+
416
+ If *drop_failed_records_after_batch_request_retries* is disabled, the plugin will raise error and return chunk to Fluentd buffer when batch request fails after retrying max times. Fluentd will retry to send chunk records according to retry config in [Buffer Section](https://docs.fluentd.org/configuration/buffer-section). Note that this retryng may create duplicate records since [PutRecords API](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html) of Kinesis Data Streams and [PutRecordBatch API](https://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html) of Kinesis Data Firehose may return a partially successful response.
417
+
418
+ ### monitor_num_of_batch_request_retries
419
+ Boolean, default `false`. If enabled, the plugin will increment *retry_count* monitoring metrics after internal retrying to send batch request. This configuration enables you to monitor [ProvisionedThroughputExceededException](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html) from [monitor_agent](https://docs.fluentd.org/input/monitor_agent) or [fluent-plugin-prometheus](https://docs.fluentd.org/monitoring-fluentd/monitoring-prometheus). Note that *retry_count* metrics will be counted by the plugin in addition to original Fluentd buffering mechanism if *monitor_num_of_batch_request_retries* is enabled.
420
+
368
421
  ## Configuration: kinesis_streams
369
422
  Here are `kinesis_streams` specific configurations.
370
423
 
@@ -404,6 +457,30 @@ Here are `kinesis_firehose` specific configurations.
404
457
  ### delivery_stream_name
405
458
  Name of the delivery stream to put data.
406
459
 
460
+ As of Fluentd v1, built-in placeholders are supported. Now, you can also use built-in placeholders for this parameter.
461
+
462
+ **NOTE:**
463
+ Built-in placeholders require target key information in your buffer section attributes.
464
+
465
+ e.g.)
466
+
467
+ When you specify the following `delivery_stream_name` configuration with built-in placeholder:
468
+
469
+ ```aconf
470
+ delivery_stream_name "${$.kubernetes.annotations.kinesis_firehose_streams}"
471
+ ```
472
+
473
+ you ought to specify the corresponding attributes in buffer section:
474
+
475
+ ```aconf
476
+ # $.kubernetes.annotations.kinesis_firehose_streams needs to be set in buffer attributes
477
+ <buffer $.kubernetes.annotations.kinesis_firehose_streams>
478
+ # ...
479
+ </buffer>
480
+ ```
481
+
482
+ For more details, refer [Placeholders section in the official Fluentd document](https://docs.fluentd.org/configuration/buffer-section#placeholders).
483
+
407
484
  ### append_new_line
408
485
  Boolean. Default `true`. If it is enabled, the plugin adds new line character (`\n`) to each serialized record.
409
486
  Before appending `\n`, plugin calls chomp and removes separator from the end of each record as [chomp_record](#chomp_record) is `true`. Therefore, you don't need to enable [chomp_record](#chomp_record) option when you use [kinesis_firehose](#kinesis_firehose) output with default configuration ([append_new_line](#append_new_line) is `true`). If you want to set [append_new_line](#append_new_line) `false`, you can choose [chomp_record](#chomp_record) `false` (default) or `true` (compatible format with plugin v2).
@@ -1,17 +1,3 @@
1
- #
2
- # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ gem "fluentd", "1.12.3"
@@ -1,17 +1,3 @@
1
- #
2
- # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
@@ -1,17 +1,3 @@
1
- #
2
- # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
@@ -1,17 +1,3 @@
1
- #
2
- # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
@@ -1,17 +1,3 @@
1
- #
2
- # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
@@ -1,17 +1,3 @@
1
- #
2
- # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Specify related gems for td-agent v3.4.0
7
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/config/projects/td-agent3.rb#L27
8
+ gem "fluentd", "1.4.2"
9
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/plugin_gems.rb#L16-L23
10
+ gem "jmespath", "1.4.0"
11
+ gem "aws-partitions", "1.149.0"
12
+ gem "aws-sigv4", "1.1.0"
13
+ gem "aws-sdk-core", "3.48.3"
14
+ gem "aws-sdk-kms", "1.16.0"
15
+ gem "aws-sdk-sqs", "1.13.0"
16
+ gem "aws-sdk-s3", "1.36.0"
17
+ gem "fluent-plugin-s3", "1.1.9"
@@ -1,29 +1,12 @@
1
- #
2
- # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
4
  gemspec path: ".."
19
5
 
20
6
  # Specify related gems for td-agent v3.4.1
21
- # td-agent v3.4.0 has the same dependencies
22
7
  # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/config/projects/td-agent3.rb#L27
23
- # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/config/projects/td-agent3.rb#L27
24
8
  gem "fluentd", "1.4.2"
25
9
  # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.1/plugin_gems.rb#L16-L23
26
- # https://github.com/treasure-data/omnibus-td-agent/blob/v3.4.0/plugin_gems.rb#L16-L23
27
10
  gem "jmespath", "1.4.0"
28
11
  gem "aws-partitions", "1.149.0"
29
12
  gem "aws-sigv4", "1.1.0"
@@ -1,17 +1,3 @@
1
- #
2
- # Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
@@ -1,17 +1,3 @@
1
- #
2
- # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
1
  source 'https://rubygems.org'
16
2
 
17
3
  # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Specify related gems for td-agent v3.6.0
7
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/config/projects/td-agent3.rb#L27
8
+ gem "fluentd", "1.9.2"
9
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.6.0/plugin_gems.rb#L16-L23
10
+ gem "jmespath", "1.4.0"
11
+ gem "aws-partitions", "1.273.0"
12
+ gem "aws-sigv4", "1.1.0"
13
+ gem "aws-sdk-core", "3.90.0"
14
+ gem "aws-sdk-kms", "1.29.0"
15
+ gem "aws-sdk-sqs", "1.23.1"
16
+ gem "aws-sdk-s3", "1.60.2"
17
+ gem "fluent-plugin-s3", "1.3.0"
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Specify related gems for td-agent v3.7.0
7
+ # https://docs.treasuredata.com/display/public/PD/The+td-agent+Change+Log
8
+ gem "fluentd", "1.10.0"
9
+ # https://github.com/treasure-data/omnibus-td-agent/commit/74920cb2a55e40195961a58c6b6de4bd5b3f1f87#diff-8d45eaa8758f7591f884c9e9917ea96105331a1daf5a891b4645b89e120f2d69R16-R23
10
+ gem "jmespath", "1.4.0"
11
+ gem "aws-partitions", "1.288.0"
12
+ gem "aws-sigv4", "1.1.1"
13
+ gem "aws-sdk-core", "3.92.0"
14
+ gem "aws-sdk-kms", "1.30.0"
15
+ gem "aws-sdk-sqs", "1.24.0"
16
+ gem "aws-sdk-s3", "1.61.1"
17
+ gem "fluent-plugin-s3", "1.3.0"
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Specify related gems for td-agent v3.7.1
7
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/config/projects/td-agent3.rb#L27
8
+ gem "fluentd", "1.10.2"
9
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.7.1/plugin_gems.rb#L16-L23
10
+ gem "jmespath", "1.4.0"
11
+ gem "aws-partitions", "1.297.0"
12
+ gem "aws-sigv4", "1.1.1"
13
+ gem "aws-sdk-core", "3.94.0"
14
+ gem "aws-sdk-kms", "1.30.0"
15
+ gem "aws-sdk-sqs", "1.24.0"
16
+ gem "aws-sdk-s3", "1.63.0"
17
+ gem "fluent-plugin-s3", "1.3.1"
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Specify related gems for td-agent v3.8.0
7
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/config/projects/td-agent3.rb#L27
8
+ gem "fluentd", "1.11.1"
9
+ # https://github.com/treasure-data/omnibus-td-agent/blob/v3.8.0/plugin_gems.rb#L16-L23
10
+ gem "jmespath", "1.4.0"
11
+ gem "aws-partitions", "1.332.0"
12
+ gem "aws-sigv4", "1.2.0"
13
+ gem "aws-sdk-core", "3.100.0"
14
+ gem "aws-sdk-kms", "1.34.1"
15
+ gem "aws-sdk-sqs", "1.28.0"
16
+ gem "aws-sdk-s3", "1.69.1"
17
+ gem "fluent-plugin-s3", "1.3.2"
@@ -0,0 +1,18 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Maintenance release of td-agent v3
7
+ # Specify related gems for td-agent v3.8.1
8
+ # https://github.com/treasure-data/omnibus-td-agent/pull/273/files#diff-f73e763ace61e7c4bf48bf94bd6e295bc2cfd1ce5f9e38a4d19e266353e37498R27
9
+ gem "fluentd", "1.11.5"
10
+ # https://github.com/treasure-data/omnibus-td-agent/pull/273/files#diff-8d45eaa8758f7591f884c9e9917ea96105331a1daf5a891b4645b89e120f2d69R19-R25
11
+ gem "jmespath", "1.4.0"
12
+ gem "aws-partitions", "1.399.0"
13
+ gem "aws-sigv4", "1.2.2"
14
+ gem "aws-sdk-core", "3.109.3"
15
+ gem "aws-sdk-kms", "1.39.0"
16
+ gem "aws-sdk-sqs", "1.34.0"
17
+ gem "aws-sdk-s3", "1.85.0"
18
+ gem "fluent-plugin-s3", "1.4.0"
@@ -0,0 +1,25 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Specify related gems for td-agent v4.0.0
7
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/master/CHANGELOG.md
8
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/41b3436d43c21e48a9cf34c58ae640f0e3dfb44c/td-agent/config.rb#L4
9
+ gem "fluentd", "1.11.1"
10
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/8a8721c2a0b05bc487fb81a04aa079c8bb4e47fb/gemfiles/linux/Gemfile#L31
11
+ gem "prometheus-client", "0.9.0"
12
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/8a8721c2a0b05bc487fb81a04aa079c8bb4e47fb/gemfiles/linux/Gemfile#L19-L20
13
+ gem "fluent-plugin-prometheus", "1.8.0"
14
+ gem "fluent-plugin-prometheus_pushgateway", "0.0.2"
15
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/8a8721c2a0b05bc487fb81a04aa079c8bb4e47fb/gemfiles/linux/Gemfile#L28
16
+ gem "jmespath", "1.4.0"
17
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/8a8721c2a0b05bc487fb81a04aa079c8bb4e47fb/gemfiles/linux/Gemfile#L8-L13
18
+ gem "aws-partitions", "1.337.0"
19
+ gem "aws-sdk-core", "3.102.1"
20
+ gem "aws-sdk-kms", "1.35.0"
21
+ gem "aws-sdk-s3", "1.72.0"
22
+ gem "aws-sdk-sqs", "1.29.0"
23
+ gem "aws-sigv4", "1.2.1"
24
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/8a8721c2a0b05bc487fb81a04aa079c8bb4e47fb/gemfiles/linux/Gemfile#L23
25
+ gem "fluent-plugin-s3", "1.3.3"
@@ -0,0 +1,21 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Specify related gems for td-agent v4.0.1
7
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/master/CHANGELOG.md
8
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.0.1/td-agent/config.rb#L4
9
+ gem "fluentd", "1.11.2"
10
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.0.1/gemfiles/linux/Gemfile#L35-L42
11
+ gem "prometheus-client", "0.9.0"
12
+ gem "fluent-plugin-prometheus", "1.8.2"
13
+ gem "fluent-plugin-prometheus_pushgateway", "0.0.2"
14
+ gem "jmespath", "1.4.0"
15
+ gem "aws-partitions", "1.352.0"
16
+ gem "aws-sdk-core", "3.104.3"
17
+ gem "aws-sdk-kms", "1.36.0"
18
+ gem "aws-sdk-sqs", "1.30.0"
19
+ gem "aws-sigv4", "1.2.1"
20
+ gem "aws-sdk-s3", "1.75.0"
21
+ gem "fluent-plugin-s3", "1.4.0"
@@ -0,0 +1,21 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
4
+ gemspec path: ".."
5
+
6
+ # Specify related gems for td-agent v4.1.0
7
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/master/CHANGELOG.md
8
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.1.0/td-agent/config.rb#L4
9
+ gem "fluentd", "1.12.1"
10
+ # https://github.com/fluent-plugins-nursery/td-agent-builder/blob/v4.1.0/td-agent/Gemfile#L32-L42
11
+ gem "prometheus-client", "0.9.0"
12
+ gem "fluent-plugin-prometheus", "1.8.5"
13
+ gem "fluent-plugin-prometheus_pushgateway", "0.0.2"
14
+ gem "jmespath", "1.4.0"
15
+ gem "aws-partitions", "1.427.0"
16
+ gem "aws-sdk-core", "3.112.0"
17
+ gem "aws-sdk-kms", "1.42.0"
18
+ gem "aws-sdk-sqs", "1.36.0"
19
+ gem "aws-sigv4", "1.2.2"
20
+ gem "aws-sdk-s3", "1.88.1"
21
+ gem "fluent-plugin-s3", "1.5.1"
@@ -84,6 +84,10 @@ module Fluent
84
84
  true
85
85
  end
86
86
 
87
+ def formatted_to_msgpack_binary?
88
+ true
89
+ end
90
+
87
91
  private
88
92
 
89
93
  def data_formatter_create(conf)
@@ -144,13 +148,11 @@ module Fluent
144
148
 
145
149
  def write_records_batch(chunk, &block)
146
150
  unique_id = chunk.dump_unique_id_hex(chunk.unique_id)
147
- chunk.open do |io|
148
- records = msgpack_unpacker(io).to_enum
149
- split_to_batches(records) do |batch, size|
150
- log.debug(sprintf "Write chunk %s / %3d records / %4d KB", unique_id, batch.size, size/1024)
151
- batch_request_with_retry(batch, &block)
152
- log.debug("Finish writing chunk")
153
- end
151
+ records = chunk.to_enum(:msgpack_each)
152
+ split_to_batches(records) do |batch, size|
153
+ log.debug(sprintf "Write chunk %s / %3d records / %4d KB", unique_id, batch.size, size/1024)
154
+ batch_request_with_retry(batch, &block)
155
+ log.debug("Finish writing chunk")
154
156
  end
155
157
  end
156
158
 
@@ -14,6 +14,7 @@
14
14
 
15
15
  require 'fluent_plugin_kinesis/version'
16
16
  require 'fluent/configurable'
17
+ require 'benchmark'
17
18
 
18
19
  module Fluent
19
20
  module Plugin
@@ -40,10 +41,12 @@ module Fluent
40
41
  module BatchRequest
41
42
  module BatchRequestParams
42
43
  include Fluent::Configurable
43
- config_param :retries_on_batch_request, :integer, default: 8
44
- config_param :reset_backoff_if_success, :bool, default: true
45
- config_param :batch_request_max_count, :integer, default: nil
46
- config_param :batch_request_max_size, :integer, default: nil
44
+ config_param :retries_on_batch_request, :integer, default: 8
45
+ config_param :reset_backoff_if_success, :bool, default: true
46
+ config_param :batch_request_max_count, :integer, default: nil
47
+ config_param :batch_request_max_size, :integer, default: nil
48
+ config_param :drop_failed_records_after_batch_request_retries, :bool, default: true
49
+ config_param :monitor_num_of_batch_request_retries, :bool, default: false
47
50
  end
48
51
 
49
52
  def self.included(mod)
@@ -96,11 +99,9 @@ module Fluent
96
99
  wait_second = backoff.next
97
100
  msg = 'Retrying to request batch. Retry count: %3d, Retry records: %3d, Wait seconds %3.2f' % [retry_count+1, failed_records.size, wait_second]
98
101
  log.warn(truncate msg)
99
- # TODO: sleep() doesn't wait the given seconds sometime.
100
- # The root cause is unknown so far, so I'd like to add debug print only. It should be fixed in the future.
101
- log.debug("#{Thread.current.object_id} sleep start")
102
- sleep(wait_second)
103
- log.debug("#{Thread.current.object_id} sleep finish")
102
+ # Increment num_errors to monitor batch request retries from "monitor_agent" or "fluent-plugin-prometheus"
103
+ increment_num_errors if @monitor_num_of_batch_request_retries
104
+ reliable_sleep(wait_second)
104
105
  batch_request_with_retry(retry_records(failed_records), retry_count+1, backoff: backoff, &block)
105
106
  else
106
107
  give_up_retries(failed_records)
@@ -108,6 +109,18 @@ module Fluent
108
109
  end
109
110
  end
110
111
 
112
+ # Sleep seems to not sleep as long as we ask it, our guess is that something wakes up the thread,
113
+ # so we keep on going to sleep if that happens.
114
+ # TODO: find out who is causing the sleep to be too short and try to make them stop it instead
115
+ def reliable_sleep(wait_second)
116
+ loop do
117
+ actual = Benchmark.realtime { sleep(wait_second) }
118
+ break if actual >= wait_second
119
+ log.error("#{Thread.current.object_id} sleep failed expected #{wait_second} but slept #{actual}")
120
+ wait_second -= actual
121
+ end
122
+ end
123
+
111
124
  def any_records_shipped?(res)
112
125
  results(res).size > failed_count(res)
113
126
  end
@@ -164,6 +177,49 @@ module Fluent
164
177
  record[:original]
165
178
  ])
166
179
  }
180
+
181
+ if @drop_failed_records_after_batch_request_retries
182
+ # Increment num_errors to monitor batch request failure from "monitor_agent" or "fluent-plugin-prometheus"
183
+ increment_num_errors
184
+ else
185
+ # Raise error and return chunk to Fluentd for retrying
186
+ case request_type
187
+ # @see https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html
188
+ # @see https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Kinesis/Client.html#put_records-instance_method
189
+ # @see https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Kinesis/Errors.html
190
+ when :streams, :streams_aggregated
191
+ provisioned_throughput_exceeded_records = failed_records.select { |record| record[:error_code] == 'ProvisionedThroughputExceededException' }
192
+ target_failed_record = provisioned_throughput_exceeded_records.first || failed_records.first
193
+ target_error = provisioned_throughput_exceeded_records.empty? ?
194
+ Aws::Kinesis::Errors::ServiceError :
195
+ Aws::Kinesis::Errors::ProvisionedThroughputExceededException
196
+ # @see https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html
197
+ # @see https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Firehose/Client.html#put_record_batch-instance_method
198
+ # @see https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Firehose/Errors.html
199
+ when :firehose
200
+ service_unavailable_exception_records = failed_records.select { |record| record[:error_code] == 'ServiceUnavailableException' }
201
+ target_failed_record = service_unavailable_exception_records.first || failed_records.first
202
+ target_error = service_unavailable_exception_records.empty? ?
203
+ Aws::Firehose::Errors::ServiceError :
204
+ Aws::Firehose::Errors::ServiceUnavailableException
205
+ end
206
+ log.error("Raise #{target_failed_record[:error_code]} and return chunk to Fluentd buffer for retrying")
207
+ raise target_error.new(Seahorse::Client::RequestContext.new, target_failed_record[:error_message])
208
+ end
209
+ end
210
+
211
+ def increment_num_errors
212
+ # Prepare Fluent::Plugin::Output instance variables to count errors in this method.
213
+ # These instance variables are initialized here for possible future breaking changes of Fluentd.
214
+ @num_errors ||= 0
215
+ # @see https://github.com/fluent/fluentd/commit/d245454658d16170431d276fcd5849fb0d88ab2b
216
+ if Gem::Version.new(Fluent::VERSION) >= Gem::Version.new('1.7.0')
217
+ @counter_mutex ||= Mutex.new
218
+ @counter_mutex.synchronize{ @num_errors += 1 }
219
+ else
220
+ @counters_monitor ||= Monitor.new
221
+ @counters_monitor.synchronize{ @num_errors += 1 }
222
+ end
167
223
  end
168
224
 
169
225
  class Backoff
@@ -46,6 +46,20 @@ module Fluent
46
46
  desc "A URL for a regional STS API endpoint, the default is global"
47
47
  config_param :sts_endpoint_url, :string, default: nil
48
48
  end
49
+ # Refer to the following link for additional parameters that could be added:
50
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/STS/Client.html#assume_role_with_web_identity-instance_method
51
+ config_section :web_identity_credentials, multi: false do
52
+ desc "The Amazon Resource Name (ARN) of the role to assume"
53
+ config_param :role_arn, :string
54
+ desc "An identifier for the assumed role session"
55
+ config_param :role_session_name, :string
56
+ desc "The absolute path to the file on disk containing the OIDC token"
57
+ config_param :web_identity_token_file, :string, default: nil #required
58
+ desc "An IAM policy in JSON format"
59
+ config_param :policy, :string, default: nil
60
+ desc "The duration, in seconds, of the role session (900-43200)"
61
+ config_param :duration_seconds, :time, default: nil
62
+ end
49
63
  config_section :instance_profile_credentials, multi: false do
50
64
  desc "Number of times to retry when retrieving credentials"
51
65
  config_param :retries, :integer, default: nil
@@ -133,7 +147,9 @@ module Fluent
133
147
  credentials_options[:duration_seconds] = c.duration_seconds if c.duration_seconds
134
148
  credentials_options[:external_id] = c.external_id if c.external_id
135
149
  credentials_options[:sts_endpoint_url] = c.sts_endpoint_url if c.sts_endpoint_url
136
- if c.sts_http_proxy and c.sts_endpoint_url
150
+ if @region and c.sts_http_proxy and c.sts_endpoint_url
151
+ credentials_options[:client] = Aws::STS::Client.new(region: @region, http_proxy: c.sts_http_proxy, endpoint: c.sts_endpoint_url)
152
+ elsif c.sts_http_proxy and c.sts_endpoint_url
137
153
  credentials_options[:client] = Aws::STS::Client.new(http_proxy: c.sts_http_proxy, endpoint: c.sts_endpoint_url)
138
154
  elsif @region and c.sts_http_proxy
139
155
  credentials_options[:client] = Aws::STS::Client.new(region: @region, http_proxy: c.sts_http_proxy)
@@ -147,6 +163,17 @@ module Fluent
147
163
  credentials_options[:client] = Aws::STS::Client.new(region: @region)
148
164
  end
149
165
  options[:credentials] = Aws::AssumeRoleCredentials.new(credentials_options)
166
+ when @web_identity_credentials
167
+ c = @web_identity_credentials
168
+ credentials_options[:role_arn] = c.role_arn
169
+ credentials_options[:role_session_name] = c.role_session_name
170
+ credentials_options[:web_identity_token_file] = c.web_identity_token_file
171
+ credentials_options[:policy] = c.policy if c.policy
172
+ credentials_options[:duration_seconds] = c.duration_seconds if c.duration_seconds
173
+ if @region
174
+ credentials_options[:client] = Aws::STS::Client.new(:region => @region)
175
+ end
176
+ options[:credentials] = Aws::AssumeRoleWebIdentityCredentials.new(credentials_options)
150
177
  when @instance_profile_credentials
151
178
  c = @instance_profile_credentials
152
179
  credentials_options[:retries] = c.retries if c.retries
@@ -44,12 +44,13 @@ module Fluent
44
44
  end
45
45
 
46
46
  def write(chunk)
47
+ delivery_stream_name = extract_placeholders(@delivery_stream_name, chunk)
47
48
  write_records_batch(chunk) do |batch|
48
49
  records = batch.map{|(data)|
49
50
  { data: data }
50
51
  }
51
52
  client.put_record_batch(
52
- delivery_stream_name: @delivery_stream_name,
53
+ delivery_stream_name: delivery_stream_name,
53
54
  records: records,
54
55
  )
55
56
  end
@@ -13,5 +13,5 @@
13
13
  # language governing permissions and limitations under the License.
14
14
 
15
15
  module FluentPluginKinesis
16
- VERSION = '3.2.1'
16
+ VERSION = '3.4.0'
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-kinesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-20 00:00:00.000000000 Z
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -284,15 +284,24 @@ files:
284
284
  - benchmark/task.rake
285
285
  - fluent-plugin-kinesis.gemspec
286
286
  - gemfiles/Gemfile.fluentd-0.14.22
287
- - gemfiles/Gemfile.fluentd-1.9.1
287
+ - gemfiles/Gemfile.fluentd-1.12.3
288
288
  - gemfiles/Gemfile.td-agent-3.1.0
289
289
  - gemfiles/Gemfile.td-agent-3.1.1
290
290
  - gemfiles/Gemfile.td-agent-3.2.0
291
291
  - gemfiles/Gemfile.td-agent-3.2.1
292
292
  - gemfiles/Gemfile.td-agent-3.3.0
293
+ - gemfiles/Gemfile.td-agent-3.4.0
293
294
  - gemfiles/Gemfile.td-agent-3.4.1
294
295
  - gemfiles/Gemfile.td-agent-3.5.0
295
296
  - gemfiles/Gemfile.td-agent-3.5.1
297
+ - gemfiles/Gemfile.td-agent-3.6.0
298
+ - gemfiles/Gemfile.td-agent-3.7.0
299
+ - gemfiles/Gemfile.td-agent-3.7.1
300
+ - gemfiles/Gemfile.td-agent-3.8.0
301
+ - gemfiles/Gemfile.td-agent-3.8.1
302
+ - gemfiles/Gemfile.td-agent-4.0.0
303
+ - gemfiles/Gemfile.td-agent-4.0.1
304
+ - gemfiles/Gemfile.td-agent-4.1.0
296
305
  - lib/fluent/plugin/kinesis.rb
297
306
  - lib/fluent/plugin/kinesis_helper/aggregator.rb
298
307
  - lib/fluent/plugin/kinesis_helper/api.rb
@@ -320,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
320
329
  - !ruby/object:Gem::Version
321
330
  version: '0'
322
331
  requirements: []
323
- rubygems_version: 3.0.3
332
+ rubygems_version: 3.1.4
324
333
  signing_key:
325
334
  specification_version: 4
326
335
  summary: Fluentd output plugin that sends events to Amazon Kinesis.
@@ -1,20 +0,0 @@
1
- #
2
- # Copyright 2014-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License"). You
5
- # may not use this file except in compliance with the License. A copy of
6
- # the License is located at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # or in the "license" file accompanying this file. This file is
11
- # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
12
- # ANY KIND, either express or implied. See the License for the specific
13
- # language governing permissions and limitations under the License.
14
-
15
- source 'https://rubygems.org'
16
-
17
- # Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
18
- gemspec path: ".."
19
-
20
- gem "fluentd", "1.9.1"