fluent-plugin-kubernetes_metadata_filter 2.4.2 → 2.4.4
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/.gitignore +0 -1
- data/Gemfile.lock +147 -0
- data/fluent-plugin-kubernetes_metadata_filter.gemspec +1 -1
- data/lib/fluent/plugin/filter_kubernetes_metadata.rb +2 -9
- data/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb +1 -1
- data/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb +4 -2
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0960ac42673a9a25d8c1e293f152f432a89abe9bdad0cf2065670c9a5dee2a0c'
|
|
4
|
+
data.tar.gz: d351fb9d627c46b6da586ed9fa77f64ac2c3d475f924473a948fc190b3bbc9b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2cf30a65489f4d740302fa0c461cec207f0d8581a88be4a3692059a40fd17f3619b38f291f5a5dc3f585965d264113ed556d0f9fdea848a1ff818a0e7aa959e8
|
|
7
|
+
data.tar.gz: 66b9d0ad3e645b2f98c4a19f3d73cec2970a1e99a442520c2ea21d127be3071d2b54d020c97c37d3766324e92e1b035dbbb1782ed539c2db22294ebd0f571ad9
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
fluent-plugin-kubernetes_metadata_filter (2.4.4)
|
|
5
|
+
fluentd (>= 0.14.0, < 2)
|
|
6
|
+
kubeclient (< 5)
|
|
7
|
+
lru_redux
|
|
8
|
+
|
|
9
|
+
GEM
|
|
10
|
+
remote: https://rubygems.org/
|
|
11
|
+
specs:
|
|
12
|
+
addressable (2.7.0)
|
|
13
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
14
|
+
ast (2.4.0)
|
|
15
|
+
bump (0.9.0)
|
|
16
|
+
charlock_holmes (0.7.7)
|
|
17
|
+
codeclimate-test-reporter (0.6.0)
|
|
18
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
|
19
|
+
concurrent-ruby (1.1.6)
|
|
20
|
+
cool.io (1.6.0)
|
|
21
|
+
copyright-header (1.0.22)
|
|
22
|
+
github-linguist
|
|
23
|
+
crack (0.4.3)
|
|
24
|
+
safe_yaml (~> 1.0.0)
|
|
25
|
+
docile (1.3.2)
|
|
26
|
+
domain_name (0.5.20190701)
|
|
27
|
+
unf (>= 0.0.5, < 1.0.0)
|
|
28
|
+
escape_utils (1.2.1)
|
|
29
|
+
ffi (1.12.2)
|
|
30
|
+
ffi-compiler (1.0.1)
|
|
31
|
+
ffi (>= 1.0.0)
|
|
32
|
+
rake
|
|
33
|
+
fluentd (1.9.3)
|
|
34
|
+
cool.io (>= 1.4.5, < 2.0.0)
|
|
35
|
+
http_parser.rb (>= 0.5.1, < 0.7.0)
|
|
36
|
+
msgpack (>= 1.3.1, < 2.0.0)
|
|
37
|
+
serverengine (>= 2.0.4, < 3.0.0)
|
|
38
|
+
sigdump (~> 0.2.2)
|
|
39
|
+
strptime (>= 0.2.2, < 1.0.0)
|
|
40
|
+
tzinfo (>= 1.0, < 3.0)
|
|
41
|
+
tzinfo-data (~> 1.0)
|
|
42
|
+
yajl-ruby (~> 1.0)
|
|
43
|
+
github-linguist (7.8.0)
|
|
44
|
+
charlock_holmes (~> 0.7.6)
|
|
45
|
+
escape_utils (~> 1.2.0)
|
|
46
|
+
mini_mime (~> 1.0)
|
|
47
|
+
rugged (>= 0.25.1)
|
|
48
|
+
hashdiff (1.0.1)
|
|
49
|
+
http (4.3.0)
|
|
50
|
+
addressable (~> 2.3)
|
|
51
|
+
http-cookie (~> 1.0)
|
|
52
|
+
http-form_data (~> 2.2)
|
|
53
|
+
http-parser (~> 1.2.0)
|
|
54
|
+
http-accept (1.7.0)
|
|
55
|
+
http-cookie (1.0.3)
|
|
56
|
+
domain_name (~> 0.5)
|
|
57
|
+
http-form_data (2.3.0)
|
|
58
|
+
http-parser (1.2.1)
|
|
59
|
+
ffi-compiler (>= 1.0, < 2.0)
|
|
60
|
+
http_parser.rb (0.6.0)
|
|
61
|
+
jaro_winkler (1.5.4)
|
|
62
|
+
kubeclient (4.6.0)
|
|
63
|
+
http (>= 3.0, < 5.0)
|
|
64
|
+
recursive-open-struct (~> 1.0, >= 1.0.4)
|
|
65
|
+
rest-client (~> 2.0)
|
|
66
|
+
lru_redux (1.1.0)
|
|
67
|
+
mime-types (3.3.1)
|
|
68
|
+
mime-types-data (~> 3.2015)
|
|
69
|
+
mime-types-data (3.2019.1009)
|
|
70
|
+
mini_mime (1.0.2)
|
|
71
|
+
minitest (4.7.5)
|
|
72
|
+
msgpack (1.3.3)
|
|
73
|
+
netrc (0.11.0)
|
|
74
|
+
parallel (1.19.1)
|
|
75
|
+
parser (2.7.0.4)
|
|
76
|
+
ast (~> 2.4.0)
|
|
77
|
+
power_assert (1.1.6)
|
|
78
|
+
public_suffix (4.0.3)
|
|
79
|
+
rainbow (3.0.0)
|
|
80
|
+
rake (13.0.1)
|
|
81
|
+
recursive-open-struct (1.1.1)
|
|
82
|
+
rest-client (2.1.0)
|
|
83
|
+
http-accept (>= 1.7.0, < 2.0)
|
|
84
|
+
http-cookie (>= 1.0.2, < 2.0)
|
|
85
|
+
mime-types (>= 1.16, < 4.0)
|
|
86
|
+
netrc (~> 0.8)
|
|
87
|
+
rexml (3.2.4)
|
|
88
|
+
rr (1.2.1)
|
|
89
|
+
rubocop (0.80.1)
|
|
90
|
+
jaro_winkler (~> 1.5.1)
|
|
91
|
+
parallel (~> 1.10)
|
|
92
|
+
parser (>= 2.7.0.1)
|
|
93
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
94
|
+
rexml
|
|
95
|
+
ruby-progressbar (~> 1.7)
|
|
96
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
|
97
|
+
ruby-progressbar (1.10.1)
|
|
98
|
+
rugged (0.99.0)
|
|
99
|
+
safe_yaml (1.0.5)
|
|
100
|
+
serverengine (2.2.1)
|
|
101
|
+
sigdump (~> 0.2.2)
|
|
102
|
+
sigdump (0.2.4)
|
|
103
|
+
simplecov (0.18.5)
|
|
104
|
+
docile (~> 1.1)
|
|
105
|
+
simplecov-html (~> 0.11)
|
|
106
|
+
simplecov-html (0.12.2)
|
|
107
|
+
strptime (0.2.3)
|
|
108
|
+
test-unit (3.0.9)
|
|
109
|
+
power_assert
|
|
110
|
+
test-unit-rr (1.0.5)
|
|
111
|
+
rr (>= 1.1.1)
|
|
112
|
+
test-unit (>= 2.5.2)
|
|
113
|
+
tzinfo (2.0.1)
|
|
114
|
+
concurrent-ruby (~> 1.0)
|
|
115
|
+
tzinfo-data (1.2019.3)
|
|
116
|
+
tzinfo (>= 1.0.0)
|
|
117
|
+
unf (0.1.4)
|
|
118
|
+
unf_ext
|
|
119
|
+
unf_ext (0.0.7.6)
|
|
120
|
+
unicode-display_width (1.6.1)
|
|
121
|
+
vcr (5.1.0)
|
|
122
|
+
webmock (3.8.3)
|
|
123
|
+
addressable (>= 2.3.6)
|
|
124
|
+
crack (>= 0.3.2)
|
|
125
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
126
|
+
yajl-ruby (1.4.1)
|
|
127
|
+
|
|
128
|
+
PLATFORMS
|
|
129
|
+
ruby
|
|
130
|
+
|
|
131
|
+
DEPENDENCIES
|
|
132
|
+
bump
|
|
133
|
+
bundler (~> 2.0)
|
|
134
|
+
codeclimate-test-reporter (< 1.0.0)
|
|
135
|
+
copyright-header
|
|
136
|
+
fluent-plugin-kubernetes_metadata_filter!
|
|
137
|
+
minitest (~> 4.0)
|
|
138
|
+
rake
|
|
139
|
+
rubocop
|
|
140
|
+
test-unit (~> 3.0.2)
|
|
141
|
+
test-unit-rr (~> 1.0.3)
|
|
142
|
+
vcr
|
|
143
|
+
webmock
|
|
144
|
+
yajl-ruby
|
|
145
|
+
|
|
146
|
+
BUNDLED WITH
|
|
147
|
+
2.1.4
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |gem|
|
|
6
6
|
gem.name = "fluent-plugin-kubernetes_metadata_filter"
|
|
7
|
-
gem.version = "2.4.
|
|
7
|
+
gem.version = "2.4.4"
|
|
8
8
|
gem.authors = ["Jimmi Dyson"]
|
|
9
9
|
gem.email = ["jimmidyson@gmail.com"]
|
|
10
10
|
gem.description = %q{Filter plugin to add Kubernetes metadata}
|
|
@@ -23,7 +23,6 @@ require_relative 'kubernetes_metadata_stats'
|
|
|
23
23
|
require_relative 'kubernetes_metadata_watch_namespaces'
|
|
24
24
|
require_relative 'kubernetes_metadata_watch_pods'
|
|
25
25
|
|
|
26
|
-
require 'fluent/plugin_helper/thread'
|
|
27
26
|
require 'fluent/plugin/filter'
|
|
28
27
|
require 'resolv'
|
|
29
28
|
|
|
@@ -39,8 +38,6 @@ module Fluent::Plugin
|
|
|
39
38
|
|
|
40
39
|
Fluent::Plugin.register_filter('kubernetes_metadata', self)
|
|
41
40
|
|
|
42
|
-
helpers :thread
|
|
43
|
-
|
|
44
41
|
config_param :kubernetes_url, :string, default: nil
|
|
45
42
|
config_param :cache_size, :integer, default: 1000
|
|
46
43
|
config_param :cache_ttl, :integer, default: 60 * 60
|
|
@@ -274,14 +271,10 @@ module Fluent::Plugin
|
|
|
274
271
|
end
|
|
275
272
|
|
|
276
273
|
if @watch
|
|
277
|
-
pod_thread =
|
|
278
|
-
set_up_pod_thread
|
|
279
|
-
end
|
|
274
|
+
pod_thread = Thread.new(self) { |this| this.set_up_pod_thread }
|
|
280
275
|
pod_thread.abort_on_exception = true
|
|
281
276
|
|
|
282
|
-
namespace_thread =
|
|
283
|
-
set_up_namespace_thread
|
|
284
|
-
end
|
|
277
|
+
namespace_thread = Thread.new(self) { |this| this.set_up_namespace_thread }
|
|
285
278
|
namespace_thread.abort_on_exception = true
|
|
286
279
|
end
|
|
287
280
|
end
|
|
@@ -35,7 +35,7 @@ module KubernetesMetadata
|
|
|
35
35
|
# processing will be swallowed and retried. These failures /
|
|
36
36
|
# exceptions could be caused by Kubernetes API being temporarily
|
|
37
37
|
# down. We assume the configuration is correct at this point.
|
|
38
|
-
while
|
|
38
|
+
while true
|
|
39
39
|
begin
|
|
40
40
|
namespace_watcher ||= get_namespaces_and_start_watcher
|
|
41
41
|
process_namespace_watcher_notices(namespace_watcher)
|
|
@@ -29,13 +29,12 @@ module KubernetesMetadata
|
|
|
29
29
|
# the configuration.
|
|
30
30
|
pod_watcher = start_pod_watch
|
|
31
31
|
Thread.current[:pod_watch_retry_backoff_interval] = @watch_retry_interval
|
|
32
|
-
Thread.current[:pod_watch_retry_count] = 0
|
|
33
32
|
|
|
34
33
|
# Any failures / exceptions in the followup watcher notice
|
|
35
34
|
# processing will be swallowed and retried. These failures /
|
|
36
35
|
# exceptions could be caused by Kubernetes API being temporarily
|
|
37
36
|
# down. We assume the configuration is correct at this point.
|
|
38
|
-
while
|
|
37
|
+
while true
|
|
39
38
|
begin
|
|
40
39
|
pod_watcher ||= get_pods_and_start_watcher
|
|
41
40
|
process_pod_watcher_notices(pod_watcher)
|
|
@@ -104,6 +103,7 @@ module KubernetesMetadata
|
|
|
104
103
|
watcher.each do |notice|
|
|
105
104
|
case notice.type
|
|
106
105
|
when 'MODIFIED'
|
|
106
|
+
Thread.current[:pod_watch_retry_count] = 0
|
|
107
107
|
cache_key = notice.object['metadata']['uid']
|
|
108
108
|
cached = @cache[cache_key]
|
|
109
109
|
if cached
|
|
@@ -116,10 +116,12 @@ module KubernetesMetadata
|
|
|
116
116
|
@stats.bump(:pod_cache_watch_misses)
|
|
117
117
|
end
|
|
118
118
|
when 'DELETED'
|
|
119
|
+
Thread.current[:pod_watch_retry_count] = 0
|
|
119
120
|
# ignore and let age out for cases where pods
|
|
120
121
|
# deleted but still processing logs
|
|
121
122
|
@stats.bump(:pod_cache_watch_delete_ignored)
|
|
122
123
|
else
|
|
124
|
+
Thread.current[:pod_watch_retry_count] = 0
|
|
123
125
|
# Don't pay attention to creations, since the created pod may not
|
|
124
126
|
# end up on this node.
|
|
125
127
|
@stats.bump(:pod_cache_watch_ignored)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-kubernetes_metadata_filter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.4.
|
|
4
|
+
version: 2.4.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jimmi Dyson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fluentd
|
|
@@ -208,6 +208,7 @@ files:
|
|
|
208
208
|
- ".circleci/config.yml"
|
|
209
209
|
- ".gitignore"
|
|
210
210
|
- Gemfile
|
|
211
|
+
- Gemfile.lock
|
|
211
212
|
- LICENSE.txt
|
|
212
213
|
- README.md
|
|
213
214
|
- Rakefile
|
|
@@ -258,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
258
259
|
- !ruby/object:Gem::Version
|
|
259
260
|
version: '0'
|
|
260
261
|
requirements: []
|
|
261
|
-
rubygems_version: 3.0.
|
|
262
|
+
rubygems_version: 3.0.8
|
|
262
263
|
signing_key:
|
|
263
264
|
specification_version: 4
|
|
264
265
|
summary: Fluentd filter plugin to add Kubernetes metadata
|