fluent-plugin-kinesis 1.3.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -23
  3. data/CHANGELOG.md +13 -0
  4. data/Gemfile +9 -9
  5. data/LICENSE.txt +201 -40
  6. data/Makefile +24 -31
  7. data/README.md +179 -308
  8. data/Rakefile +9 -13
  9. data/benchmark/task.rake +96 -58
  10. data/fluent-plugin-kinesis.gemspec +15 -19
  11. data/gemfiles/Gemfile.fluentd-0.12 +10 -10
  12. data/lib/fluent/plugin/kinesis.rb +166 -0
  13. data/lib/fluent/plugin/kinesis_helper/aggregator.rb +99 -0
  14. data/lib/fluent/plugin/kinesis_helper/api.rb +152 -121
  15. data/lib/fluent/plugin/kinesis_helper/client.rb +125 -12
  16. data/lib/fluent/plugin/out_kinesis_firehose.rb +40 -27
  17. data/lib/fluent/plugin/out_kinesis_streams.rb +51 -30
  18. data/lib/fluent/plugin/out_kinesis_streams_aggregated.rb +76 -0
  19. data/lib/fluent_plugin_kinesis/version.rb +10 -10
  20. metadata +18 -70
  21. data/README-v0.4.md +0 -348
  22. data/benchmark/dummy.conf +0 -0
  23. data/gemfiles/Gemfile.aws-sdk-2.4 +0 -20
  24. data/gemfiles/Gemfile.fluentd-0.10.58 +0 -20
  25. data/gemfiles/Gemfile.fluentd-0.14.11 +0 -20
  26. data/gemfiles/Gemfile.ruby-2.0 +0 -21
  27. data/gemfiles/Gemfile.ruby-2.1 +0 -21
  28. data/lib/fluent/plugin/kinesis_helper.rb +0 -36
  29. data/lib/fluent/plugin/kinesis_helper/class_methods.rb +0 -123
  30. data/lib/fluent/plugin/kinesis_helper/credentials.rb +0 -51
  31. data/lib/fluent/plugin/kinesis_helper/error.rb +0 -43
  32. data/lib/fluent/plugin/kinesis_helper/format.rb +0 -85
  33. data/lib/fluent/plugin/kinesis_helper/initialize.rb +0 -59
  34. data/lib/fluent/plugin/kinesis_helper/kpl.rb +0 -82
  35. data/lib/fluent/plugin/out_kinesis.rb +0 -323
  36. data/lib/fluent/plugin/out_kinesis_producer.rb +0 -48
  37. data/lib/fluent/plugin/patched_detach_process_impl.rb +0 -103
  38. data/lib/kinesis_producer.rb +0 -24
  39. data/lib/kinesis_producer/binary.rb +0 -10
  40. data/lib/kinesis_producer/daemon.rb +0 -270
  41. data/lib/kinesis_producer/library.rb +0 -122
  42. data/lib/kinesis_producer/protobuf/config.pb.rb +0 -66
  43. data/lib/kinesis_producer/protobuf/messages.pb.rb +0 -151
  44. data/lib/kinesis_producer/tasks/binary.rake +0 -73
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 304cad8054202f54af88f9eabb61b3795e2a5d5d
4
- data.tar.gz: a8bbcb160baaccfcbe2eaf4514a0e1bb87d950f2
3
+ metadata.gz: 24d75eb607afb3a1a251ab9bac156cde85e5053e
4
+ data.tar.gz: 30bb3774c5c3f9f8aa5f921ed8e78a6bc49e495e
5
5
  SHA512:
6
- metadata.gz: 3d6ad1a860cb384eb5d14063d53fd4490c85e57c815ca7442db1998d00a5b2455168164085d5911823a4046ecc48279b1ecf2de06937541a6f9e118a06ebf506
7
- data.tar.gz: ff3da727150ee12fe731b63397a12f2dd54fc79d3adaf091c2504557cb2d29a3804adcc8fffa4c1b07f710a2ec8bf89ad4a53af30fd28637c9c62961f5a62b40
6
+ metadata.gz: 2b8d65b4999dc9ad78f88119ee166649dd96b3df1f1acadd707134333f14aa50f4052b58ca2870712e34f5a0bfd583a21c208c71e58538fd60cf6bd7d66e127d
7
+ data.tar.gz: 598e0b74f91110529ea4a89e22f1d62b5b8f55dd5860d76980001be4e4a7cc57514767fa58e7892741002794fec89c4537fe494dd2ab73e14c47871f8bbf1bb8
data/.travis.yml CHANGED
@@ -2,33 +2,12 @@ language: ruby
2
2
 
3
3
  matrix:
4
4
  include:
5
- - rvm: 2.0.0-p648
6
- os: linux
7
- gemfile: gemfiles/Gemfile.ruby-2.0
8
- - rvm: 2.1.10
9
- os: linux
10
- gemfile: gemfiles/Gemfile.ruby-2.1
11
- - rvm: 2.2.6
5
+ - rvm: 2.4.1
12
6
  os: linux
13
7
  gemfile: Gemfile
14
- - rvm: 2.3.3
15
- os: linux
16
- gemfile: Gemfile
17
- - rvm: 2.4.0
18
- os: linux
19
- gemfile: Gemfile
20
- - rvm: 2.3.3
21
- os: linux
22
- gemfile: gemfiles/Gemfile.fluentd-0.10.58
23
- - rvm: 2.3.3
8
+ - rvm: 2.1.10
24
9
  os: linux
25
10
  gemfile: gemfiles/Gemfile.fluentd-0.12
26
- - rvm: 2.3.3
27
- os: linux
28
- gemfile: gemfiles/Gemfile.fluentd-0.14.11
29
- - rvm: 2.3.3
30
- os: linux
31
- gemfile: gemfiles/Gemfile.aws-sdk-2.4
32
11
 
33
12
  script: bundle exec rake test
