adp-fluent-plugin-graphite 0.1.0 → 0.1.4
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: 468f0f41751a3014f3a0ec50e14791e05c81a321511d6dc0af68dfaf5aade925
|
4
|
+
data.tar.gz: 3be876e6f738dd2342285e9a0faeeaace9141be23eb9819f118a45e16d404d35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6420a09eda2b2f66d03a9dbc51208027bb7c508e0ad7a7a8c2457a96ac95b958ae1d288c7c508144b04ab3d7b912ef213a55d90896663e7bd26a331877bbd93
|
7
|
+
data.tar.gz: 73a18d9bf3bad9f5ef6be236b033e1862a6c17300a72445b97272afd102e5eb63a6e9e13b7719ca7b44ad5932c9e8273bc3e7e40d11c03289e11275585ed1616
|
@@ -1,8 +1,11 @@
|
|
1
|
-
require 'fluent/plugin/
|
1
|
+
require 'fluent/plugin/graphite'
|
2
|
+
require 'fluent/plugin/filter'
|
2
3
|
|
3
4
|
module Fluent::Plugin
|
4
5
|
class GraphiteFilter < Fluent::Plugin::Filter
|
5
6
|
Fluent::Plugin.register_filter('graphite', self)
|
7
|
+
include Fluent::Plugin::Graphite
|
8
|
+
|
6
9
|
config_param :host, :string
|
7
10
|
config_param :port, :integer, default: 2003
|
8
11
|
config_param :prefix, :string, default: 'adp-fluentd-agent'
|
@@ -12,7 +15,7 @@ module Fluent::Plugin
|
|
12
15
|
|
13
16
|
def start
|
14
17
|
super
|
15
|
-
|
18
|
+
init_client(@log_level, @host, @port)
|
16
19
|
end
|
17
20
|
|
18
21
|
def configure(conf)
|
@@ -20,8 +23,8 @@ module Fluent::Plugin
|
|
20
23
|
end
|
21
24
|
|
22
25
|
def filter(tag, time, record)
|
23
|
-
metrics =
|
24
|
-
|
26
|
+
metrics = format_metrics(tag, record)
|
27
|
+
post(metrics, time)
|
25
28
|
record
|
26
29
|
end
|
27
30
|
end
|
@@ -53,6 +53,7 @@ module Fluent
|
|
53
53
|
def post(metric, time)
|
54
54
|
trial ||= 1
|
55
55
|
@client.metrics(metric, time)
|
56
|
+
log.debug("Sending metric: #{metric}")
|
56
57
|
rescue Errno::ETIMEDOUT
|
57
58
|
# after long periods with nothing emitted, the connection will be closed and result in timeout
|
58
59
|
if trial <= @max_retries
|
@@ -15,7 +15,7 @@ module Fluent::Plugin
|
|
15
15
|
|
16
16
|
def start
|
17
17
|
super
|
18
|
-
|
18
|
+
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 = 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
|
+
post(metrics, time)
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adp-fluent-plugin-graphite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksander Dudek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|