adp-fluent-plugin-graphite 0.1.0 → 0.1.1
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 972305dfab080939201cd709b16d6530d49fbfeb80cd0bad2d4f182a6f7304a4
|
4
|
+
data.tar.gz: 765fdaa78c9d148294e5741bee401d5498ac9eac0a390b309bb07b87c1c303e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a89798fa104f36eb429c4ad40456e0360c55c0f935a68c5aee69321bd4cbeb2dc1e8972da628e8cb33166f9d425accf7cdd9fd6375c34259cb789320d2e157b
|
7
|
+
data.tar.gz: 5086fa5cfbfec7d4b7d3003009a773068167fe1710241dd0c629ed97c50f049979b9b366f2dba0991f74e9e10f5fb0473189b20ed1c646124a9a65c258aeeeb0
|
@@ -3,6 +3,8 @@ require 'fluent/plugin/output'
|
|
3
3
|
module Fluent::Plugin
|
4
4
|
class GraphiteFilter < Fluent::Plugin::Filter
|
5
5
|
Fluent::Plugin.register_filter('graphite', self)
|
6
|
+
include Fluent::Plugin::Graphite
|
7
|
+
|
6
8
|
config_param :host, :string
|
7
9
|
config_param :port, :integer, default: 2003
|
8
10
|
config_param :prefix, :string, default: 'adp-fluentd-agent'
|
@@ -12,7 +14,7 @@ module Fluent::Plugin
|
|
12
14
|
|
13
15
|
def start
|
14
16
|
super
|
15
|
-
|
17
|
+
Graphite.init_client(@log_level, @host, @port)
|
16
18
|
end
|
17
19
|
|
18
20
|
def configure(conf)
|
@@ -20,8 +22,8 @@ module Fluent::Plugin
|
|
20
22
|
end
|
21
23
|
|
22
24
|
def filter(tag, time, record)
|
23
|
-
metrics =
|
24
|
-
|
25
|
+
metrics = Graphite.format_metrics(tag, record)
|
26
|
+
Graphite.post(metrics, time)
|
25
27
|
record
|
26
28
|
end
|
27
29
|
end
|
@@ -15,7 +15,7 @@ module Fluent::Plugin
|
|
15
15
|
|
16
16
|
def start
|
17
17
|
super
|
18
|
-
|
18
|
+
Graphite.init_client(@log_level, @host, @port)
|
19
19
|
end
|
20
20
|
|
21
21
|
def configure(conf)
|
@@ -25,10 +25,10 @@ module Fluent::Plugin
|
|
25
25
|
def process(tag, es)
|
26
26
|
es.each do |time, record|
|
27
27
|
emit_tag = tag.dup
|
28
|
-
metrics =
|
28
|
+
metrics = Graphite.format_metrics(emit_tag, record)
|
29
29
|
|
30
30
|
# implemented to immediate call post method in this loop, because graphite-api.gem has the buffers.
|
31
|
-
|
31
|
+
Graphite.post(metrics, time)
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|