34
13
 
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.0.0
4
+
5
+ - Feature - Add `kinesis_streams_aggregated` ouput plugin [#107](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/107)
6
+ - Feature - Support fluentd worker model [#104](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/104)
7
+ - Feature - Support AWS SDK for Ruby v3 [#102](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/102)
8
+ - Enhancement - Refactor class design [#103](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/103)
9
+ - Enhancement - More configuration for AssumeRole [#63](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/63)
10
+ - Enhancement - Refactor credentials helper [#94](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/94)
11
+ - Enhancement - Revisit backoff logic [#69](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/69)
12
+ - Enhancement - Support compressing output [#98](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/98)
13
+ - Enhancement - Support nanosecond time_key format [#124](https://github.com/awslabs/aws-fluent-plugin-kinesis/issues/124)
14
+ - License - Move back to Apache License Version 2.0
15
+
3
16
  ## 1.3.0
4
17
 
5
18
  - Feature - Log KPL stdout/err to logger [#129](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/129) [#130](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/130)
data/Gemfile CHANGED
@@ -1,16 +1,16 @@
1
1
  #
2
- # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  #
4
- # Licensed under the Amazon Software License (the "License").
5
- # You may not use this file except in compliance with the License.
6
- # A copy of the License is located at
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
7
  #
8
- # http://aws.amazon.com/asl/
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
9
  #
10
- # or in the "license" file accompanying this file. This file is distributed
11
- # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12
- # express or implied. See the License for the specific language governing
13
- # permissions and limitations under the License.
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
14
 
15
15
  source 'https://rubygems.org'
16
16
 
data/LICENSE.txt CHANGED
@@ -1,40 +1,201 @@
1
-
2
- Amazon Software License
3
-
4
- This Amazon Software License (“License”) governs your use, reproduction, and distribution of the accompanying software as specified below.
5
- 1. Definitions
6
-
7
- “Licensor” means any person or entity that distributes its Work.
8
-
9
- “Software” means the original work of authorship made available under this License.
10
-
11
- “Work” means the Software and any additions to or derivative works of the Software that are made available under this License.
12
-
13
- The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the meaning as provided under U.S. copyright law; provided, however, that for the purposes of this License, derivative works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work.
14
-
15
- Works, including the Software, are “made available” under this License by including in or with the Work either (a) a copyright notice referencing the applicability of this License to the Work, or (b) a copy of this License.
16
- 2. License Grants
17
-
18
- 2.1 Copyright Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free, copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense and distribute its Work and any resulting derivative works in any form.
19
-
20
- 2.2 Patent Grant. Subject to the terms and conditions of this License, each Licensor grants to you a perpetual, worldwide, non-exclusive, royalty-free patent license to make, have made, use, sell, offer for sale, import, and otherwise transfer its Work, in whole or in part. The foregoing license applies only to the patent claims licensable by Licensor that would be infringed by Licensor’s Work (or portion thereof) individually and excluding any combinations with any other materials or technology.
21
- 3. Limitations
22
-
23
- 3.1 Redistribution. You may reproduce or distribute the Work only if (a) you do so under this License, (b) you include a complete copy of this License with your distribution, and (c) you retain without modification any copyright, patent, trademark, or attribution notices that are present in the Work.
24
-
25
- 3.2 Derivative Works. You may specify that additional or different terms apply to the use, reproduction, and distribution of your derivative works of the Work (“Your Terms”) only if (a) Your Terms provide that the use limitation in Section 3.3 applies to your derivative works, and (b) you identify the specific derivative works that are subject to Your Terms. Notwithstanding Your Terms, this License (including the redistribution requirements in Section 3.1) will continue to apply to the Work itself.
26
-
27
- 3.3 Use Limitation. The Work and any derivative works thereof only may be used or intended for use with the web services, computing platforms or applications provided by Amazon.com, Inc. or its affiliates, including Amazon Web Services, Inc.
28
-
29
- 3.4 Patent Claims. If you bring or threaten to bring a patent claim against any Licensor (including any claim, cross-claim or counterclaim in a lawsuit) to enforce any patents that you allege are infringed by any Work, then your rights under this License from such Licensor (including the grants in Sections 2.1 and 2.2) will terminate immediately.
30
-
31
- 3.5 Trademarks. This License does not grant any rights to use any Licensor’s or its affiliates’ names, logos, or trademarks, except as necessary to reproduce the notices described in this License.
32
-
33
- 3.6 Termination. If you violate any term of this License, then your rights under this License (including the grants in Sections 2.1 and 2.2) will terminate immediately.
34
- 4. Disclaimer of Warranty.
35
-
36
- THE WORK IS PROVIDED “AS IS” WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF M ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER THIS LICENSE. SOME STATES’ CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.
37
- 5. Limitation of Liability.
38
-
39
- EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER COMM ERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
40
-
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/Makefile CHANGED
@@ -1,49 +1,42 @@
1
1
  #
2
- # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ # Copyright 2014-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  #
4
- # Licensed under the Amazon Software License (the "License").
5
- # You may not use this file except in compliance with the License.
6
- # A copy of the License is located at
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
7
  #
8
- # http://aws.amazon.com/asl/
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
9
  #
10
- # or in the "license" file accompanying this file. This file is distributed
11
- # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12
- # express or implied. See the License for the specific language governing
13
- # permissions and limitations under the License.
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
14
 
15
- .PHONY: copyright test install benchmark benchmark-streams benchmark-producer hello $(wildcard test/test_*.rb) $(wildcard test/**/test_*.rb)
15
+ .PHONY: run run-v0.12 test test-v.012 install $(wildcard test/test_*.rb) $(wildcard test/**/test_*.rb) benchmark benchmark-remote
16
16
 
17
17
  all:
18
18
  bundle install
19
- bundle exec rake binaries
19
+
20
+ run:
21
+ bundle exec fluentd -v
22
+
23
+ run-v0.12:
24
+ BUNDLE_GEMFILE=./gemfiles/Gemfile.fluentd-0.12 bundle exec fluentd -v
20
25
 
21
26
  test:
22
27
  bundle exec rake test
23
28
 
29
+ test-v.012:
30
+ BUNDLE_GEMFILE=./gemfiles/Gemfile.fluentd-0.12 bundle exec rake test
31
+
24
32
  install:
25
33
  bundle exec rake install:local
26
34
 
27
- benchmark: benchmark-streams benchmark-producer
28
-
29
- benchmark-streams:
30
- bundle exec rake benchmark TYPE=streams
31
-
32
- benchmark-producer:
33
- bundle exec rake benchmark TYPE=producer
34
-
35
- hello:
36
- echo Hello World | bundle exec fluent-cat --none dummy
37
-
38
35
  $(wildcard test/test_*.rb) $(wildcard test/**/test_*.rb):
39
36
  bundle exec rake test TEST=$@
40
37
 
41
- copyright:
42
- find . \( -name 'Gemfile*' \
43
- -or -name 'Makefile' \
44
- -or -name 'NOTICE.txt' \
45
- -or -name 'Rakefile' \
46
- -or -name 'fluent-plugin-kinesis.gemspec' \
47
- -or -name '*.rake' \
48
- -or -name '*.rb' \
49
- \) -exec sed -i '' -e 's/Copyright 2014-2017/Copyright 2014-2017/' {} \;
38
+ benchmark:
39
+ bundle exec rake benchmark:local
40
+
41
+ benchmark-remote:
42
+ bundle exec rake benchmark:remote
data/README.md CHANGED
@@ -1,23 +1,16 @@
1
1
  # Fluent plugin for Amazon Kinesis
2
2
 
3
- [![Build Status](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis.svg?branch=master)](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis)
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) [![Build Status](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis.svg?branch=master)](https://travis-ci.org/awslabs/aws-fluent-plugin-kinesis)
4
4
 
5
5
  [Fluentd][fluentd] output plugin
6
- that sends events to [Amazon Kinesis Streams][streams] (via both API and [Kinesis Producer Library (KPL)][producer]) and [Amazon Kinesis Firehose][firehose] (via API). This gem includes three output plugins respectively:
6
+ that sends events to [Amazon Kinesis Streams][streams] and [Amazon Kinesis Firehose][firehose]. Also it supports [KPL Aggregated record format][kpl]. This gem includes three output plugins respectively:
7
7
 
8
8
  - `kinesis_streams`
9
- - `kinesis_producer`
10
9
  - `kinesis_firehose`
10
+ - `kinesis_streams_aggregated`
11
11
 
12
12
  Also, there is a [documentation on Fluentd official site][fluentd-doc-kinesis].
13
13
 
14
- ## Warning: `kinesis` is no longer supported
15
- As of v1.0.0, `kinesis` plugin is no longer supported. Still you can use the plugin, but if you see the warn log below, please consider to use `kinesis_streams`.
16
-
17
- [warn]: Deprecated warning: out_kinesis is no longer supported after v1.0.0. Please check out_kinesis_streams out.
18
-
19
- If you still want to use `kinesis`, please see [the old README][old-readme].
20
-
21
14
  ## Installation
22
15
  This fluentd plugin is available as the `fluent-plugin-kinesis` gem from RubyGems.
23
16
 
@@ -53,8 +46,8 @@ Or just download specify your Ruby library path. Below is the sample for specify
53
46
  export RUBYLIB=$RUBYLIB:/path/to/aws-fluent-plugin-kinesis/lib
54
47
 
55
48
  ## Dependencies
56
- * Ruby 2.0.0+
57
- * Fluentd 0.10.58+
49
+ * Ruby 2.1.0+
50
+ * Fluentd 0.12.35+
58
51
 
59
52
  ## Basic Usage
60
53
  Here are general procedures for using this plugin:
@@ -87,15 +80,6 @@ Assume you use Amazon EC2 instances with Instance profile. If you want to use sp
87
80
  </match>
88
81
  For more detail, see [Configuration: kinesis_streams](#configuration-kinesis_streams)
89
82
 
90
- ### kinesis_producer
91
- <match your_tag>
92
- @type kinesis_producer
93
- region us-east-1
94
- stream_name your_stream
95
- partition_key key # Otherwise, use random partition key
96
- </match>
97
- For more detail, see [Configuration: kinesis_producer](#configuration-kinesis_producer)
98
-
99
83
  ### kinesis_firehose
100
84
  <match your_tag>
101
85
  @type kinesis_firehose
@@ -104,6 +88,16 @@ For more detail, see [Configuration: kinesis_producer](#configuration-kinesis_pr
104
88
  </match>
105
89
  For more detail, see [Configuration: kinesis_firehose](#configuration-kinesis_firehose)
106
90
 
91
+ ### kinesis_streams_aggregated
92
+ <match your_tag>
93
+ @type kinesis_streams_aggregated
94
+ region us-east-1
95
+ stream_name your_stream
96
+ # Unlike kinesis_streams, there is no way to use dynamic partition key.
97
+ # fixed_partition_key or random.
98
+ </match>
99
+ For more detail, see [Configuration: kinesis_streams_aggregated](#configuration-kinesis_streams_aggregated)
100
+
107
101
  ### For better throughput
108
102
  Add configuration like below:
109
103
 
@@ -116,346 +110,241 @@ Add configuration like below:
116
110
  Note: Each value should be adjusted to your system by yourself.
117
111
 
118
112
  ## Configuration: Credentials
119
- To put records into Amazon Kinesis Streams or Firehose, you need to provide AWS security credentials.
113
+ To put records into Amazon Kinesis Streams or Firehose, you need to provide AWS security credentials somehow. Without specifiying credentials in config file, this plugin automatically fetch credential just following AWS SDK for Ruby does (environment variable, shared profile, and instance profile).
120
114
 
121
- The credential provider will be choosen by the steps below:
115
+ This plugin uses the same configuration in [fluent-plugin-s3][fluent-plugin-s3].
122
116
 
123
- - Use [**shared_credentials**](#shared_credentials) section if you set it
124
- - Use [**assume_role_credentials**](#assume_role_credentials) section if you set it
125
- - Otherwise, default provider chain:
126
- - [**aws_key_id**](#aws_key_id) and [**aws_sec_key**](#aws_sec_key)
127
- - Environment variables (ex. `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, etc.)
128
- - Default shared credentials (`default` in `~/.aws/credentials`)
129
- - Instance profile (For Amazon EC2)
117
+ **aws_key_id**
130
118
 
131
- ### aws_key_id
132
- AWS access key id.
119
+ AWS access key id. This parameter is required when your agent is not
120
+ running on EC2 instance with an IAM Role. When using an IAM role, make
121
+ sure to configure `instance_profile_credentials`. Usage can be found below.
133
122
 
134
- ### aws_sec_key
135
- AWS secret access key.
136
-
137
- ### shared_credentials
138
- Use this config section to specify shared credential file path and profile name. If you want to use default profile (`default` in `~/.aws/credentials`), you don't have to specify here. For example, you can specify the config like below:
123
+ **aws_sec_key**
139
124
 
140
- <shared_credentials>
141
- profile_name "your_profile_name"
142
- </shared_credentials>
125
+ AWS secret key. This parameter is required when your agent is not running
126
+ on EC2 instance with an IAM Role.
143
127
 
144
- #### profile_name
145
- Profile name of the credential file.
128
+ **aws_iam_retries**
146
129
 
147
- #### path
148
- Path for the credential file.
130
+ The number of attempts to make (with exponential backoff) when loading
131
+ instance profile credentials from the EC2 metadata service using an IAM
132
+ role. Defaults to 5 retries.
149
133
 
150
134
  ### assume_role_credentials
151
- Use this config section for cross account access. For example, you can specify the config like below:
135
+ Typically, you use AssumeRole for cross-account access or federation.
136
+
137
+ <match *>
138
+ @type kinesis_streams
152
139
 
153
140
  <assume_role_credentials>
154
- role_arn "your_role_arn_in_cross_account_to_assume"
141
+ role_arn ROLE_ARN
142
+ role_session_name ROLE_SESSION_NAME
155
143
  </assume_role_credentials>
156
-
157
- #### role_arn
158
- IAM Role to be assumed with [AssumeRole][assume_role].
159
-
160
- #### external_id
161
- A unique identifier that is used by third parties when [assuming roles][assmue_role] in their customers' accounts. Use this option with `role_arn` for third party cross account access. For detail, please see [How to Use an External ID When Granting Access to Your AWS Resources to a Third Party][external_id].
162
-
163
- ## Configuraion: Format
164
- This plugin use `Fluent::TextFormatter` to serialize record to string. For more detail, see [formatter.rb]. Also, this plugin includes `Fluent::SetTimeKeyMixin` and `Fluent::SetTagKeyMixin` to use **include_time_key** and **include_tagkey**.
165
-
166
- ### formatter
167
- Default `json`.
168
-
169
- ### include_time_key
170
- Defalut `false`. If you want to include `time` field in your record, set `true`.
171
-
172
- ### include_tag_key
173
- Defalut `false`. If you want to include `tag` field in your record, set `true`.
174
-
175
- ### data_key
176
- If your record contains a field whose string should be sent to Amazon Kinesis directly (without formatter), use this parameter to specify the field. In that case, other fileds than **data_key** are thrown away and never sent to Amazon Kinesis. Default `nil`, which means whole record will be formatted and sent.
177
-
178
- ### log_truncate_max_size
179
- Integer, default 0. When emitting the log entry, the message will be truncated by this size to avoid infinite loop when the log is also sent to Kinesis. The value 0 (default) means no truncation.
180
-
181
- ### reduce_max_size_error_message
182
- Boolean, default false. When each record exceeds the maximum size, the original record is put on its error message. If this parameter is turned on, the error message will contain only summarized data to prevent large traffic generated by the error message.
183
-
184
- ## Configuration: kinesis_streams
185
- Here are `kinesis_streams` specific configurations.
186
-
187
- ### stream_name
188
- Name of the stream to put data.
189
-
190
- ### region
191
- AWS region of your stream. It should be in form like `us-east-1`, `us-west-2`. Refer to [Regions and Endpoints in AWS General Reference][region] for supported regions.
192
-
193
- Default `nil`, which means try to find from environment variable `AWS_REGION`.
194
-
195
- ### partition_key
196
- A key to extract partition key from JSON object. Default `nil`, which means partition key will be generated randomly.
197
-
198
- ### retries_on_batch_request
199
- Integer, default is 3. The plugin will put multiple records to Amazon Kinesis Streams in batches using PutRecords. A set of records in a batch may fail for reasons documented in the Kinesis Service API Reference for PutRecords. Failed records will be retried **retries_on_batch_request** times. If a record fails all retries an error log will be emitted.
200
-
201
- ### reset_backoff_if_success
202
- Boolean, default `true`. If enabled, when after retrying, the next retrying checks the number of succeeded records on the former batch request and reset exponential backoff if there is any success. Because batch request could be composed by requests across shards, simple exponential backoff for the batch request wouldn't work some cases.
203
-
204
- ### batch_request_max_count
205
- Integer, default 500. The number of max count of making batch request from record chunk. It can't exceed the default value because it's API limit.
206
-
207
- ### batch_request_max_size
208
- Integer, default 5 * 1024 * 1024. The number of max size of making batch request from record chunk. It can't exceed the default value because it's API limit.
209
-
210
- ### http_proxy
211
- HTTP proxy for API calling. Default `nil`.
212
-
213
- ### endpoint
214
- API endpoint URL, for testing. Defalut `nil`.
215
-
216
- ### ssl_verify_peer
217
- Boolean. Disable if you want to verify ssl conncetion, for testing. Default `true`.
218
-
219
- ### debug
220
- Boolean. Enable if you need to debug Amazon Kinesis Firehose API call. Default is `false`.
221
-
222
- ## Configuration: kinesis_producer
223
- Here are `kinesis_producer` specific configurations.
224
-
225
- ### stream_name
226
- Name of the stream to put data.
227
-
228
- ### region
229
- AWS region of your stream. It should be in form like `us-east-1`, `us-west-2`. Refer to [Regions and Endpoints in AWS General Reference][region] for supported regions.
230
-
231
- Default `nil`, which means try to find from environment variable `AWS_REGION`. If both **region** and `AWS_REGION` are not defined, KPL will try to find region from Amazon EC2 metadata.
232
-
233
- ### partition_key
234
- A key to extract partition key from JSON object. Default `nil`, which means partition key will be generated randomly.
235
-
236
- ### debug
237
- Boolean. Enable if you need to debug Kinesis Producer Library metrics. Default is `false`.
238
-
239
- ### enable_kpl_logging
240
- Boolean, default `false`. If you want to log KPL binary's stdout/err, make this parameter `true`.
241
-
242
- ### kinesis_producer
243
- This section is configuration for Kinesis Producer Library. Almost all of description comes from [deault_config.propertites of KPL Java Sample Application][default_config.properties]. You should specify configurations below inside `<kinesis_producer>` section like:
244
-
245
- <match your_tag>
246
- @type kinesis_producer
247
- region us-east-1
248
- stream_name your_stream
249
- <kinesis_producer>
250
- record_max_buffered_time 10
251
- </kinesis_producer>
252
144
  </match>
253
145
 
254
- #### aggregation_enabled
255
- Enable aggregation. With aggregation, multiple user records are packed into a single KinesisRecord. If disabled, each user record is sent in its own KinesisRecord.
256
-
257
- If your records are small, enabling aggregation will allow you to put many more records than you would otherwise be able to for a shard before getting throttled.
146
+ See also:
258
147
 
259
- Default: `true`
148
+ * [Using IAM Roles - AWS Identity and Access
149
+ Management](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
150
+ * [Aws::STS::Client](http://docs.aws.amazon.com/sdkforruby/api/Aws/STS/Client.html)
151
+ * [Aws::AssumeRoleCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/AssumeRoleCredentials.html)
260
152
 
261
- #### aggregation_max_count
262
- Maximum number of items to pack into an aggregated record.
153
+ **role_arn (required)**
263
154
 
264
- There should be normally no need to adjust this. If you want to limit the time records spend buffering, look into record_max_buffered_time instead.
155
+ The Amazon Resource Name (ARN) of the role to assume.
265
156
 
266
- Default: 4294967295
267
- Minimum: 1
268
- Maximum (inclusive): 9223372036854775807
157
+ **role_session_name (required)**
269
158
 
270
- #### aggregation_max_size
271
- Maximum number of bytes to pack into an aggregated Kinesis record.
159
+ An identifier for the assumed role session.
272
160
 
273
- There should be normally no need to adjust this. If you want to limit the time records spend buffering, look into [**record_max_buffered_time**](#record_max_buffered_time) instead.
161
+ **policy**
274
162
 
275
- If a record has more data by itself than this limit, it will bypass the aggregator. Note the backend enforces a limit of 50KB on record size. If you set this beyond 50KB, oversize records will be rejected at the backend.
163
+ An IAM policy in JSON format.
276
164
 
277
- Default: 51200
278
- Minimum: 64
279
- Maximum (inclusive): 1048576
165
+ **duration_seconds**
280
166
 
281
- #### collection_max_count
282
- Maximum number of items to pack into an PutRecords request.
167
+ The duration, in seconds, of the role session. The value can range from
168
+ 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value
169
+ is set to 3600 seconds.
283
170
 
284
- There should be normally no need to adjust this. If you want to limit the time records spend buffering, look into [**record_max_buffered_time**](#record_max_buffered_time) instead.
171
+ **external_id**
285
172
 
286
- Default: 500
287
- Minimum: 1
288
- Maximum (inclusive): 500
173
+ A unique identifier that is used by third parties when assuming roles in
174
+ their customers' accounts.
289
175
 
290
- #### collection_max_size
291
- Maximum amount of data to send with a PutRecords request.
176
+ ### instance_profile_credentials
292
177
 
293
- There should be normally no need to adjust this. If you want to limit the time records spend buffering, look into [**record_max_buffered_time**](#record_max_buffered_time) instead.
178
+ Retrieve temporary security credentials via HTTP request. This is useful on
179
+ EC2 instance.
294
180
 
295
- Records larger than the limit will still be sent, but will not be grouped with others.
296
-
297
- Default: 5242880
298
- Minimum: 52224
299
- Maximum (inclusive): 9223372036854775807
300
-
301
- #### connect_timeout
302
- Timeout (milliseconds) for establishing TLS connections.
303
-
304
- Default: 6000
305
- Minimum: 100
306
- Maximum (inclusive): 300000
181
+ <match *>
182
+ @type kinesis_streams
307
183
 
308
- #### custom_endpoint
309
- Use a custom Kinesis and CloudWatch endpoint.
184
+ <instance_profile_credentials>
185
+ ip_address IP_ADDRESS
186
+ port PORT
187
+ </instance_profile_credentials>
188
+ </match>
310
189
 
311
- Mostly for testing use. Note this does not accept protocols or paths, only host names or ip addresses. There is no way to disable TLS. The KPL always connects with TLS.
190
+ See also:
312
191
 
313
- Expected pattern: `^([A-Za-z0-9-\\.]+)?$`
192
+ * [Aws::InstanceProfileCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/InstanceProfileCredentials.html)
193
+ * [Temporary Security Credentials - AWS Identity and Access
194
+ Management](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
195
+ * [Instance Metadata and User Data - Amazon Elastic Compute
196
+ Cloud](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
314
197
 
315
- #### fail_if_throttled
316
- If `true`, throttled puts are not retried. The records that got throttled will be failed immediately upon receiving the throttling error. This is useful if you want to react immediately to any throttling without waiting for the KPL to retry. For example, you can use a different hash key to send the throttled record to a backup shard.
198
+ **retries**
317
199
 
318
- If `false`, the KPL will automatically retry throttled puts. The KPL performs backoff for shards that it has received throttling errors from, and will avoid flooding them with retries. Note that records may fail from expiration (see [**record_ttl**](#record_ttl)) if they get delayed for too long because of
319
- throttling.
200
+ Number of times to retry when retrieving credentials. Default is 5.
320
201
 
321
- Default: `false`
202
+ **ip_address**
322
203
 
323
- #### log_level
324
- Minimum level of logs. Messages below the specified level will not be logged. Logs for the native KPL daemon show up on stderr.
204
+ Default is 169.254.169.254.
325
205
 
326
- Default: `info`
327
- Expected pattern: `info|warning|error`
206
+ **port**
328
207
 
329
- #### max_connections
330
- Maximum number of connections to open to the backend. HTTP requests are sent in parallel over multiple connections.
208
+ Default is 80.
331
209
 
332
- Setting this too high may impact latency and consume additional resources without increasing throughput.
210
+ **http_open_timeout**
333
211
 
334
- Default: 4
335
- Minimum: 1
336
- Maximum (inclusive): 128
212
+ Default is 5.
337
213
 
338
- #### metrics_granularity
339
- Controls the granularity of metrics that are uploaded to CloudWatch. Greater granularity produces more metrics.
214
+ **http_read_timeout**
340
215
 
341
- When `shard` is selected, metrics are emitted with the stream name and shard id as dimensions. On top of this, the same metric is also emitted with only the stream name dimension, and lastly, without the stream name. This means for a particular metric, 2 streams with 2 shards (each) will produce 7 CloudWatch metrics, one for each shard, one for each stream, and one overall, all describing the same statistics, but at different levels of granularity.
216
+ Default is 5.
342
217
 
343
- When `stream` is selected, per shard metrics are not uploaded; when `global` is selected, only the total aggregate for all streams and all shards are uploaded.
218
+ ### shared_credentials
344
219
 
345
- Consider reducing the granularity if you're not interested in shard-level metrics, or if you have a large number of shards.
220
+ This loads AWS access credentials from local ini file. This is useful for
221
+ local developing.
346
222
 
347
- If you only have 1 stream, select `global`; the global data will be equivalent to that for the stream.
223
+ <match *>
224
+ @type kinesis_streams
348
225
 
349
- Refer to the metrics documentation for details about each metric.
226
+ <shared_credentials>
227
+ path PATH
228
+ profile_name PROFILE_NAME
229
+ </shared_credentials>
230
+ </match>
350
231
 
351
- Default: `shard`
352
- Expected pattern: `global|stream|shard`
232
+ See also:
353
233
 
354
- #### metrics_level
355
- Controls the number of metrics that are uploaded to CloudWatch.
234
+ * [Aws::SharedCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/SharedCredentials.html)
356
235
 
357
- `none` disables all metrics.
236
+ **path**
358
237
 
359
- `summary` enables the following metrics: UserRecordsPut, KinesisRecordsPut, ErrorsByCode, AllErrors, BufferingTime.
238
+ Path to the shared file. Defaults to "#{Dir.home}/.aws/credentials".
360
239
 
361
- `detailed` enables all remaining metrics.
240
+ **profile_name**
362
241
 
363
- Refer to the metrics documentation for details about each metric.
242
+ Defaults to 'default' or `[ENV]('AWS_PROFILE')`.
364
243
 
365
- Default: `detailed`
366
- Expected pattern: `none|summary|detailed`
244
+ ## Configuraion: Format
367
245
 
368
- #### metrics_namespace
369
- The namespace to upload metrics under.
246
+ ### format (section)
247
+ This plugin use `Fluent::TextFormatter` to serialize record to string. For more detail, see [formatter.rb]. By default, it uses `json` formatter same as specific like below:
370
248
 
371
- If you have multiple applications running the KPL under the same AWS account, you should use a different namespace for each application.
249
+ <match *>
250
+ @type kinesis_streams
372
251
 
373
- If you are also using the KCL, you may wish to use the application name you have configured for the KCL as the the namespace here. This way both your KPL and KCL metrics show up under the same namespace.
252
+ <format>
253
+ @type json
254
+ </format>
255
+ </match>
374
256
 
375
- Default: `KinesisProducerLibrary`
376
- Expected pattern: `(?!AWS/).{1,255}`
257
+ ### inject (section)
258
+ This plugin use `Fluent::TimeFormatter` and other injection configurations. For more detail, see [inject.rb]. This section only works with Fluentd v0.14.
377
259
 
378
- #### metrics_upload_delay
379
- Delay (in milliseconds) between each metrics upload.
260
+ For example, the config below will add `time` field whose value is eventtime with nanosecond and `tag` field whose value is its tag. (Mostly same as `include_time key true` and `include_tag_key true`)
380
261
 
381
- For testing only. There is no benefit in setting this lower or higher in production.
262
+ <match *>
263
+ @type kinesis_streams
382
264
 
383
- Default: 60000
384
- Minimum: 1
385
- Maximum (inclusive): 60000
265
+ <inject>
266
+ time_key time
267
+ tag_key tag
268
+ </inject>
269
+ </match>
386
270
 
387
- #### min_connections
388
- Minimum number of connections to keep open to the backend.
271
+ By default, `time_type string` and `time_format %Y-%m-%dT%H:%M:%S.%N%z` are already set to be applicable to Elasticsearch subsecond format. Although, you can use any configuration.
389
272
 
390
- There should be no need to increase this in general.
273
+ Also, there are some format related options below:
391
274
 
392
- Default: 1
393
- Minimum: 1
394
- Maximum (inclusive): 16
275
+ ### include_time_key
276
+ **Notice** With Fluentd v0.14, you should use inject section.
395
277
 
396
- #### port
397
- Server port to connect to. Only useful with [**custom_endpoint**](#custom_endpoint).
278
+ Defalut `false`. If you want to include `time` field in your record, set `true`.
398
279
 
399
- Default: 443
400
- Minimum: 1
401
- Maximum (inclusive): 65535
280
+ ### include_tag_key
281
+ **Notice** With Fluentd v0.14, you should use inject section.
402
282
 
403
- #### rate_limit
404
- Limits the maximum allowed put rate for a shard, as a percentage of the backend limits.
283
+ Defalut `false`. If you want to include `tag` field in your record, set `true`.
405
284
 
406
- The rate limit prevents the producer from sending data too fast to a shard. Such a limit is useful for reducing bandwidth and CPU cycle wastage from sending requests that we know are going to fail from throttling.
285
+ ### data_key
286
+ If your record contains a field whose string should be sent to Amazon Kinesis directly (without formatter), use this parameter to specify the field. In that case, other fileds than **data_key** are thrown away and never sent to Amazon Kinesis. Default `nil`, which means whole record will be formatted and sent.
407
287
 
408
- Kinesis enforces limits on both the number of records and number of bytes per second. This setting applies to both.
288
+ ### compression
289
+ Specifing compression way for data of each record. Current accepted options are `zlib`. Otherwise, no compression will be preformed.
409
290
 
410
- The default value of 150% is chosen to allow a single producer instance to completely saturate the allowance for a shard. This is an aggressive setting. If you prefer to reduce throttling errors rather than completely saturate the shard, consider reducing this setting.
291
+ ### log_truncate_max_size
292
+ Integer, default 1024. When emitting the log entry, the message will be truncated by this size to avoid infinite loop when the log is also sent to Kinesis. The value 0 means no truncation.
411
293
 
412
- Default: 150
413
- Minimum: 1
414
- Maximum (inclusive): 9223372036854775807
294
+ ## Configuraion: API
295
+ ### region
296
+ AWS region of your stream. It should be in form like `us-east-1`, `us-west-2`. Refer to [Regions and Endpoints in AWS General Reference][region] for supported regions.
415
297
 
416
- #### record_max_buffered_time
417
- Maximum amount of time (milliseconds) a record may spend being buffered before it gets sent. Records may be sent sooner than this depending on the other buffering limits.
298
+ Default `nil`, which means try to find from environment variable `AWS_REGION`.
418
299
 
419
- This setting provides coarse ordering among records - any two records will be reordered by no more than twice this amount (assuming no failures and retries and equal network latency).
300
+ ### max_record_size
301
+ The upper limit of size of each record. Default is 1 MB which is the limitation of Kinesis.
420
302
 
421
- The library makes a best effort to enforce this time, but cannot guarantee that it will be precisely met. In general, if the CPU is not overloaded, the library will meet this deadline to within 10ms.
303
+ ### http_proxy
304
+ HTTP proxy for API calling. Default `nil`.
422
305
 
423
- Failures and retries can additionally increase the amount of time records spend in the KPL. If your application cannot tolerate late records, use the [**record_ttl**](#record_ttl) setting to drop records that do not get transmitted in time.
306
+ ### endpoint
307
+ API endpoint URL, for testing. Defalut `nil`.
424
308
 
425
- Setting this too low can negatively impact throughput.
309
+ ### ssl_verify_peer
310
+ Boolean. Disable if you want to verify ssl conncetion, for testing. Default `true`.
426
311
 
427
- Default: 100
428
- Maximum (inclusive): 9223372036854775807
312
+ ### debug
313
+ Boolean. Enable if you need to debug Amazon Kinesis Firehose API call. Default is `false`.
429
314
 
430
- #### record_ttl
431
- Set a time-to-live on records (milliseconds). Records that do not get successfully put within the limit are failed.
315
+ ## Configuration: Batch request
316
+ ### retries_on_batch_request
317
+ Integer, default is 3. The plugin will put multiple records to Amazon Kinesis Streams in batches using PutRecords. A set of records in a batch may fail for reasons documented in the Kinesis Service API Reference for PutRecords. Failed records will be retried **retries_on_batch_request** times. If a record fails all retries an error log will be emitted.
432
318
 
433
- This setting is useful if your application cannot or does not wish to tolerate late records. Records will still incur network latency after they leave the KPL, so take that into consideration when choosing a value for this setting.
319
+ ### reset_backoff_if_success
320
+ Boolean, default `true`. If enabled, when after retrying, the next retrying checks the number of succeeded records on the former batch request and reset exponential backoff if there is any success. Because batch request could be composed by requests across shards, simple exponential backoff for the batch request wouldn't work some cases.
434
321
 
435
- If you do not wish to lose records and prefer to retry indefinitely, set record_ttl to a large value like INT_MAX. This has the potential to cause head-of-line blocking if network issues or throttling occur. You can respond to such situations by using the metrics reporting functions of the KPL. You may also set [**fail_if_throttled**](#fail_if_throttled) to true to prevent automatic retries in case of throttling.
322
+ ### batch_request_max_count
323
+ Integer, default 500. The number of max count of making batch request from record chunk. It can't exceed the default value because it's API limit.
436
324
 
437
- Default: 30000
438
- Minimum: 100
439
- Maximum (inclusive): 9223372036854775807
325
+ Default:
440
326
 
441
- #### request_timeout
442
- The maximum total time (milliseconds) elapsed between when we begin a HTTP request and receiving all of the response. If it goes over, the request will be timed-out.
327
+ - `kinesis_streams`: 500
328
+ - `kinesis_firehose`: 500
329
+ - `kinesis_streams_aggregated`: 100,000
443
330
 
444
- Note that a timed-out request may actually succeed at the backend. Retrying then leads to duplicates. Setting the timeout too low will therefore increase the probability of duplicates.
331
+ ### batch_request_max_size
332
+ Integer. The number of max size of making batch request from record chunk. It can't exceed the default value because it's API limit.
445
333
 
446
- Default: 6000
447
- Minimum: 100
448
- Maximum (inclusive): 600000
334
+ Default:
449
335
 
450
- #### verify_certificate
451
- Verify the endpoint's certificate. Do not disable unless using [**custom_endpoint**](#custom_endpoint) for testing. Never disable this in production.
336
+ - `kinesis_streams`: 5 MB
337
+ - `kinesis_firehose`: 4 MB
338
+ - `kinesis_streams_aggregated`: 1 MB
452
339
 
453
- Default: `true`
340
+ ## Configuration: kinesis_streams
341
+ Here are `kinesis_streams` specific configurations.
454
342
 
455
- #### credentials_refresh_delay
456
- Interval milliseconds for refreshing credentials seding to KPL.
343
+ ### stream_name
344
+ Name of the stream to put data.
457
345
 
458
- Defalut 5000
346
+ ### partition_key
347
+ A key to extract partition key from JSON object. Default `nil`, which means partition key will be generated randomly.
459
348
 
460
349
  ## Configuration: kinesis_firehose
461
350
  Here are `kinesis_firehose` specific configurations.
@@ -463,37 +352,19 @@ Here are `kinesis_firehose` specific configurations.
463
352
  ### delivery_stream_name
464
353
  Name of the delivery stream to put data.
465
354
 
466
- ### region
467
- AWS region of your stream. It should be in form like `us-east-1`, `us-west-2`. Refer to [Regions and Endpoints in AWS General Reference][region] for supported regions.
468
-
469
- Default `nil`, which means try to find from environment variable `AWS_REGION`.
470
-
471
355
  ### append_new_line
472
- Boolean. Default `true`. If it is enabled, the plugin add new line character (`\n`) to each serialized record.
356
+ Boolean. Default `true`. If it is enabled, the plugin add new line character (`\n`) to each serialized record.
473
357
 
474
- ### retries_on_batch_request
475
- Integer, default is 3. The plugin will put multiple records to Amazon Kinesis Firehose in batches using PutRecordBatch. A set of records in a batch may fail for reasons documented in the Kinesis Service API Reference for PutRecordBatch. Failed records will be retried **retries_on_batch_request** times. If a record fails all retries an error log will be emitted.
358
+ ## Configuration: kinesis_streams_aggregated
359
+ Here are `kinesis_streams_aggregated` specific configurations.
476
360
 
477
- ### reset_backoff_if_success
478
- Boolean, default `true`. If enabled, when after retrying, the next retrying checks the number of succeeded records on the former batch request and reset exponential backoff if there is any success. Because batch request could be composed by requests across shards, simple exponential backoff for the batch request wouldn't work some cases.
479
-
480
- ### batch_request_max_count
481
- Integer, default 500. The number of max count of making batch request from record chunk. It can't exceed the default value because it's API limit.
482
-
483
- ### batch_request_max_size
484
- Integer, default 4 * 1024*1024. The number of max size of making batch request from record chunk. It can't exceed the default value because it's API limit.
485
-
486
- ### http_proxy
487
- HTTP proxy for API calling. Default `nil`.
488
-
489
- ### endpoint
490
- API endpoint URL, for testing. Defalut `nil`.
361
+ ### stream_name
362
+ Name of the stream to put data.
491
363
 
492
- ### ssl_verify_peer
493
- Boolean. Disable if you want to verify ssl conncetion, for testing. Default `true`.
364
+ ### fixed_partition_key
365
+ A value of fixed partition key. Default `nil`, which means partition key will be generated randomly.
494
366
 
495
- ### debug
496
- Boolean. Enable if you need to debug Amazon Kinesis Firehose API call. Default is `false`.
367
+ Note: if you specified this option, all records go to a single shard.
497
368
 
498
369
  ## Development
499
370
 
@@ -501,10 +372,12 @@ To launch `fluentd` process with this plugin for development, follow the steps b
501
372
 
502
373
  git clone https://github.com/awslabs/aws-fluent-plugin-kinesis.git
503
374
  cd aws-fluent-plugin-kinesis
504
- make # will install gems and download KPL jar file and extract binaries
375
+ make # will install gems dependency
505
376
  bundle exec fluentd -c /path/to/fluent.conf
506
377
 
507
- If you want to run benchmark, use `make benchmark`.
378
+ To launch using Fluentd v0.12, use `BUNDLE_GEMFILE` environment variable:
379
+
380
+ BUNDLE_GEMFILE=$PWD/gemfiles/Gemfile.fluentd-0.12 bundle exec fluentd -c /path/to/fluent.conf
508
381
 
509
382
  ## Contributing
510
383
 
@@ -518,15 +391,13 @@ Bug reports and pull requests are welcome on [GitHub][github].
518
391
  [fluentd]: http://fluentd.org/
519
392
  [streams]: https://aws.amazon.com/kinesis/streams/
520
393
  [firehose]: https://aws.amazon.com/kinesis/firehose/
521
- [producer]: http://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-kpl.html
394
+ [kpl]: https://github.com/awslabs/amazon-kinesis-producer/blob/master/aggregation-format.md
522
395
  [td-agent]: https://github.com/treasure-data/td-agent
523
396
  [bundler]: http://bundler.io/
524
- [assume_role]: http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html
525
- [external_id]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
526
397
  [region]: http://docs.aws.amazon.com/general/latest/gr/rande.html#ak_region
527
398
  [fluentd_buffer]: http://docs.fluentd.org/articles/buffer-plugin-overview
528
399
  [github]: https://github.com/awslabs/aws-fluent-plugin-kinesis
529
400
  [formatter.rb]: https://github.com/fluent/fluentd/blob/master/lib/fluent/formatter.rb
530
- [default_config.properties]: https://github.com/awslabs/amazon-kinesis-producer/blob/v0.10.2/java/amazon-kinesis-producer-sample/default_config.properties
531
- [old-readme]: https://github.com/awslabs/aws-fluent-plugin-kinesis/blob/master/README-v0.4.md
401
+ [inject.rb]: https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin_helper/inject.rb
532
402
  [fluentd-doc-kinesis]: http://docs.fluentd.org/articles/kinesis-stream
403
+ [fluent-plugin-s3]: https://github.com/fluent/fluent-plugin-s3