adp-fluent-plugin-graphite 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8f41b1f8236d22138026f93a01dd8b8c8f275f65264849010902d95656e8e21
4
- data.tar.gz: cf890fcb37148e913069411c28dcf5c9883e92a172a07c369000cadf861ed661
3
+ metadata.gz: 735882e51914fbee5abad89b0957edff10dbf0885f558083ab9ed446e3a1baf7
4
+ data.tar.gz: f60a0f88d1a9dc836a7543a97326983852fd07044469a772fc7353f8671b0560
5
5
  SHA512:
6
- metadata.gz: 783602a7e1ffd0adeb5e5d70a621f2ca4de1df69372f673f0140b8d52b4523310b8aafb5b34005cbb7d7c447861d7bacda89de326af6e84e94483632b7607a5f
7
- data.tar.gz: a3c1e3fa7536d6c18bc7b6b8c074423063efad4e47b0f6e6eea1726838e16ff391de465c564426ed0fbf2c33b971587769f6918815f2d5261c6e10f5f23a3d3c
6
+ metadata.gz: 628590adf47f853ff897116ee9db702b0105783787d138ad79a99186c5208736c6084eb475a58f484dc4ae13076ccaf4124297ab15933b29989acdaa66a427f8
7
+ data.tar.gz: 87a60715fd0076afcb206e9f4422ff19e28e8a5489af4eabfd2a5568ddb54ea6be18a0f0e0602bf9e54cc7b678b3651bb22d37cafda5ee63e6b322fc0a7c67ea
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'adp-fluent-plugin-graphite'
6
- gem.version = '0.0.3'
6
+ gem.version = '0.0.4'
7
7
  gem.authors = ['Satoshi SUZUKI']
8
8
  gem.email = 'studio3104.com@gmail.com'
9
9
  gem.homepage = 'https://github.com/studio3104/fluent-plugin-graphite'
@@ -13,11 +13,7 @@ module Fluent::Plugin
13
13
  config_param :tag_for, :string, default: 'prefix'
14
14
  config_param :name_keys, :string, default: nil
15
15
  config_param :name_key_pattern, :string, default: nil
16
-
17
- # Define `log` method for v0.10.42 or earlier
18
- unless method_defined?(:log)
19
- define_method(:log) { $log }
20
- end
16
+ config_param :max_retries, :integer, default: 3
21
17
 
22
18
  def initialize
23
19
  super
@@ -33,31 +29,16 @@ module Fluent::Plugin
33
29
  def configure(conf)
34
30
  super
35
31
 
36
- if !['prefix', 'suffix', 'ignore'].include?(@tag_for)
37
- raise Fluent::ConfigError, 'out_graphite: can specify to tag_for only prefix, suffix or ignore'
38
- end
39
-
40
- if !@name_keys && !@name_key_pattern
41
- raise Fluent::ConfigError, 'out_graphite: missing both of name_keys and name_key_pattern'
42
- end
43
- if @name_keys && @name_key_pattern
44
- raise Fluent::ConfigError, 'out_graphite: cannot specify both of name_keys and name_key_pattern'
45
- end
46
-
47
32
  if @name_keys
48
33
  @name_keys = @name_keys.split(',')
49
34
  end
50
- if @name_key_pattern
51
- @name_key_pattern = Regexp.new(@name_key_pattern)
52
- end
53
- # How many times to retry the call if timeout raised
54
- @max_retries ||= 3
55
35
  end
56
36
 
57
37
  def emit(tag, es, chain)
58
38
  es.each do |time, record|
59
39
  emit_tag = tag.dup
60
40
  filter_record(emit_tag, time, record)
41
+ log.info("Emit graphite plugin: #{record}")
61
42
  next unless metrics = format_metrics(emit_tag, record)
62
43
 
63
44
  # implemented to immediate call post method in this loop, because graphite-api.gem has the buffers.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adp-fluent-plugin-graphite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi SUZUKI