fluent-plugin-kubernetes-metrics 1.1.9 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +17 -14
- data/VERSION +1 -1
- data/fluent-plugin-kubernetes-metrics.gemspec +1 -1
- data/lib/fluent/plugin/in_kubernetes_metrics.rb +37 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11ae3ba83383e096cdcfc581bf50d68f832c51887e6855180cbdee1edd49ddcd
|
4
|
+
data.tar.gz: 9556c5b920f6b1b375fefd39916ffd28ee3938daeed6879595c76f6ed4b00bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d27837d1f6a1dbaf59d08d3c5e2b815ff7f841431ffdae1a1ff535d3a689330ebc66b63b7d8626129e2a5745c11ac84886f8afc56885bac77253a2b2c3af30d6
|
7
|
+
data.tar.gz: cae074b32b2b7ee35e93b37990ced26a69c96760f5e0a94e0875f2d731a1491d3638e4782062087e4ef183709b3c28c984c376a681a9cadd37dcc89c1159bcc3
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-kubernetes-metrics (1.1.
|
4
|
+
fluent-plugin-kubernetes-metrics (1.1.12)
|
5
5
|
fluentd (>= 1.9.1)
|
6
|
-
kubeclient (~> 4.
|
6
|
+
kubeclient (~> 4.9.3)
|
7
7
|
multi_json (~> 1.14.1)
|
8
8
|
oj (~> 3.10.2)
|
9
9
|
|
@@ -12,23 +12,23 @@ GEM
|
|
12
12
|
specs:
|
13
13
|
addressable (2.8.0)
|
14
14
|
public_suffix (>= 2.0.2, < 5.0)
|
15
|
-
concurrent-ruby (1.1.
|
15
|
+
concurrent-ruby (1.1.10)
|
16
16
|
cool.io (1.7.1)
|
17
17
|
crack (0.4.5)
|
18
18
|
rexml
|
19
19
|
docile (1.4.0)
|
20
20
|
domain_name (0.5.20190701)
|
21
21
|
unf (>= 0.0.5, < 1.0.0)
|
22
|
-
ffi (1.15.
|
22
|
+
ffi (1.15.5)
|
23
23
|
ffi-compiler (1.0.1)
|
24
24
|
ffi (>= 1.0.0)
|
25
25
|
rake
|
26
|
-
fluentd (1.14.
|
26
|
+
fluentd (1.14.6)
|
27
27
|
bundler
|
28
28
|
cool.io (>= 1.4.5, < 2.0.0)
|
29
29
|
http_parser.rb (>= 0.5.1, < 0.9.0)
|
30
30
|
msgpack (>= 1.3.1, < 2.0.0)
|
31
|
-
serverengine (>= 2.2.
|
31
|
+
serverengine (>= 2.2.5, < 3.0.0)
|
32
32
|
sigdump (~> 0.2.2)
|
33
33
|
strptime (>= 0.2.4, < 1.0.0)
|
34
34
|
tzinfo (>= 1.0, < 3.0)
|
@@ -49,14 +49,17 @@ GEM
|
|
49
49
|
ffi-compiler (>= 1.0, < 2.0)
|
50
50
|
http_parser.rb (0.8.0)
|
51
51
|
json (2.6.1)
|
52
|
-
|
52
|
+
jsonpath (1.1.0)
|
53
|
+
multi_json
|
54
|
+
kubeclient (4.9.3)
|
53
55
|
http (>= 3.0, < 5.0)
|
54
|
-
|
56
|
+
jsonpath (~> 1.0)
|
57
|
+
recursive-open-struct (~> 1.1, >= 1.1.1)
|
55
58
|
rest-client (~> 2.0)
|
56
59
|
mime-types (3.4.1)
|
57
60
|
mime-types-data (~> 3.2015)
|
58
61
|
mime-types-data (3.2022.0105)
|
59
|
-
msgpack (1.
|
62
|
+
msgpack (1.5.1)
|
60
63
|
multi_json (1.14.1)
|
61
64
|
netrc (0.11.0)
|
62
65
|
oj (3.10.18)
|
@@ -70,7 +73,7 @@ GEM
|
|
70
73
|
mime-types (>= 1.16, < 4.0)
|
71
74
|
netrc (~> 0.8)
|
72
75
|
rexml (3.2.5)
|
73
|
-
serverengine (2.2.
|
76
|
+
serverengine (2.2.5)
|
74
77
|
sigdump (~> 0.2.2)
|
75
78
|
sigdump (0.2.4)
|
76
79
|
simplecov (0.16.1)
|
@@ -83,17 +86,17 @@ GEM
|
|
83
86
|
power_assert
|
84
87
|
tzinfo (2.0.4)
|
85
88
|
concurrent-ruby (~> 1.0)
|
86
|
-
tzinfo-data (1.
|
89
|
+
tzinfo-data (1.2022.1)
|
87
90
|
tzinfo (>= 1.0.0)
|
88
91
|
unf (0.1.4)
|
89
92
|
unf_ext
|
90
|
-
unf_ext (0.0.8)
|
93
|
+
unf_ext (0.0.8.1)
|
91
94
|
webmock (3.5.1)
|
92
95
|
addressable (>= 2.3.6)
|
93
96
|
crack (>= 0.3.2)
|
94
97
|
hashdiff
|
95
98
|
webrick (1.7.0)
|
96
|
-
yajl-ruby (1.4.
|
99
|
+
yajl-ruby (1.4.2)
|
97
100
|
|
98
101
|
PLATFORMS
|
99
102
|
ruby
|
@@ -107,4 +110,4 @@ DEPENDENCIES
|
|
107
110
|
webmock (~> 3.5.1)
|
108
111
|
|
109
112
|
BUNDLED WITH
|
110
|
-
2.3.
|
113
|
+
2.3.12
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.12
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency 'test-unit', '~> 3.3.0'
|
26
26
|
spec.add_development_dependency 'webmock', '~> 3.5.1'
|
27
27
|
spec.add_runtime_dependency 'fluentd', '>= 1.9.1'
|
28
|
-
spec.add_runtime_dependency 'kubeclient', '~> 4.
|
28
|
+
spec.add_runtime_dependency 'kubeclient', '~> 4.9.3'
|
29
29
|
spec.add_runtime_dependency 'multi_json', '~> 1.14.1'
|
30
30
|
spec.add_runtime_dependency 'oj', '~> 3.10.2'
|
31
31
|
end
|
@@ -576,8 +576,42 @@ module Fluent
|
|
576
576
|
|
577
577
|
unless pod['startTime'].nil?
|
578
578
|
emit_uptime tag: tag, start_time: pod['startTime'], labels: labels
|
579
|
-
|
580
|
-
|
579
|
+
if pod['cpu'].nil?
|
580
|
+
if pod['containers'].nil? or Array(pod['containers']).empty?
|
581
|
+
log.warn "Summary API response has no pod cpu metrics information"
|
582
|
+
else
|
583
|
+
usageNanoCores = 0
|
584
|
+
usageCoreNanoSeconds = 0
|
585
|
+
time = nil
|
586
|
+
Array(pod['containers']).each do |container|
|
587
|
+
time = container['time'] unless container['time'].nil?
|
588
|
+
usageNanoCores += container['usageNanoCores']
|
589
|
+
usageCoreNanoSeconds += container['usageCoreNanoSeconds']
|
590
|
+
end
|
591
|
+
pod['cpu'] = { 'time' => time, 'usageNanoCores' => usageNanoCores, 'usageCoreNanoSeconds' => usageCoreNanoSeconds }
|
592
|
+
end
|
593
|
+
end
|
594
|
+
emit_cpu_metrics tag: tag, metrics: pod['cpu'], labels: labels unless pod['cpu'].nil?
|
595
|
+
if pod['memory'].nil?
|
596
|
+
if pod['containers'].nil? or Array(pod['containers']).empty?
|
597
|
+
log.warn "Summary API response has no pod memory metrics information"
|
598
|
+
else
|
599
|
+
Array(pod['containers']).each do |container|
|
600
|
+
time = nil
|
601
|
+
memory_metrics = {}
|
602
|
+
%w[availableBytes usageBytes workingSetBytes rssBytes pageFaults majorPageFaults].each do |name|
|
603
|
+
time = container['time'] unless container['time'].nil?
|
604
|
+
if value = metrics[name]
|
605
|
+
memory_metrics[name] = 0 if memory_metrics[name].nil?
|
606
|
+
memory_metrics[name] += value
|
607
|
+
end
|
608
|
+
end
|
609
|
+
end
|
610
|
+
memory_metrics['time'] = time
|
611
|
+
pod['memory'] = memory_metrics
|
612
|
+
end
|
613
|
+
end
|
614
|
+
emit_memory_metrics tag: tag, metrics: pod['memory'], labels: labels unless pod['memory'].nil?
|
581
615
|
emit_network_metrics tag: tag, metrics: pod['network'], labels: labels unless pod['network'].nil?
|
582
616
|
emit_fs_metrics tag: "#{tag}.ephemeral-storage", metrics: pod['ephemeral-storage'], labels: labels unless pod['ephemeral-storage'].nil?
|
583
617
|
unless pod['volume'].nil?
|
@@ -595,6 +629,7 @@ module Fluent
|
|
595
629
|
|
596
630
|
def emit_metrics(metrics)
|
597
631
|
emit_node_metrics(metrics['node']) unless metrics['node'].nil?
|
632
|
+
log.warn "Summary API received empty pods info" if (metrics['pods'].nil? or metrics['pods'].empty?)
|
598
633
|
Array(metrics['pods']).each &method(:emit_pod_metrics).curry.call(metrics['node']['nodeName']) unless metrics['pods'].nil?
|
599
634
|
end
|
600
635
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-kubernetes-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Splunk Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 4.
|
103
|
+
version: 4.9.3
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 4.
|
110
|
+
version: 4.9.3
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: multi_json
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|