fluent-plugin-google-cloud 0.12.0 → 0.12.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +25 -33
- data/fluent-plugin-google-cloud.gemspec +2 -2
- data/lib/fluent/plugin/filter_analyze_config.rb +11 -4
- data/lib/fluent/plugin/monitoring.rb +18 -0
- 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: e4d396b2b1d9ebcaa42857446c3ce8cbb1895f578aceab740f4fe173b573719f
|
4
|
+
data.tar.gz: f3ee3da95df939bfda464c12e710db0aa70011474d6903db0a2ce129fbfa4fdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a59d79f2b66c5d8a2519d92af503f96b8d6a83b950f207df8193dbe1da76a07ad7aa9f3d8edc2c310a4fe471888e204c09eaf2b4887449e0212768aa6453c7d2
|
7
|
+
data.tar.gz: 4aff0ebc64728253e289005c1bd36db97310d01dc676477ac21922185c59cebac1338df2050715c493cae8fef90fac21c3b109a26e15da00666afd405f5fda65
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-google-cloud (0.12.
|
4
|
+
fluent-plugin-google-cloud (0.12.4)
|
5
5
|
fluentd (= 1.13.3)
|
6
6
|
google-api-client (= 0.30.8)
|
7
7
|
google-cloud-logging (= 1.6.6)
|
@@ -11,7 +11,7 @@ PATH
|
|
11
11
|
grpc (= 1.31.1)
|
12
12
|
json (= 2.2.0)
|
13
13
|
opencensus (= 0.5.0)
|
14
|
-
opencensus-stackdriver (= 0.
|
14
|
+
opencensus-stackdriver (= 0.4.1)
|
15
15
|
|
16
16
|
GEM
|
17
17
|
remote: https://rubygems.org/
|
@@ -64,32 +64,23 @@ GEM
|
|
64
64
|
google-cloud-errors (~> 1.0)
|
65
65
|
google-cloud-env (1.5.0)
|
66
66
|
faraday (>= 0.17.3, < 2.0)
|
67
|
-
google-cloud-errors (1.
|
67
|
+
google-cloud-errors (1.2.0)
|
68
68
|
google-cloud-logging (1.6.6)
|
69
69
|
concurrent-ruby (~> 1.1)
|
70
70
|
google-cloud-core (~> 1.2)
|
71
71
|
google-gax (~> 1.7)
|
72
72
|
googleapis-common-protos-types (>= 1.0.2)
|
73
73
|
stackdriver-core (~> 1.3)
|
74
|
-
google-cloud-monitoring (0.
|
75
|
-
google-gax (~> 1.8)
|
76
|
-
googleapis-common-protos (>= 1.3.9, < 2.0)
|
77
|
-
googleapis-common-protos-types (>= 1.0.4, < 2.0)
|
78
|
-
google-cloud-trace (0.41.3)
|
79
|
-
concurrent-ruby (~> 1.1)
|
80
|
-
google-cloud-core (~> 1.5)
|
81
|
-
google-cloud-trace-v1 (~> 0.0)
|
82
|
-
google-cloud-trace-v2 (~> 0.0)
|
83
|
-
stackdriver-core (~> 1.3)
|
84
|
-
google-cloud-trace-v1 (0.3.0)
|
74
|
+
google-cloud-monitoring-v3 (0.3.0)
|
85
75
|
gapic-common (~> 0.3)
|
86
76
|
google-cloud-errors (~> 1.0)
|
87
77
|
google-cloud-trace-v2 (0.3.0)
|
88
78
|
gapic-common (~> 0.3)
|
89
79
|
google-cloud-errors (~> 1.0)
|
90
|
-
google-gax (1.8.
|
80
|
+
google-gax (1.8.2)
|
91
81
|
google-protobuf (~> 3.9)
|
92
82
|
googleapis-common-protos (>= 1.3.9, < 2.0)
|
83
|
+
googleapis-common-protos-types (>= 1.0.4, < 2.0)
|
93
84
|
googleauth (~> 0.9)
|
94
85
|
grpc (~> 1.24)
|
95
86
|
rly (~> 0.2.3)
|
@@ -98,7 +89,7 @@ GEM
|
|
98
89
|
google-protobuf (~> 3.11)
|
99
90
|
googleapis-common-protos-types (>= 1.0.5, < 2.0)
|
100
91
|
grpc (~> 1.27)
|
101
|
-
googleapis-common-protos-types (1.
|
92
|
+
googleapis-common-protos-types (1.3.0)
|
102
93
|
google-protobuf (~> 3.14)
|
103
94
|
googleauth (0.9.0)
|
104
95
|
faraday (~> 0.12)
|
@@ -114,25 +105,26 @@ GEM
|
|
114
105
|
http_parser.rb (0.7.0)
|
115
106
|
httpclient (2.8.3)
|
116
107
|
json (2.2.0)
|
117
|
-
jwt (2.
|
108
|
+
jwt (2.3.0)
|
118
109
|
memoist (0.16.2)
|
119
110
|
metaclass (0.0.4)
|
120
|
-
mini_mime (1.1.
|
111
|
+
mini_mime (1.1.2)
|
121
112
|
mocha (1.9.0)
|
122
113
|
metaclass (~> 0.0.1)
|
123
|
-
msgpack (1.4.
|
114
|
+
msgpack (1.4.4)
|
124
115
|
multi_json (1.15.0)
|
125
116
|
multipart-post (2.1.1)
|
126
117
|
opencensus (0.5.0)
|
127
|
-
opencensus-stackdriver (0.
|
118
|
+
opencensus-stackdriver (0.4.1)
|
128
119
|
concurrent-ruby (~> 1.0)
|
129
|
-
google-cloud-
|
130
|
-
google-cloud-
|
120
|
+
google-cloud-env (~> 1.3)
|
121
|
+
google-cloud-monitoring-v3 (~> 0.1)
|
122
|
+
google-cloud-trace-v2 (~> 0.1)
|
131
123
|
opencensus (~> 0.5)
|
132
|
-
os (1.1.
|
124
|
+
os (1.1.4)
|
133
125
|
parser (2.7.2.0)
|
134
126
|
ast (~> 2.4.1)
|
135
|
-
power_assert (2.0.
|
127
|
+
power_assert (2.0.1)
|
136
128
|
powerpack (0.1.3)
|
137
129
|
prometheus-client (0.9.0)
|
138
130
|
quantile (~> 0.2.1)
|
@@ -155,11 +147,11 @@ GEM
|
|
155
147
|
ruby-progressbar (~> 1.7)
|
156
148
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
157
149
|
ruby-progressbar (1.11.0)
|
158
|
-
serverengine (2.2.
|
150
|
+
serverengine (2.2.5)
|
159
151
|
sigdump (~> 0.2.2)
|
160
152
|
sigdump (0.2.4)
|
161
|
-
signet (0.
|
162
|
-
addressable (~> 2.
|
153
|
+
signet (0.16.0)
|
154
|
+
addressable (~> 2.8)
|
163
155
|
faraday (>= 0.17.3, < 2.0)
|
164
156
|
jwt (>= 1.5, < 3.0)
|
165
157
|
multi_json (~> 1.10)
|
@@ -176,16 +168,16 @@ GEM
|
|
176
168
|
tins (~> 1.0)
|
177
169
|
test-unit (3.3.3)
|
178
170
|
power_assert
|
179
|
-
thor (1.1
|
180
|
-
tins (1.
|
171
|
+
thor (1.2.1)
|
172
|
+
tins (1.31.0)
|
181
173
|
sync
|
182
|
-
trailblazer-option (0.1.
|
174
|
+
trailblazer-option (0.1.2)
|
183
175
|
tzinfo (2.0.4)
|
184
176
|
concurrent-ruby (~> 1.0)
|
185
|
-
tzinfo-data (1.2021.
|
177
|
+
tzinfo-data (1.2021.5)
|
186
178
|
tzinfo (>= 1.0.0)
|
187
179
|
uber (0.1.0)
|
188
|
-
unicode-display_width (1.
|
180
|
+
unicode-display_width (1.8.0)
|
189
181
|
webmock (3.6.2)
|
190
182
|
addressable (>= 2.3.6)
|
191
183
|
crack (>= 0.3.2)
|
@@ -207,4 +199,4 @@ DEPENDENCIES
|
|
207
199
|
webmock (= 3.6.2)
|
208
200
|
|
209
201
|
BUNDLED WITH
|
210
|
-
2.2.
|
202
|
+
2.2.28
|
@@ -10,7 +10,7 @@ eos
|
|
10
10
|
gem.homepage =
|
11
11
|
'https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud'
|
12
12
|
gem.license = 'Apache-2.0'
|
13
|
-
gem.version = '0.12.
|
13
|
+
gem.version = '0.12.4'
|
14
14
|
gem.authors = ['Stackdriver Agents Team']
|
15
15
|
gem.email = ['stackdriver-agents@google.com']
|
16
16
|
gem.required_ruby_version = Gem::Requirement.new('>= 2.2')
|
@@ -31,7 +31,7 @@ eos
|
|
31
31
|
gem.add_runtime_dependency 'grpc', '1.31.1'
|
32
32
|
gem.add_runtime_dependency 'json', '2.2.0'
|
33
33
|
gem.add_runtime_dependency 'opencensus', '0.5.0'
|
34
|
-
gem.add_runtime_dependency 'opencensus-stackdriver', '0.
|
34
|
+
gem.add_runtime_dependency 'opencensus-stackdriver', '0.4.1'
|
35
35
|
|
36
36
|
gem.add_development_dependency 'mocha', '1.9.0'
|
37
37
|
# Keep this the same as in
|
@@ -38,6 +38,8 @@ module Fluent
|
|
38
38
|
helpers :timer
|
39
39
|
|
40
40
|
module Constants
|
41
|
+
PREFIX = 'agent.googleapis.com/agent/internal/logging/config'.freeze
|
42
|
+
|
41
43
|
# Built-in plugins that are ok to reference in metrics.
|
42
44
|
KNOWN_PLUGINS = {
|
43
45
|
'filter' => Set[
|
@@ -249,7 +251,12 @@ module Fluent
|
|
249
251
|
@registry = Monitoring::MonitoringRegistryFactory.create(
|
250
252
|
@monitoring_type, project_id, resource, @gcm_service_address)
|
251
253
|
# Export metrics every 60 seconds.
|
252
|
-
timer_execute(:export_config_analysis_metrics, 60)
|
254
|
+
timer_execute(:export_config_analysis_metrics, 60) do
|
255
|
+
if @registry.respond_to? :update_timestamps
|
256
|
+
@registry.update_timestamps(PREFIX)
|
257
|
+
end
|
258
|
+
@registry.export
|
259
|
+
end
|
253
260
|
|
254
261
|
@log.info('analyze_config plugin: Registering counters.')
|
255
262
|
enabled_plugins_counter = @registry.counter(
|
@@ -257,7 +264,7 @@ module Fluent
|
|
257
264
|
[:plugin_name, :is_default_plugin,
|
258
265
|
:has_default_config, :has_ruby_snippet],
|
259
266
|
'Enabled plugins',
|
260
|
-
|
267
|
+
PREFIX,
|
261
268
|
'GAUGE')
|
262
269
|
@log.info(
|
263
270
|
'analyze_config plugin: registered enable_plugins counter. ' \
|
@@ -266,7 +273,7 @@ module Fluent
|
|
266
273
|
:plugin_config,
|
267
274
|
[:plugin_name, :param, :is_present, :has_default_config],
|
268
275
|
'Configuration parameter usage for plugins relevant to Google Cloud.',
|
269
|
-
|
276
|
+
PREFIX,
|
270
277
|
'GAUGE')
|
271
278
|
@log.info('analyze_config plugin: registered plugin_config counter. ' \
|
272
279
|
"#{plugin_config_counter}")
|
@@ -274,7 +281,7 @@ module Fluent
|
|
274
281
|
:config_bool_values,
|
275
282
|
[:plugin_name, :param, :value],
|
276
283
|
'Values for bool parameters in Google Cloud plugins',
|
277
|
-
|
284
|
+
PREFIX,
|
278
285
|
'GAUGE')
|
279
286
|
@log.info('analyze_config plugin: registered config_bool_values ' \
|
280
287
|
"counter. #{config_bool_values_counter}")
|
@@ -161,6 +161,24 @@ module Monitoring
|
|
161
161
|
raise e
|
162
162
|
end
|
163
163
|
|
164
|
+
# Update timestamps for each existing AggregationData without altering tags
|
165
|
+
# or values.
|
166
|
+
# This is currently only used for config analysis metrics, because we want
|
167
|
+
# to repeatedly send the exact same metrics as created at start-up.
|
168
|
+
def update_timestamps(prefix)
|
169
|
+
new_time = Time.now.utc
|
170
|
+
recorder = @recorders[prefix]
|
171
|
+
recorder.views_data.each do |view_data|
|
172
|
+
view_data.data.each_value do |aggr_data|
|
173
|
+
# Apply this only to GAUGE metrics. This could fail if the metric uses
|
174
|
+
# Distribution or other fancier aggregators.
|
175
|
+
if aggr_data.is_a? OpenCensus::Stats::AggregationData::LastValue
|
176
|
+
aggr_data.add aggr_data.value, new_time
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
164
182
|
def export
|
165
183
|
@log.debug(
|
166
184
|
"monitoring module: Exporting metrics for #{@exporters.keys}.")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-google-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stackdriver Agents Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.4.1
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.4.1
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: mocha
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|