fluent-plugin-google-cloud 0.11.1 → 0.12.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b9fa15008ba95629e400325cd7dd40583d02edb0ca3b172ab7605aba31c45b1
4
- data.tar.gz: f5bc83aa57a237289d2f61792ed9493647e5c74d19ff8038a9ecce2ccce43c4b
3
+ metadata.gz: 1f81ac1b8d10df6dab98b196f5992f136f18cd136fb53d023bb50d4d80a54d5b
4
+ data.tar.gz: 371256727bba42012e6c247ffb43e76c29571dc8e2ef37487d184c8543c28fb2
5
5
  SHA512:
6
- metadata.gz: 6fe3254288d5e240f7a0356cf103aaf96a6044ffeb32fa5c5df8ad9ed777e1eeef3763191fcdde211885ea278e17154e0c37be1b0cc4f2cf51c9e6524ceeb5b9
7
- data.tar.gz: 2a3713fb2c3abea2ae477580c3f53b3f6adeebe628936e310965518925e67081615cce48eac51db2cc7ade1e51f82fe800f0eaa2f1c913ae120f48bab5faf9af
6
+ metadata.gz: a2e3d8d5f87cf12adc5c459bd209e488261fb11395e51db8709beab05cff3f533838b6ce02a1b7dabec5bc087b3ee2c8a29b2c286e331fcd124b651cc0c70e3a
7
+ data.tar.gz: baa38cf26e993d4df5b76e18220091a382397c9ba7a1015ebbf3bacba6855c6da70e19795c7e0746d32e4019f6ec500822b10c41efc203400d68cf18bd642fb3
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-google-cloud (0.11.1)
5
- fluentd (= 1.11.2)
4
+ fluent-plugin-google-cloud (0.12.3)
5
+ fluentd (= 1.13.3)
6
6
  google-api-client (= 0.30.8)
7
7
  google-cloud-logging (= 1.6.6)
8
8
  google-protobuf (= 3.15.8)
@@ -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.3.2)
14
+ opencensus-stackdriver (= 0.4.1)
15
15
 
16
16
  GEM
17
17
  remote: https://rubygems.org/
@@ -33,15 +33,17 @@ GEM
33
33
  docile (1.4.0)
34
34
  faraday (0.17.4)
35
35
  multipart-post (>= 1.2, < 3)
36
- fluentd (1.11.2)
36
+ fluentd (1.13.3)
37
+ bundler
37
38
  cool.io (>= 1.4.5, < 2.0.0)
38
- http_parser.rb (>= 0.5.1, < 0.7.0)
39
+ http_parser.rb (>= 0.5.1, < 0.8.0)
39
40
  msgpack (>= 1.3.1, < 2.0.0)
40
- serverengine (>= 2.0.4, < 3.0.0)
41
+ serverengine (>= 2.2.2, < 3.0.0)
41
42
  sigdump (~> 0.2.2)
42
43
  strptime (>= 0.2.2, < 1.0.0)
43
44
  tzinfo (>= 1.0, < 3.0)
44
45
  tzinfo-data (~> 1.0)
46
+ webrick (>= 1.4.2, < 1.8.0)
45
47
  yajl-ruby (~> 1.0)
46
48
  gapic-common (0.3.4)
47
49
  google-protobuf (~> 3.12, >= 3.12.2)
@@ -62,32 +64,23 @@ GEM
62
64
  google-cloud-errors (~> 1.0)
63
65
  google-cloud-env (1.5.0)
64
66
  faraday (>= 0.17.3, < 2.0)
65
- google-cloud-errors (1.1.0)
67
+ google-cloud-errors (1.2.0)
66
68
  google-cloud-logging (1.6.6)
67
69
  concurrent-ruby (~> 1.1)
68
70
  google-cloud-core (~> 1.2)
69
71
  google-gax (~> 1.7)
70
72
  googleapis-common-protos-types (>= 1.0.2)
71
73
  stackdriver-core (~> 1.3)
72
- google-cloud-monitoring (0.38.0)
73
- google-gax (~> 1.8)
74
- googleapis-common-protos (>= 1.3.9, < 2.0)
75
- googleapis-common-protos-types (>= 1.0.4, < 2.0)
76
- google-cloud-trace (0.41.3)
77
- concurrent-ruby (~> 1.1)
78
- google-cloud-core (~> 1.5)
79
- google-cloud-trace-v1 (~> 0.0)
80
- google-cloud-trace-v2 (~> 0.0)
81
- stackdriver-core (~> 1.3)
82
- google-cloud-trace-v1 (0.3.0)
74
+ google-cloud-monitoring-v3 (0.3.0)
83
75
  gapic-common (~> 0.3)
84
76
  google-cloud-errors (~> 1.0)
85
77
  google-cloud-trace-v2 (0.3.0)
86
78
  gapic-common (~> 0.3)
87
79
  google-cloud-errors (~> 1.0)
88
- google-gax (1.8.1)
80
+ google-gax (1.8.2)
89
81
  google-protobuf (~> 3.9)
90
82
  googleapis-common-protos (>= 1.3.9, < 2.0)
83
+ googleapis-common-protos-types (>= 1.0.4, < 2.0)
91
84
  googleauth (~> 0.9)
92
85
  grpc (~> 1.24)
93
86
  rly (~> 0.2.3)
@@ -96,7 +89,7 @@ GEM
96
89
  google-protobuf (~> 3.11)
