fluent-plugin-kafka 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25a3a2247250b5f3c839378914e21ff82906986f
4
- data.tar.gz: e1f643b5798a8b07f12f7874391e449c5cd16f05
3
+ metadata.gz: 268cd322294a6f01fd118de3ef04c22997602d7c
4
+ data.tar.gz: 570de398931cf778f147d08738eab20ad78b8a9c
5
5
  SHA512:
6
- metadata.gz: 3dae82784298f2b431568805c5b4955cb64bb11e0e09f41bb95068c58f815fbd0b370dc5262a3254e196c28a08cf77f822c9b6ad91d2829901ef4983b4e80424
7
- data.tar.gz: 589d4ad5267d694732a2e5cf93d669516ea21f25d1d6872c4410ecd652fdd6cb24319e19db0ebf3aaba5639e44743c3c6fd4579c9d3e2fd1f61e6bb463a59df3
6
+ metadata.gz: 8e81f53b95cb3ad41c9cb46779ba941021de37ae667f3d7d2be7d24b80e6f1603de95ba673e0bb86d9c4ec54a7b34243b5201cdfc35b7598b2eaa4807221b066
7
+ data.tar.gz: f804bd9ea046af9dcc4e66081af471100fdcff044add13c0fd26bc3fe1c5241a6b758102b8a55649ef01c0fd0875d2bc1e2f0d87feca6f90b4e5959222e654a3
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Release 0.5.6 - 2017/07/10
2
+
3
+ * output: Add ActiveSupport notification support
4
+
1
5
  Release 0.5.5 - 2017/04/19
2
6
 
3
7
  * output: Some trace log level changed to debug
@@ -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.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.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-04-19 00:00:00.000000000 Z
12
+ date: 2017-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd