fluent-plugin-deis-graphite 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fluent/plugin/out_deis-graphite.rb +14 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc8fbb6c8d97e3949db5e6232ece65ae8d624c46
|
4
|
+
data.tar.gz: 7e552cb88a1a2b260f9d01d9cd1204b135efc87d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b59f20345aa1907c5fa1823cca9bda874e5901c59b07982ffa61e5f97c9dc976e1ad96150afd17772ed5717c4da16ab4dfbc9216bfeb2fbe345ea504a71cc311
|
7
|
+
data.tar.gz: 6efd5351c6643ae72f581a1cc9dee81108276684e366d66564005f22f9ce66e180a092942263cdbbdb7bfa3bb7f4fd4e5cba36f92b08a92dec4790d833b7b374
|
@@ -2,6 +2,7 @@ require 'fluent/output'
|
|
2
2
|
require 'metriks'
|
3
3
|
require 'metriks/reporter/graphite'
|
4
4
|
require 'metriks/reporter/logger'
|
5
|
+
require 'unirest'
|
5
6
|
|
6
7
|
module Fluent
|
7
8
|
class DeisGraphiteOutput < Output
|
@@ -9,11 +10,23 @@ module Fluent
|
|
9
10
|
|
10
11
|
@reporter = nil
|
11
12
|
@logging_reporter = nil
|
13
|
+
@cluster_name="unknown_cluster"
|
12
14
|
config_param :graphite_url, :string, :default => ''
|
13
15
|
config_param :graphite_port, :integer, :default => 2003
|
14
16
|
config_param :graphite_interval, :integer, :default => 10
|
15
17
|
|
16
18
|
def initialize
|
19
|
+
|
20
|
+
#Get the cluster name from Google metadata service
|
21
|
+
begin
|
22
|
+
response = Unirest.get('http://metadata.google.internal/computeMetadata/v1/instance/attributes/cluster-name',headers:{ "Metadata-Flavor" => "Google"})
|
23
|
+
if response.code == 200
|
24
|
+
@cluster_name=response.body
|
25
|
+
end
|
26
|
+
rescue
|
27
|
+
p "Couldn't determine cluster name."
|
28
|
+
end
|
29
|
+
|
17
30
|
super
|
18
31
|
end
|
19
32
|
|
@@ -43,7 +56,7 @@ module Fluent
|
|
43
56
|
#response_time = split_message[12].strip.to_f
|
44
57
|
#request_time = split_message[13].strip.to_f
|
45
58
|
|
46
|
-
Metriks.meter("response_rates.#{record["kubernetes"]["pod_name"]}.#{app}.#{status_code}").mark
|
59
|
+
Metriks.meter("response_rates.#{@cluster_name}.#{record["kubernetes"]["pod_name"]}.#{app}.#{status_code}").mark
|
47
60
|
end
|
48
61
|
end
|
49
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-deis-graphite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Knox
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: unirest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|