fluent-plugin-out_hosted_graphite 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +4 -3
- data/fluent-plugin-out_hosted_graphite.gemspec +1 -1
- data/lib/fluent/plugin/out_hosted_graphite.rb +18 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 678f2d3be9ceb03ba495ce2895b2b397c4c319df
|
4
|
+
data.tar.gz: 4b9b4197a86eff1c8a9fa73462c9774dd984e01e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f3df098375c7ae4e8ec8c802bea92d0d61009172505d715bb6f6010037cd7ef8af473a3bc5a20a1323a420262a890234bdd59f9b500250791291117eb40819
|
7
|
+
data.tar.gz: a95ef604c4fc0da39b9377c875eea602ef266f71c0a87c2f4f684f32fb93874b79cfb7ceccbcc98f3e3ed5188e00c7b0134d2d0f50a3d14f5caafe7e1ffaba4d
|
data/README.md
CHANGED
@@ -26,18 +26,19 @@ Or install it yourself as:
|
|
26
26
|
<match *.*>
|
27
27
|
type hosted_graphite
|
28
28
|
api_key xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx
|
29
|
-
metric_key foo.bar
|
29
|
+
metric_key foo.bar,hoge,fuga,bar
|
30
30
|
protocol udp
|
31
31
|
</match>
|
32
32
|
```
|
33
33
|
|
34
34
|
### api_key
|
35
35
|
|
36
|
-
*
|
36
|
+
* Required
|
37
37
|
|
38
38
|
### metric_key
|
39
39
|
|
40
|
-
*
|
40
|
+
* Required
|
41
|
+
* Supported multiple keys
|
41
42
|
|
42
43
|
### protocol
|
43
44
|
|
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "fluent-plugin-out_hosted_graphite"
|
8
|
-
spec.version = "0.0.
|
8
|
+
spec.version = "0.0.2"
|
9
9
|
spec.authors = ["inokappa"]
|
10
10
|
spec.email = ["inokappa"]
|
11
11
|
spec.summary = %q{fluentd output plugin for post to Hosted Graphite}
|
@@ -23,20 +23,28 @@ module Fluent
|
|
23
23
|
# ...
|
24
24
|
end
|
25
25
|
|
26
|
+
def configure(conf)
|
27
|
+
super
|
28
|
+
|
29
|
+
if @metric_key
|
30
|
+
@metric_key = @metric_key.split(',')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
26
34
|
def emit(tag, es, chain)
|
27
35
|
chain.next
|
28
|
-
es.each
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
36
|
+
es.each do |time,record|
|
37
|
+
@metric_key.each do |metric_key|
|
38
|
+
record.select do |k,v|
|
39
|
+
if metric_key.include?(k)
|
40
|
+
metric = record[k].to_f
|
41
|
+
post_metrics(k, metric)
|
42
|
+
end
|
43
|
+
end
|
35
44
|
end
|
36
|
-
|
45
|
+
end
|
37
46
|
end
|
38
47
|
|
39
|
-
|
40
48
|
def post_metrics(metric_key, metric)
|
41
49
|
HostedGraphite.api_key = @api_key
|
42
50
|
case @protocol
|
@@ -49,7 +57,7 @@ module Fluent
|
|
49
57
|
end
|
50
58
|
HostedGraphite.send_metric(metric_key, metric)
|
51
59
|
#result = HostedGraphite.send_metric(metric_key, metric)
|
52
|
-
#puts "debug_out: #{@api_key} #{@protocol}
|
60
|
+
#puts "debug_out: #{@api_key} #{@protocol} - #{metric_key} - #{metric}\n"
|
53
61
|
end
|
54
62
|
|
55
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-out_hosted_graphite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- inokappa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|