fluent-plugin-kinesis 0.4.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +13 -18
- data/.travis.yml +9 -9
- data/CHANGELOG.md +9 -0
- data/CONTRIBUTORS.txt +1 -1
- data/Gemfile +12 -9
- data/LICENSE.txt +39 -201
- data/Makefile +40 -0
- data/NOTICE.txt +1 -1
- data/README-v0.4.md +348 -0
- data/README.md +398 -183
- data/Rakefile +20 -14
- data/benchmark/dummer.conf +13 -0
- data/benchmark/firehose.conf +24 -0
- data/benchmark/producer.conf +28 -0
- data/benchmark/streams.conf +24 -0
- data/fluent-plugin-kinesis.gemspec +34 -23
- data/gemfiles/Gemfile.fluentd-0.10.58 +20 -0
- data/lib/fluent/plugin/kinesis_helper.rb +30 -0
- data/lib/fluent/plugin/kinesis_helper/api.rb +164 -0
- data/lib/fluent/plugin/kinesis_helper/class_methods.rb +120 -0
- data/lib/fluent/plugin/kinesis_helper/client.rb +36 -0
- data/lib/fluent/plugin/kinesis_helper/credentials.rb +51 -0
- data/lib/fluent/plugin/kinesis_helper/error.rb +38 -0
- data/lib/fluent/plugin/kinesis_helper/format.rb +85 -0
- data/lib/fluent/plugin/kinesis_helper/initialize.rb +58 -0
- data/lib/fluent/plugin/kinesis_helper/kpl.rb +81 -0
- data/lib/fluent/plugin/out_kinesis.rb +13 -11
- data/lib/fluent/plugin/out_kinesis_firehose.rb +44 -0
- data/lib/fluent/plugin/out_kinesis_producer.rb +38 -0
- data/lib/fluent/plugin/out_kinesis_streams.rb +47 -0
- data/lib/fluent/plugin/patched_detach_process_impl.rb +103 -0
- data/lib/fluent_plugin_kinesis/version.rb +17 -0
- data/lib/kinesis_producer.rb +24 -0
- data/lib/kinesis_producer/binary.rb +10 -0
- data/lib/kinesis_producer/daemon.rb +238 -0
- data/lib/kinesis_producer/library.rb +122 -0
- data/lib/kinesis_producer/protobuf/config.pb.rb +66 -0
- data/lib/kinesis_producer/protobuf/messages.pb.rb +151 -0
- data/lib/kinesis_producer/tasks/binary.rake +73 -0
- metadata +196 -36
- data/lib/fluent/plugin/version.rb +0 -16
- data/test/helper.rb +0 -32
- data/test/plugin/test_out_kinesis.rb +0 -641
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48189e937b18e7a7ab26165826394ffb37db0f3d
|
4
|
+
data.tar.gz: 2cc691c0c3f6f57b7472f61edc689b99d8955677
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a8d48c3ed01e845ab675b4242f5441af5a8a361f8d557d9bab58be7e8d378900c20f50c9dcb93b1e79863254d3c2e15907e9ed9d06ece30de47a92bda7455f6
|
7
|
+
data.tar.gz: 3f5556e659c9889efd3f5d47c0482ed31f0bc185e91ae3acf9831d8edd38616e553b16d577f5063abee06a5b143932c5487fcfe28d3a8c389a88ff9ba20029b7
|
data/.gitignore
CHANGED
@@ -1,18 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
test/tmp
|
15
|
-
test/version_tmp
|
16
|
-
tmp
|
17
|
-
*.swp
|
18
|
-
config/
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/gemfiles/Gemfile*.lock
|
5
|
+
/_yardoc/
|
6
|
+
/coverage/
|
7
|
+
/doc/
|
8
|
+
/pkg/
|
9
|
+
/spec/reports/
|
10
|
+
/tmp/
|
11
|
+
/.cache/
|
12
|
+
/amazon-kinesis-producer-native-binarie*
|
13
|
+
/.ruby-version
|
data/.travis.yml
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
language: ruby
|
2
2
|
|
3
3
|
rvm:
|
4
|
-
- 1.9.3
|
5
4
|
- 2.0.0
|
6
5
|
- 2.1
|
7
6
|
- 2.2
|
8
|
-
|
9
|
-
|
7
|
+
|
8
|
+
gemfile:
|
9
|
+
- Gemfile
|
10
|
+
- gemfiles/Gemfile.fluentd-0.10.58
|
10
11
|
|
11
12
|
os:
|
12
13
|
- linux
|
13
14
|
- osx
|
14
15
|
|
15
|
-
|
16
|
-
-
|
16
|
+
before_install:
|
17
|
+
- gem update bundler
|
17
18
|
|
18
|
-
script: bundle exec rake
|
19
|
+
script: bundle exec rake test
|
19
20
|
|
20
21
|
sudo: false
|
21
22
|
|
22
23
|
matrix:
|
23
|
-
|
24
|
-
- rvm: ruby-head
|
25
|
-
- rvm: rbx-2
|
24
|
+
exclude:
|
26
25
|
- rvm: 2.2
|
26
|
+
os: osx
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 1.0.0
|
4
|
+
|
5
|
+
To support Firehose and KPL, this was refactored and added more tests.
|
6
|
+
|
7
|
+
- Feature - Support Firehose
|
8
|
+
- Feature - Support KPL
|
9
|
+
- Feature - New parameters, such as formatter, data_key, reset_backoff_if_success, batch_request_max_count, batch_request_max_size, log_truncate_max_size
|
10
|
+
|
3
11
|
## 0.4.0
|
12
|
+
|
4
13
|
- Feature - Add option to ensure Kinesis Stream connection. [#35](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/35)
|
5
14
|
- Feature - Add option to support zlib compression. [#39](https://github.com/awslabs/aws-fluent-plugin-kinesis/pull/39)
|
6
15
|
|
data/CONTRIBUTORS.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
This file contains a list of people who have made large or regular contributions
|
2
|
-
to the Fluent Plugin for Amazon Kinesis. Give them a special thanks!
|
2
|
+
to the Fluent Plugin for Amazon Kinesis Streams and Amazon Kinesis Firehose. Give them a special thanks!
|
3
3
|
|
4
4
|
Genki Sugawara
|
5
5
|
sgwr_dts@yahoo.co.jp
|
data/Gemfile
CHANGED
@@ -1,15 +1,18 @@
|
|
1
|
-
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
1
|
#
|
3
|
-
#
|
4
|
-
# may not use this file except in compliance with the License. A copy of
|
5
|
-
# the License is located at
|
2
|
+
# Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
6
3
|
#
|
7
|
-
#
|
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
|
8
7
|
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
8
|
+
# http://aws.amazon.com/asl/
|
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.
|
13
14
|
|
14
15
|
source 'https://rubygems.org'
|
16
|
+
|
17
|
+
# Specify your gem's dependencies in fluent-plugin-kinesis.gemspec
|
15
18
|
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,202 +1,40 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
-
the Work and Derivative Works thereof.
|
48
|
-
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
50
|
-
the original version of the Work and any modifications or additions
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
-
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
65
|
-
subsequently incorporated within the Work.
|
66
|
-
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
73
|
-
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
-
where such license applies only to those patent claims licensable
|
80
|
-
by such Contributor that are necessarily infringed by their
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
83
|
-
institute patent litigation against any entity (including a
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
86
|
-
or contributory patent infringement, then any patent licenses
|
87
|
-
granted to You under this License for that Work shall terminate
|
88
|
-
as of the date such litigation is filed.
|
89
|
-
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
92
|
-
modifications, and in Source or Object form, provided that You
|
93
|
-
meet the following conditions:
|
94
|
-
|
95
|
-
(a) You must give any other recipients of the Work or
|
96
|
-
Derivative Works a copy of this License; and
|
97
|
-
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
99
|
-
stating that You changed the files; and
|
100
|
-
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
103
|
-
attribution notices from the Source form of the Work,
|
104
|
-
excluding those notices that do not pertain to any part of
|
105
|
-
the Derivative Works; and
|
106
|
-
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
109
|
-
include a readable copy of the attribution notices contained
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
112
|
-
of the following places: within a NOTICE text file distributed
|
113
|
-
as part of the Derivative Works; within the Source form or
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
115
|
-
within a display generated by the Derivative Works, if and
|
116
|
-
wherever such third-party notices normally appear. The contents
|
117
|
-
of the NOTICE file are for informational purposes only and
|
118
|
-
do not modify the License. You may add Your own attribution
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
121
|
-
that such additional attribution notices cannot be construed
|
122
|
-
as modifying the License.
|
123
|
-
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
125
|
-
may provide additional or different license terms and conditions
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
129
|
-
the conditions stated in this License.
|
130
|
-
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
134
|
-
this License, without any additional terms or conditions.
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
-
the terms of any separate license agreement you may have executed
|
137
|
-
with Licensor regarding such Contributions.
|
138
|
-
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
141
|
-
except as required for reasonable and customary use in describing the
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
-
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
153
|
-
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
159
|
-
incidental, or consequential damages of any character arising as a
|
160
|
-
result of this License or out of the use or inability to use the
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
163
|
-
other commercial damages or losses), even if such Contributor
|
164
|
-
has been advised of the possibility of such damages.
|
165
|
-
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
-
or other liability obligations and/or rights consistent with this
|
170
|
-
License. However, in accepting such obligations, You may act only
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
175
|
-
of your accepting any such warranty or additional liability.
|
176
|
-
|
177
|
-
END OF TERMS AND CONDITIONS
|
178
|
-
|
179
|
-
APPENDIX: How to apply the Apache License to your work.
|
180
|
-
|
181
|
-
To apply the Apache License to your work, attach the following
|
182
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
183
|
-
replaced with your own identifying information. (Don't include
|
184
|
-
the brackets!) The text should be enclosed in the appropriate
|
185
|
-
comment syntax for the file format. We also recommend that a
|
186
|
-
file or class name and description of purpose be included on the
|
187
|
-
same "printed page" as the copyright notice for easier
|
188
|
-
identification within third-party archives.
|
189
|
-
|
190
|
-
Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
191
|
-
|
192
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
193
|
-
you may not use this file except in compliance with the License.
|
194
|
-
You may obtain a copy of the License at
|
195
|
-
|
196
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
197
|
-
|
198
|
-
Unless required by applicable law or agreed to in writing, software
|
199
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
200
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
201
|
-
See the License for the specific language governing permissions and
|
202
|
-
limitations under the License.
|
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
|
+
|
data/Makefile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
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
|
7
|
+
#
|
8
|
+
# http://aws.amazon.com/asl/
|
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.
|
14
|
+
|
15
|
+
.PHONY: install streams firehose producer dummer hello $(wildcard test/test_*.rb) $(wildcard test/**/test_*.rb)
|
16
|
+
|
17
|
+
all:
|
18
|
+
bundle install
|
19
|
+
bundle exec rake
|
20
|
+
|
21
|
+
install:
|
22
|
+
bundle exec rake install:local
|
23
|
+
|
24
|
+
streams:
|
25
|
+
bundle exec fluentd -c benchmark/streams.conf -vv
|
26
|
+
|
27
|
+
firehose:
|
28
|
+
bundle exec fluentd -c benchmark/firehose.conf -vv
|
29
|
+
|
30
|
+
producer:
|
31
|
+
bundle exec fluentd -c benchmark/producer.conf -vv
|
32
|
+
|
33
|
+
dummer:
|
34
|
+
bundle exec dummer -c benchmark/dummer.conf
|
35
|
+
|
36
|
+
hello:
|
37
|
+
echo Hello World | bundle exec fluent-cat --none dummy
|
38
|
+
|
39
|
+
$(wildcard test/test_*.rb) $(wildcard test/**/test_*.rb):
|
40
|
+
bundle exec rake test TEST=$@
|
data/NOTICE.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
Fluent Plugin for Amazon Kinesis
|
2
|
-
Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
Copyright 2014-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
data/README-v0.4.md
ADDED
@@ -0,0 +1,348 @@
|
|
1
|
+
# Deprecated: Fluent Plugin for Amazon Kinesis v0.4
|
2
|
+
|
3
|
+
Please see [the latest README](https://github.com/awslabs/aws-fluent-plugin-kinesis/blob/master/README.md).
|
4
|
+
|
5
|
+
## Overview
|
6
|
+
|
7
|
+
[Fluentd](http://fluentd.org/) output plugin
|
8
|
+
that sends events to [Amazon Kinesis](https://aws.amazon.com/kinesis/).
|
9
|
+
|
10
|
+
Also, there is a documentation on [Fluentd official site](http://docs.fluentd.org/articles/kinesis-stream).
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
This fluentd plugin is available as the `fluent-plugin-kinesis` gem from RubyGems.
|
15
|
+
|
16
|
+
gem install fluent-plugin-kinesis
|
17
|
+
|
18
|
+
Or you can install this plugin for [td-agent](https://github.com/treasure-data/td-agent) as:
|
19
|
+
|
20
|
+
fluent-gem install fluent-plugin-kinesis
|
21
|
+
|
22
|
+
If you would like to build by yourself and install, please see the section below.
|
23
|
+
Your need [bundler](http://bundler.io/) for this.
|
24
|
+
|
25
|
+
In case of using with Fluentd:
|
26
|
+
Fluentd will be also installed via the process below.
|
27
|
+
|
28
|
+
git clone https://github.com/awslabs/aws-fluent-plugin-kinesis.git
|
29
|
+
cd aws-fluent-plugin-kinesis
|
30
|
+
bundle install
|
31
|
+
rake build
|
32
|
+
rake install
|
33
|
+
|
34
|
+
Also, you can use this plugin with td-agent:
|
35
|
+
You have to install td-agent before installing this plugin.
|
36
|
+
|
37
|
+
git clone https://github.com/awslabs/aws-fluent-plugin-kinesis.git
|
38
|
+
cd aws-fluent-plugin-kinesis
|
39
|
+
bundle install
|
40
|
+
rake build
|
41
|
+
fluent-gem install pkg/fluent-plugin-kinesis
|
42
|
+
|
43
|
+
Or just download specify your Ruby library path.
|
44
|
+
Below is the sample for specifying your library path via RUBYLIB.
|
45
|
+
|
46
|
+
git clone https://github.com/awslabs/aws-fluent-plugin-kinesis.git
|
47
|
+
cd aws-fluent-plugin-kinesis
|
48
|
+
bundle install
|
49
|
+
export RUBYLIB=$RUBYLIB:/path/to/aws-fluent-plugin-kinesis/lib
|
50
|
+
|
51
|
+
## Dependencies
|
52
|
+
|
53
|
+
* Ruby 2.0.0+
|
54
|
+
* Fluentd 0.10.58+
|
55
|
+
|
56
|
+
## Basic Usage
|
57
|
+
|
58
|
+
Here are general procedures for using this plugin:
|
59
|
+
|
60
|
+
1. Install.
|
61
|
+
1. Edit configuration
|
62
|
+
1. Run Fluentd or td-agent
|
63
|
+
|
64
|
+
You can run this plugin with Fluentd as follows:
|
65
|
+
|
66
|
+
1. Install.
|
67
|
+
1. Edit configuration file and save it as 'fluentd.conf'.
|
68
|
+
1. Then, run `fluentd -c /path/to/fluentd.conf`
|
69
|
+
|
70
|
+
To run with td-agent, it would be as follows:
|
71
|
+
|
72
|
+
1. Install.
|
73
|
+
1. Edit configuration file provided by td-agent.
|
74
|
+
1. Then, run or restart td-agent.
|
75
|
+
|
76
|
+
## Configuration
|
77
|
+
|
78
|
+
Here are items for Fluentd configuration file.
|
79
|
+
|
80
|
+
To put records into Amazon Kinesis,
|
81
|
+
you need to provide AWS security credentials.
|
82
|
+
If you provide aws_key_id and aws_sec_key in configuration file as below,
|
83
|
+
we use it. You can also provide credentials via environment variables as
|
84
|
+
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY. Also we support IAM Role for
|
85
|
+
authentication. Please find the [AWS SDK for Ruby Developer Guide](http://docs.aws.amazon.com/AWSSdkDocsRuby/latest/DeveloperGuide/ruby-dg-setup.html)
|
86
|
+
for more information about authentication.
|
87
|
+
We support all options which AWS SDK for Ruby supports.
|
88
|
+
|
89
|
+
### type
|
90
|
+
|
91
|
+
Use the word 'kinesis'.
|
92
|
+
|
93
|
+
### stream_name
|
94
|
+
|
95
|
+
Name of the stream to put data.
|
96
|
+
|
97
|
+
### aws_key_id
|
98
|
+
|
99
|
+
AWS access key id.
|
100
|
+
|
101
|
+
### aws_sec_key
|
102
|
+
|
103
|
+
AWS secret key.
|
104
|
+
|
105
|
+
### role_arn
|
106
|
+
|
107
|
+
IAM Role to be assumed with [AssumeRole](http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html).
|
108
|
+
Use this option for cross account access.
|
109
|
+
|
110
|
+
### external_id
|
111
|
+
|
112
|
+
A unique identifier that is used by third parties when
|
113
|
+
[assuming roles](http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) in their customers' accounts.
|
114
|
+
Use this option with `role_arn` for third party cross account access.
|
115
|
+
For detail, please see [How to Use an External ID When Granting Access to Your AWS Resources to a Third Party](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html).
|
116
|
+
|
117
|
+
### region
|
118
|
+
|
119
|
+
AWS region of your stream.
|
120
|
+
It should be in form like "us-east-1", "us-west-2".
|
121
|
+
Refer to [Regions and Endpoints in AWS General Reference](http://docs.aws.amazon.com/general/latest/gr/rande.html#ak_region)
|
122
|
+
for supported regions.
|
123
|
+
|
124
|
+
### ensure_stream_connection
|
125
|
+
|
126
|
+
When enabled, the plugin checks and ensures a connection to the stream you are using by [DescribeStream](http://docs.aws.amazon.com/kinesis/latest/APIReference/API_DescribeStream.html) and throws exception if it fails. Enabled by default.
|
127
|
+
|
128
|
+
### http_proxy
|
129
|
+
|
130
|
+
Proxy server, if any.
|
131
|
+
It should be in form like "http://squid:3128/"
|
132
|
+
|
133
|
+
### random_partition_key
|
134
|
+
|
135
|
+
Boolean. If true, the plugin uses randomly generated
|
136
|
+
partition key for each record. Note that this parameter
|
137
|
+
overrides *partition_key*, *partition_key_expr*,
|
138
|
+
*explicit_hash_key* and *explicit_hash_key_expr*.
|
139
|
+
|
140
|
+
### partition_key
|
141
|
+
|
142
|
+
A key to extract partition key from JSON object.
|
143
|
+
|
144
|
+
### partition_key_expr
|
145
|
+
|
146
|
+
A Ruby expression to extract partition key from JSON object.
|
147
|
+
We treat your expression as below.
|
148
|
+
|
149
|
+
a_proc = eval(sprintf('proc {|record| %s }', YOUR_EXPRESSION))
|
150
|
+
a_proc.call(record)
|
151
|
+
|
152
|
+
You should write your Ruby expression that receives input data
|
153
|
+
as a variable 'record', process it and return it. The returned
|
154
|
+
value will be used as a partition key. For use case example,
|
155
|
+
see 'Configuration examples' part.
|
156
|
+
|
157
|
+
### explicit_hash_key
|
158
|
+
|
159
|
+
A key to extract explicit hash key from JSON object.
|
160
|
+
Explicit hash key is hash value used to explicitly
|
161
|
+
determine the shard the data record is assigned to
|
162
|
+
by overriding the partition key hash.
|
163
|
+
|
164
|
+
### explicit_hash_key_expr
|
165
|
+
|
166
|
+
A Ruby expression to extract explicit hash key from JSON object.
|
167
|
+
Your expression will be treat in the same way as we treat partition_key_expr.
|
168
|
+
|
169
|
+
### order_events
|
170
|
+
|
171
|
+
Boolean. By enabling it, you can strictly order events in Amazon Kinesis,
|
172
|
+
according to arrival of events. Without this, events will be coarsely ordered
|
173
|
+
based on arrival time. For detail,
|
174
|
+
see [Using the Amazon Kinesis Service API](http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-api-java.html#kinesis-using-api-defn-sequence-number).
|
175
|
+
|
176
|
+
Please note that if you set *detach_process* or *num_threads greater than 1*,
|
177
|
+
this option will be ignored.
|
178
|
+
|
179
|
+
### detach_process
|
180
|
+
|
181
|
+
Integer. Optional. This defines the number of parallel processes to start.
|
182
|
+
This can be used to increase throughput by allowing multiple processes to
|
183
|
+
execute the plugin at once. This cannot be used together with **order_events**.
|
184
|
+
Setting this option to > 0 will cause the plugin to run in a separate
|
185
|
+
process. The default is 0.
|
186
|
+
|
187
|
+
### num_threads
|
188
|
+
|
189
|
+
Integer. The number of threads to flush the buffer. This plugin is based on
|
190
|
+
Fluentd::BufferedOutput, so we buffer incoming records before emitting them to
|
191
|
+
Amazon Kinesis. You can find the detail about buffering mechanism [here](http://docs.fluentd.org/articles/buffer-plugin-overview).
|
192
|
+
Emitting records to Amazon Kinesis via network causes I/O Wait, so parallelizing
|
193
|
+
emitting with threads will improve throughput.
|
194
|
+
|
195
|
+
This option can be used to parallelize writes into the output(s)
|
196
|
+
designated by the output plugin. The default is 1.
|
197
|
+
Also you can use this option with *detach_process*.
|
198
|
+
|
199
|
+
### retries_on_putrecords
|
200
|
+
|
201
|
+
Integer, default is 3. When **order_events** is false, the plugin will put multiple
|
202
|
+
records to Amazon Kinesis in batches using PutRecords. A set of records in a batch
|
203
|
+
may fail for reasons documented in the Kinesis Service API Reference for PutRecords.
|
204
|
+
Failed records will be retried **retries_on_putrecords** times. If a record
|
205
|
+
fails all retries an error log will be emitted.
|
206
|
+
|
207
|
+
### use_yajl
|
208
|
+
|
209
|
+
Boolean, default is false.
|
210
|
+
In case you find error `Encoding::UndefinedConversionError` with multibyte texts, you can avoid that error with this option.
|
211
|
+
|
212
|
+
### zlib_compression
|
213
|
+
|
214
|
+
Boolean, default is false.
|
215
|
+
Zlib compresses the message data blob.
|
216
|
+
Each zlib compressed message must remain within megabyte in size.
|
217
|
+
|
218
|
+
### debug
|
219
|
+
|
220
|
+
Boolean. Enable if you need to debug Amazon Kinesis API call. Default is false.
|
221
|
+
|
222
|
+
## Configuration examples
|
223
|
+
|
224
|
+
Here are some configuration examles.
|
225
|
+
Assume that the JSON object below is coming to with tag 'your_tag'.
|
226
|
+
|
227
|
+
{
|
228
|
+
"name":"foo",
|
229
|
+
"action":"bar"
|
230
|
+
}
|
231
|
+
|
232
|
+
### Simply putting events to Amazon Kinesis with a partition key
|
233
|
+
|
234
|
+
In this example, simply a value 'foo' will be used as partition key,
|
235
|
+
then events will be sent to the stream specified in 'stream_name'.
|
236
|
+
|
237
|
+
<match your_tag>
|
238
|
+
type kinesis
|
239
|
+
|
240
|
+
stream_name YOUR_STREAM_NAME
|
241
|
+
|
242
|
+
aws_key_id YOUR_AWS_ACCESS_KEY
|
243
|
+
aws_sec_key YOUR_SECRET_KEY
|
244
|
+
|
245
|
+
region us-east-1
|
246
|
+
|
247
|
+
partition_key name
|
248
|
+
</match>
|
249
|
+
|
250
|
+
### Using partition_key_expr to add specific prefix to partition key
|
251
|
+
|
252
|
+
In this example, we add partition_key_expr to the example above.
|
253
|
+
This expression adds string 'some_prefix-' to partition key 'name',
|
254
|
+
then partition key finally will be 'some_prefix-foo'.
|
255
|
+
|
256
|
+
With specifying parition_key and parition_key_expr both,
|
257
|
+
the extracted value for partition key from JSON object will be
|
258
|
+
passed to your Ruby expression as a variable 'record'.
|
259
|
+
|
260
|
+
<match your_tag>
|
261
|
+
type kinesis
|
262
|
+
|
263
|
+
stream_name YOUR_STREAM_NAME
|
264
|
+
|
265
|
+
aws_key_id YOUR_AWS_ACCESS_KEY
|
266
|
+
aws_sec_key YOUR_SECRET_KEY
|
267
|
+
|
268
|
+
region us-east-1
|
269
|
+
|
270
|
+
partition_key name
|
271
|
+
partition_key_expr 'some_prefix-' + record
|
272
|
+
</match>
|
273
|
+
|
274
|
+
### Using partition_key_expr to extract a value for partition key
|
275
|
+
|
276
|
+
In this example, we use only partition_key_expr to extract
|
277
|
+
a value for partition key. It will be 'bar'.
|
278
|
+
|
279
|
+
Specifying partition_key_expr without partition_key,
|
280
|
+
hash object that is converted from whole JSON object will be
|
281
|
+
passed to your Ruby expression as a variable 'record'.
|
282
|
+
|
283
|
+
<match your_tag>
|
284
|
+
type kinesis
|
285
|
+
|
286
|
+
stream_name YOUR_STREAM_NAME
|
287
|
+
|
288
|
+
aws_key_id YOUR_AWS_ACCESS_KEY
|
289
|
+
aws_sec_key YOUR_SECRET_KEY
|
290
|
+
|
291
|
+
region us-east-1
|
292
|
+
|
293
|
+
partition_key_expr record['action']
|
294
|
+
</match>
|
295
|
+
|
296
|
+
### Improving throughput to Amazon Kinesis
|
297
|
+
|
298
|
+
The achievable throughput to Amazon Kinesis is limited to single-threaded
|
299
|
+
PutRecord calls if **order_events** is set to true. By setting **order_events**
|
300
|
+
to false records will be sent to Amazon Kinesis in batches. When operating in
|
301
|
+
this mode the plugin can also be configured to execute in parallel.
|
302
|
+
The **detach_process** and **num_threads** configuration settings control
|
303
|
+
parallelism.
|
304
|
+
|
305
|
+
Please note that **order_events** option will be ignored if you choose to
|
306
|
+
use either **detach_process** or **num_threads**.
|
307
|
+
|
308
|
+
In case of the configuration below, you will spawn 2 processes.
|
309
|
+
|
310
|
+
<match your_tag>
|
311
|
+
type kinesis
|
312
|
+
|
313
|
+
stream_name YOUR_STREAM_NAME
|
314
|
+
region us-east-1
|
315
|
+
|
316
|
+
detach_process 2
|
317
|
+
|
318
|
+
</match>
|
319
|
+
|
320
|
+
You can also specify a number of threads to put.
|
321
|
+
The number of threads is bound to each individual processes.
|
322
|
+
So in this case, you will spawn 1 process which has 50 threads.
|
323
|
+
|
324
|
+
<match your_tag>
|
325
|
+
type kinesis
|
326
|
+
|
327
|
+
stream_name YOUR_STREAM_NAME
|
328
|
+
region us-east-1
|
329
|
+
|
330
|
+
num_threads 50
|
331
|
+
</match>
|
332
|
+
|
333
|
+
Both options can be used together, in the configuration below,
|
334
|
+
you will spawn 2 processes and 50 threads per each processes.
|
335
|
+
|
336
|
+
<match your_tag>
|
337
|
+
type kinesis
|
338
|
+
|
339
|
+
stream_name YOUR_STREAM_NAME
|
340
|
+
region us-east-1
|
341
|
+
|
342
|
+
detach_process 2
|
343
|
+
num_threads 50
|
344
|
+
</match>
|
345
|
+
|
346
|
+
## Related Resources
|
347
|
+
|
348
|
+
* [Amazon Kinesis Developer Guide](http://docs.aws.amazon.com/kinesis/latest/dev/introduction.html)
|