adp-fluent-plugin-graphite 0.0.3 → 0.0.7
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 +4 -23
- 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: 2cf1fde65bf527feec4f5bdcb3a1ac13c4e3479f7695a1662bd0484e4759ba9d
|
4
|
+
data.tar.gz: 95dc1c0ec5507f58d0d1d98b7ce9979ae2760f2926010b971e72bf4acfc56313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07c509264532d610cfb79f5b1d91d06e3d52a3fd5911169f290a6ffab67b6ea7484592b34b7d7a8aeb0b9693792e45ea4a89115b57786cc51955f5f02d7ec0fb
|
7
|
+
data.tar.gz: '059c7d712b4cbc8030b48c1201ffccbf15ee42f54b6daad61c300deffc2bb808e69a23910dca5250e2475a304da8627fedb36a31342c6a05f028ccb2664e9a7f'
|
@@ -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.7'
|
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'
|
@@ -5,7 +5,6 @@ module Fluent::Plugin
|
|
5
5
|
class GraphiteOutput < Output
|
6
6
|
Fluent::Plugin.register_output('graphite', self)
|
7
7
|
|
8
|
-
include Fluent::HandleTagNameMixin
|
9
8
|
include Fluent::Mixin::RewriteTagName
|
10
9
|
|
11
10
|
config_param :host, :string
|
@@ -13,11 +12,7 @@ module Fluent::Plugin
|
|
13
12
|
config_param :tag_for, :string, default: 'prefix'
|
14
13
|
config_param :name_keys, :string, default: nil
|
15
14
|
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
|
15
|
+
config_param :max_retries, :integer, default: 3
|
21
16
|
|
22
17
|
def initialize
|
23
18
|
super
|
@@ -32,32 +27,18 @@ module Fluent::Plugin
|
|
32
27
|
|
33
28
|
def configure(conf)
|
34
29
|
super
|
35
|
-
|
36
|
-
|
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'
|
30
|
+
if (!@tag && !@remove_tag_prefix && !@remove_tag_suffix && !@add_tag_prefix && !@add_tag_suffix)
|
31
|
+
raise Fluent::ConfigError, "foo_bar: missing remove_tag_prefix, remove_tag_suffix, add_tag_prefix or add_tag_suffix."
|
45
32
|
end
|
46
|
-
|
47
33
|
if @name_keys
|
48
34
|
@name_keys = @name_keys.split(',')
|
49
35
|
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
36
|
end
|
56
37
|
|
57
38
|
def emit(tag, es, chain)
|
58
39
|
es.each do |time, record|
|
59
40
|
emit_tag = tag.dup
|
60
|
-
|
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.
|