fluent-plugin-kafka 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/fluent-plugin-kafka.gemspec +1 -1
- data/lib/fluent/plugin/out_kafka.rb +15 -0
- data/lib/fluent/plugin/out_kafka2.rb +15 -0
- data/lib/fluent/plugin/out_kafka_buffered.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268cd322294a6f01fd118de3ef04c22997602d7c
|
4
|
+
data.tar.gz: 570de398931cf778f147d08738eab20ad78b8a9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e81f53b95cb3ad41c9cb46779ba941021de37ae667f3d7d2be7d24b80e6f1603de95ba673e0bb86d9c4ec54a7b34243b5201cdfc35b7598b2eaa4807221b066
|
7
|
+
data.tar.gz: f804bd9ea046af9dcc4e66081af471100fdcff044add13c0fd26bc3fe1c5241a6b758102b8a55649ef01c0fd0875d2bc1e2f0d87feca6f90b4e5959222e654a3
|
data/ChangeLog
CHANGED
data/fluent-plugin-kafka.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
13
|
gem.name = "fluent-plugin-kafka"
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.version = '0.5.
|
15
|
+
gem.version = '0.5.6'
|
16
16
|
gem.required_ruby_version = ">= 2.1.0"
|
17
17
|
|
18
18
|
gem.add_dependency "fluentd", [">= 0.10.58", "< 2"]
|
@@ -60,6 +60,12 @@ DESC
|
|
60
60
|
config_param :max_buffer_bytesize, :integer, :default => nil,
|
61
61
|
:desc => "Maximum size in bytes to be buffered."
|
62
62
|
|
63
|
+
config_param :active_support_notification_regex, :string, :default => nil,
|
64
|
+
:desc => <<-DESC
|
65
|
+
Add a regular expression to capture ActiveSupport notifications from the Kafka client
|
66
|
+
requires activesupport gem - records will be generated under fluent_kafka_stats.**
|
67
|
+
DESC
|
68
|
+
|
63
69
|
include Fluent::KafkaPluginUtil::SSLSettings
|
64
70
|
|
65
71
|
attr_accessor :output_data_type
|
@@ -130,6 +136,15 @@ DESC
|
|
130
136
|
@producer_opts[:compression_codec] = @compression_codec.to_sym if @compression_codec
|
131
137
|
@producer_opts[:max_buffer_size] = @max_buffer_size if @max_buffer_size
|
132
138
|
@producer_opts[:max_buffer_bytesize] = @max_buffer_bytesize if @max_buffer_bytesize
|
139
|
+
if @active_support_notification_regex
|
140
|
+
require 'active_support/notifications'
|
141
|
+
require 'active_support/core_ext/hash/keys'
|
142
|
+
ActiveSupport::Notifications.subscribe(Regexp.new(@active_support_notification_regex)) do |*args|
|
143
|
+
event = ActiveSupport::Notifications::Event.new(*args)
|
144
|
+
message = event.payload.respond_to?(:stringify_keys) ? event.payload.stringify_keys : event.payload
|
145
|
+
@router.emit("fluent_kafka_stats.#{event.name}", Time.now.to_i, message)
|
146
|
+
end
|
147
|
+
end
|
133
148
|
end
|
134
149
|
|
135
150
|
def start
|
@@ -43,6 +43,12 @@ DESC
|
|
43
43
|
:desc => <<-DESC
|
44
44
|
The codec the producer uses to compress messages.
|
45
45
|
Supported codecs: (gzip|snappy)
|
46
|
+
DESC
|
47
|
+
|
48
|
+
config_param :active_support_notification_regex, :string, :default => nil,
|
49
|
+
:desc => <<-DESC
|
50
|
+
Add a regular expression to capture ActiveSupport notifications from the Kafka client
|
51
|
+
requires activesupport gem - records will be generated under fluent_kafka_stats.**
|
46
52
|
DESC
|
47
53
|
|
48
54
|
config_section :buffer do
|
@@ -96,6 +102,15 @@ DESC
|
|
96
102
|
@producer_opts = {max_retries: @max_send_retries, required_acks: @required_acks}
|
97
103
|
@producer_opts[:ack_timeout] = @ack_timeout if @ack_timeout
|
98
104
|
@producer_opts[:compression_codec] = @compression_codec.to_sym if @compression_codec
|
105
|
+
if @active_support_notification_regex
|
106
|
+
require 'active_support/notifications'
|
107
|
+
require 'active_support/core_ext/hash/keys'
|
108
|
+
ActiveSupport::Notifications.subscribe(Regexp.new(@active_support_notification_regex)) do |*args|
|
109
|
+
event = ActiveSupport::Notifications::Event.new(*args)
|
110
|
+
message = event.payload.respond_to?(:stringify_keys) ? event.payload.stringify_keys : event.payload
|
111
|
+
@router.emit("fluent_kafka_stats.#{event.name}", Time.now.to_i, message)
|
112
|
+
end
|
113
|
+
end
|
99
114
|
end
|
100
115
|
|
101
116
|
def multi_workers_ready?
|
@@ -67,6 +67,12 @@ DESC
|
|
67
67
|
|
68
68
|
config_param :time_format, :string, :default => nil
|
69
69
|
|
70
|
+
config_param :active_support_notification_regex, :string, :default => nil,
|
71
|
+
:desc => <<-DESC
|
72
|
+
Add a regular expression to capture ActiveSupport notifications from the Kafka client
|
73
|
+
requires activesupport gem - records will be generated under fluent_kafka_stats.**
|
74
|
+
DESC
|
75
|
+
|
70
76
|
include Fluent::KafkaPluginUtil::SSLSettings
|
71
77
|
|
72
78
|
attr_accessor :output_data_type
|
@@ -148,6 +154,16 @@ DESC
|
|
148
154
|
log.warn "'discard_kafka_delivery_failed' option discards events which cause delivery failure, e.g. invalid topic or something."
|
149
155
|
log.warn "If this is unexpected, you need to check your configuration or data."
|
150
156
|
end
|
157
|
+
|
158
|
+
if @active_support_notification_regex
|
159
|
+
require 'active_support/notifications'
|
160
|
+
require 'active_support/core_ext/hash/keys'
|
161
|
+
ActiveSupport::Notifications.subscribe(Regexp.new(@active_support_notification_regex)) do |*args|
|
162
|
+
event = ActiveSupport::Notifications::Event.new(*args)
|
163
|
+
message = event.payload.respond_to?(:stringify_keys) ? event.payload.stringify_keys : event.payload
|
164
|
+
@router.emit("fluent_kafka_stats.#{event.name}", Time.now.to_i, message)
|
165
|
+
end
|
166
|
+
end
|
151
167
|
end
|
152
168
|
|
153
169
|
def start
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-kafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hidemasa Togashi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|