fluent-plugin-google-cloud 0.11.0 → 0.12.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c20fc807b129dacab24357096d9ebf4d79ebeedc8b136494517c6d6f73cb83f1
4
- data.tar.gz: 543297fac8896b6faa6ba1a1d2f40fae6298a420789942d23d6d052959d4570c
3
+ metadata.gz: 83b0e32d32c83f55717d184e69a8bb52a3f838d56a617a0f2d3ec54e7ec97f96
4
+ data.tar.gz: 3afd7c0508415c1c7a97021a793590917c50f2ba0a9e78feb9c5f1a881742cdf
5
5
  SHA512:
6
- metadata.gz: 43be2b63c2c3514beca5303a227d473ffc7b1e999fca4b8f960071c1b952452706d61d4ce2fe88adf0ff27b7f5996efc632514db54da40bb8bc4c065069b5b8e
7
- data.tar.gz: e2ec675fa37b390c90ec86e10f2eb9b402b7a0376fecb670bb451edbf69cc8ea58d0ad79457f33ffd7abda3bb170fc24afaea72c25b87cb24721d13b794f5792
6
+ metadata.gz: 178cbf9ef9050ccd19beaaf9c6849c259c5e5f9e64a7ad6e6068fb24e1a6d1d73e10531124ce69982b4cd8011a3e4ca2abbb711e238615c1757887ba80b771dd
7
+ data.tar.gz: 2cd2b195cce5ca9028ed1f30cfb968b5e9b00b004bce720c7d5939f09105019e87c18b409d8a1a3b7323ee1fbd10b0870b9f9187abaeabd3caaa0a7971bdc9bf
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-google-cloud (0.11.0)
5
- fluentd (= 1.11.2)
4
+ fluent-plugin-google-cloud (0.12.2)
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)
@@ -156,8 +150,8 @@ GEM
156
150
  serverengine (2.2.4)
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)
@@ -177,17 +171,18 @@ GEM
177
171
  thor (1.1.0)
178
172
  tins (1.29.1)
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.0'
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')
@@ -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.0
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-08-02 00:00:00.000000000 Z
11
+ date: 2021-11-08 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