97
90
  googleapis-common-protos-types (>= 1.0.5, < 2.0)
98
91
  grpc (~> 1.27)
99
- googleapis-common-protos-types (1.1.0)
92
+ googleapis-common-protos-types (1.3.0)
100
93
  google-protobuf (~> 3.14)
101
94
  googleauth (0.9.0)
102
95
  faraday (~> 0.12)
@@ -109,28 +102,29 @@ GEM
109
102
  google-protobuf (~> 3.12)
110
103
  googleapis-common-protos-types (~> 1.0)
111
104
  hashdiff (1.0.1)
112
- http_parser.rb (0.6.0)
105
+ http_parser.rb (0.7.0)
113
106
  httpclient (2.8.3)
114
107
  json (2.2.0)
115
- jwt (2.2.3)
108
+ jwt (2.3.0)
116
109
  memoist (0.16.2)
117
110
  metaclass (0.0.4)
118
- mini_mime (1.1.0)
111
+ mini_mime (1.1.2)
119
112
  mocha (1.9.0)
120
113
  metaclass (~> 0.0.1)
121
114
  msgpack (1.4.2)
122
115
  multi_json (1.15.0)
123
116
  multipart-post (2.1.1)
124
117
  opencensus (0.5.0)
125
- opencensus-stackdriver (0.3.2)
118
+ opencensus-stackdriver (0.4.1)
126
119
  concurrent-ruby (~> 1.0)
127
- google-cloud-monitoring (~> 0.32)
128
- google-cloud-trace (~> 0.35)
120
+ google-cloud-env (~> 1.3)
121
+ google-cloud-monitoring-v3 (~> 0.1)
122
+ google-cloud-trace-v2 (~> 0.1)
129
123
  opencensus (~> 0.5)
130
- os (1.1.1)
124
+ os (1.1.4)
131
125
  parser (2.7.2.0)
132
126
  ast (~> 2.4.1)
133
- power_assert (2.0.0)
127
+ power_assert (2.0.1)
134
128
  powerpack (0.1.3)
135
129
  prometheus-client (0.9.0)
136
130
  quantile (~> 0.2.1)
@@ -153,11 +147,11 @@ GEM
153
147
  ruby-progressbar (~> 1.7)
154
148
  unicode-display_width (~> 1.0, >= 1.0.1)
155
149
  ruby-progressbar (1.11.0)
156
- serverengine (2.2.4)
150
+ serverengine (2.2.5)
157
151
  sigdump (~> 0.2.2)
158
152
  sigdump (0.2.4)
159
- signet (0.15.0)
160
- addressable (~> 2.3)
153
+ signet (0.16.0)
154
+ addressable (~> 2.8)
161
155
  faraday (>= 0.17.3, < 2.0)
162
156
  jwt (>= 1.5, < 3.0)
163
157
  multi_json (~> 1.10)
@@ -174,20 +168,21 @@ GEM
174
168
  tins (~> 1.0)
175
169
  test-unit (3.3.3)
176
170
  power_assert
177
- thor (1.1.0)
178
- tins (1.29.1)
171
+ thor (1.2.1)
172
+ tins (1.31.0)
179
173
  sync
180
- trailblazer-option (0.1.1)
174
+ trailblazer-option (0.1.2)
181
175
  tzinfo (2.0.4)
182
176
  concurrent-ruby (~> 1.0)
183
- tzinfo-data (1.2021.1)
177
+ tzinfo-data (1.2021.5)
184
178
  tzinfo (>= 1.0.0)
185
179
  uber (0.1.0)
186
- unicode-display_width (1.7.0)
180
+ unicode-display_width (1.8.0)
187
181
  webmock (3.6.2)
188
182
  addressable (>= 2.3.6)
189
183
  crack (>= 0.3.2)
190
184
  hashdiff (>= 0.4.0, < 2.0.0)
185
+ webrick (1.7.0)
191
186
  yajl-ruby (1.4.1)
192
187
 
193
188
  PLATFORMS
@@ -204,4 +199,4 @@ DEPENDENCIES
204
199
  webmock (= 3.6.2)
205
200
 
206
201
  BUNDLED WITH
207
- 2.2.23
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.11.1'
13
+ gem.version = '0.12.3'
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')
@@ -22,7 +22,7 @@ eos
22
22
  # Note: In order to update the Fluentd version, please update both here and
23
23
  # also the fluentd version in
24
24
  # https://github.com/GoogleCloudPlatform/google-fluentd/blob/master/config/software/fluentd.rb.
25
- gem.add_runtime_dependency 'fluentd', '1.11.2'
25
+ gem.add_runtime_dependency 'fluentd', '1.13.3'
26
26
  gem.add_runtime_dependency 'googleapis-common-protos', '1.3.10'
27
27
  gem.add_runtime_dependency 'googleauth', '0.9.0'
28
28
  gem.add_runtime_dependency 'google-api-client', '0.30.8'
@@ -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.3.2'
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) { @registry.export }
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
- 'agent.googleapis.com/agent/internal/logging/config',
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
- 'agent.googleapis.com/agent/internal/logging/config',
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
- 'agent.googleapis.com/agent/internal/logging/config',
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.11.1
4
+ version: 0.12.3
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-08-10 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.11.2
19
+ version: 1.13.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.11.2
26
+ version: 1.13.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: googleapis-common-protos
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.3.2
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.3.2
152
+ version: 0.4.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: mocha
155
155
  requirement: !ruby/object:Gem::Requirement