adp-fluent-plugin-graphite 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/adp-fluent-plugin-graphite.gemspec +1 -1
- data/lib/fluent/plugin/out_graphite.rb +2 -21
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 735882e51914fbee5abad89b0957edff10dbf0885f558083ab9ed446e3a1baf7
|
4
|
+
data.tar.gz: f60a0f88d1a9dc836a7543a97326983852fd07044469a772fc7353f8671b0560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|