fluent-plugin-google-cloud 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -20
- 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: 83b0e32d32c83f55717d184e69a8bb52a3f838d56a617a0f2d3ec54e7ec97f96
|
4
|
+
data.tar.gz: 3afd7c0508415c1c7a97021a793590917c50f2ba0a9e78feb9c5f1a881742cdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 178cbf9ef9050ccd19beaaf9c6849c259c5e5f9e64a7ad6e6068fb24e1a6d1d73e10531124ce69982b4cd8011a3e4ca2abbb711e238615c1757887ba80b771dd
|
7
|
+
data.tar.gz: 2cd2b195cce5ca9028ed1f30cfb968b5e9b00b004bce720c7d5939f09105019e87c18b409d8a1a3b7323ee1fbd10b0870b9f9187abaeabd3caaa0a7971bdc9bf
|
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.2)
|
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/
|
@@ -71,17 +71,7 @@ GEM
|
|
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)
|
@@ -99,7 +89,7 @@ GEM
|
|
99
89
|
google-protobuf (~> 3.11)
|
100
90
|
googleapis-common-protos-types (>= 1.0.5, < 2.0)
|
101
91
|
grpc (~> 1.27)
|
102
|
-
googleapis-common-protos-types (1.
|
92
|
+
googleapis-common-protos-types (1.3.0)
|
103
93
|
google-protobuf (~> 3.14)
|
104
94
|
googleauth (0.9.0)
|
105
95
|
faraday (~> 0.12)
|
@@ -125,12 +115,13 @@ GEM
|
|
125
115
|
multi_json (1.15.0)
|
126
116
|
multipart-post (2.1.1)
|
127
117
|
opencensus (0.5.0)
|
128
|
-
opencensus-stackdriver (0.
|
118
|
+
opencensus-stackdriver (0.4.1)
|
129
119
|
concurrent-ruby (~> 1.0)
|
130
|
-
google-cloud-
|
131
|
-
google-cloud-
|
120
|
+
google-cloud-env (~> 1.3)
|
121
|
+
google-cloud-monitoring-v3 (~> 0.1)
|
122
|
+
google-cloud-trace-v2 (~> 0.1)
|
132
123
|
opencensus (~> 0.5)
|
133
|
-
os (1.1.
|
124
|
+
os (1.1.4)
|
134
125
|
parser (2.7.2.0)
|
135
126
|
ast (~> 2.4.1)
|
136
127
|
power_assert (2.0.1)
|
@@ -180,10 +171,10 @@ GEM
|
|
180
171
|
thor (1.1.0)
|
181
172
|
tins (1.29.1)
|
182
173
|
sync
|
183
|
-
trailblazer-option (0.1.
|
174
|
+
trailblazer-option (0.1.2)
|
184
175
|
tzinfo (2.0.4)
|
185
176
|
concurrent-ruby (~> 1.0)
|
186
|
-
tzinfo-data (1.2021.
|
177
|
+
tzinfo-data (1.2021.5)
|
187
178
|
tzinfo (>= 1.0.0)
|
188
179
|
uber (0.1.0)
|
189
180
|
unicode-display_width (1.8.0)
|
@@ -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.2'
|
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.2
|
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: 2021-
|
11
|
+
date: 2021-11-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
|