fluent-plugin-google-cloud 0.9.0 → 0.10.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: 2969a92cd254d0b7e3a8fa3fcf891df2ec8cbaa3b94c5d683db3d6c43ee2d11f
4
- data.tar.gz: 78b2418688ff2ac6a939ebf1d19d81e61a40a1cea7793c35c2044ac6969f44ac
3
+ metadata.gz: 04bd17bad7dbead504f9f9e3e78fa36cb4ecf44409e0b6d817b16e8d80498631
4
+ data.tar.gz: 12d9f4b26e4876dbea235043e2fa1bb59707a5f66024c8becfa1f9ed2e037a5b
5
5
  SHA512:
6
- metadata.gz: bd4ccb079e3f1af0d0d9efb8d7165a04dcbfdcb2b21f8471a0b80f5c157b4d4e5a968f63e0c6a7c92f746fd34c2d46319037b883dec6abd301df78771ca201ed
7
- data.tar.gz: bcf8016d3dbbd7fbfb6c2cc1bc2de490e89c61c1a51fe7c91324034fcca2a96d8b55059d197bbbe2ad3acfabfcb632ff3e917c7f54aa3061d36b6f0c2b9f1959
6
+ metadata.gz: 94f7657e972697e89acda8d1a78663561a42e084170aed6cb03a2f606e1706ccce0c721495cd0270a005f1a2aa8bc0c59914fb66ccf9c03c4cd20fd71588b198
7
+ data.tar.gz: 2077ecebdfcf73f02594ab93e8f96bfd4c0dc61bf27b2c9f4768a875ed9419945375423309dadd41630610732f5734218cf8304411edaae79af5c4d6d3e34c03
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-google-cloud (0.9.0)
5
- fluentd (= 1.7.4)
4
+ fluent-plugin-google-cloud (0.10.3)
5
+ fluentd (= 1.11.2)
6
6
  google-api-client (= 0.30.8)
7
7
  google-cloud-logging (= 1.6.6)
8
8
  google-protobuf (= 3.12.2)
9
9
  googleapis-common-protos (= 1.3.9)
10
10
  googleauth (= 0.9.0)
11
- grpc (= 1.30.1)
11
+ grpc (= 1.31.1)
12
12
  json (= 2.2.0)
13
13
  opencensus (= 0.5.0)
14
14
  opencensus-stackdriver (= 0.3.2)
@@ -19,33 +19,36 @@ GEM
19
19
  addressable (2.7.0)
20
20
  public_suffix (>= 2.0.2, < 5.0)
21
21
  ast (2.4.1)
22
- concurrent-ruby (1.1.6)
23
- cool.io (1.6.0)
22
+ concurrent-ruby (1.1.7)
23
+ cool.io (1.7.0)
24
24
  coveralls (0.8.23)
25
25
  json (>= 1.8, < 3)
26
26
  simplecov (~> 0.16.1)
27
27
  term-ansicolor (~> 1.3)
28
28
  thor (>= 0.19.4, < 2.0)
29
29
  tins (~> 1.6)
30
- crack (0.4.3)
31
- safe_yaml (~> 1.0.0)
30
+ crack (0.4.4)
32
31
  declarative (0.0.20)
33
32
  declarative-option (0.1.0)
34
- dig_rb (1.0.1)
35
33
  docile (1.3.2)
36
34
  faraday (0.17.3)
37
35
  multipart-post (>= 1.2, < 3)
38
- fluentd (1.7.4)
36
+ fluentd (1.11.2)
39
37
  cool.io (>= 1.4.5, < 2.0.0)
40
- dig_rb (~> 1.0.0)
41
38
  http_parser.rb (>= 0.5.1, < 0.7.0)
42
- msgpack (>= 1.2.0, < 2.0.0)
39
+ msgpack (>= 1.3.1, < 2.0.0)
43
40
  serverengine (>= 2.0.4, < 3.0.0)
44
41
  sigdump (~> 0.2.2)
45
42
  strptime (>= 0.2.2, < 1.0.0)
46
- tzinfo (~> 2.0)
43
+ tzinfo (>= 1.0, < 3.0)
47
44
  tzinfo-data (~> 1.0)
48
45
  yajl-ruby (~> 1.0)
46
+ gapic-common (0.3.4)
47
+ google-protobuf (~> 3.12, >= 3.12.2)
48
+ googleapis-common-protos (>= 1.3.9, < 2.0)
49
+ googleapis-common-protos-types (>= 1.0.4, < 2.0)
50
+ googleauth (~> 0.9)
51
+ grpc (~> 1.25)
49
52
  google-api-client (0.30.8)
50
53
  addressable (~> 2.5, >= 2.5.1)
51
54
  googleauth (>= 0.5, < 0.10.0)
@@ -70,13 +73,18 @@ GEM
70
73
  google-gax (~> 1.8)
71
74
  googleapis-common-protos (>= 1.3.9, < 2.0)
72
75
  googleapis-common-protos-types (>= 1.0.4, < 2.0)
73
- google-cloud-trace (0.39.0)
76
+ google-cloud-trace (0.40.0)
74
77
  concurrent-ruby (~> 1.1)
75
- google-cloud-core (~> 1.2)
76
- google-gax (~> 1.8)
77
- googleapis-common-protos (>= 1.3.9, < 2.0)
78
- googleapis-common-protos-types (>= 1.0.4, < 2.0)
78
+ google-cloud-core (~> 1.5)
79
+ google-cloud-trace-v1 (~> 0.0)
80
+ google-cloud-trace-v2 (~> 0.0)
79
81
  stackdriver-core (~> 1.3)
82
+ google-cloud-trace-v1 (0.1.2)
83
+ gapic-common (~> 0.3)
84
+ google-cloud-errors (~> 1.0)
85
+ google-cloud-trace-v2 (0.1.2)
86
+ gapic-common (~> 0.3)
87
+ google-cloud-errors (~> 1.0)
80
88
  google-gax (1.8.1)
81
89
  google-protobuf (~> 3.9)
82
90
  googleapis-common-protos (>= 1.3.9, < 2.0)
@@ -97,14 +105,14 @@ GEM
97
105
  multi_json (~> 1.11)
98
106
  os (>= 0.9, < 2.0)
99
107
  signet (~> 0.7)
100
- grpc (1.30.1)
108
+ grpc (1.31.1)
101
109
  google-protobuf (~> 3.12)
102
110
  googleapis-common-protos-types (~> 1.0)
103
111
  hashdiff (1.0.1)
104
112
  http_parser.rb (0.6.0)
105
113
  httpclient (2.8.3)
106
114
  json (2.2.0)
107
- jwt (2.2.1)
115
+ jwt (2.2.2)
108
116
  memoist (0.16.2)
109
117
  metaclass (0.0.4)
110
118
  mini_mime (1.0.2)
@@ -119,14 +127,14 @@ GEM
119
127
  google-cloud-monitoring (~> 0.32)
120
128
  google-cloud-trace (~> 0.35)
121
129
  opencensus (~> 0.5)
122
- os (1.1.0)
123
- parser (2.7.1.4)
130
+ os (1.1.1)
131
+ parser (2.7.1.5)
124
132
  ast (~> 2.4.1)
125
133
  power_assert (1.2.0)
126
134
  powerpack (0.1.2)
127
135
  prometheus-client (0.9.0)
128
136
  quantile (~> 0.2.1)
129
- public_suffix (4.0.5)
137
+ public_suffix (4.0.6)
130
138
  quantile (0.2.1)
131
139
  rainbow (2.2.2)
132
140
  rake
@@ -144,7 +152,6 @@ GEM
144
152
  ruby-progressbar (~> 1.7)
145
153
  unicode-display_width (~> 1.0, >= 1.0.1)
146
154
  ruby-progressbar (1.10.1)
147
- safe_yaml (1.0.5)
148
155
  serverengine (2.2.1)
149
156
  sigdump (~> 0.2.2)
150
157
  sigdump (0.2.4)
@@ -160,7 +167,7 @@ GEM
160
167
  simplecov-html (0.10.2)
161
168
  stackdriver-core (1.4.0)
162
169
  google-cloud-core (~> 1.2)
163
- strptime (0.2.4)
170
+ strptime (0.2.5)
164
171
  sync (0.5.0)
165
172
  term-ansicolor (1.7.1)
166
173
  tins (~> 1.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.9.0'
13
+ gem.version = '0.10.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')
@@ -19,13 +19,13 @@ eos
19
19
  gem.test_files = gem.files.grep(/^(test)/)
20
20
  gem.require_paths = ['lib']
21
21
 
22
- gem.add_runtime_dependency 'fluentd', '1.7.4'
22
+ gem.add_runtime_dependency 'fluentd', '1.11.2'
23
23
  gem.add_runtime_dependency 'googleapis-common-protos', '1.3.9'
24
24
  gem.add_runtime_dependency 'googleauth', '0.9.0'
25
25
  gem.add_runtime_dependency 'google-api-client', '0.30.8'
26
26
  gem.add_runtime_dependency 'google-cloud-logging', '1.6.6'
27
27
  gem.add_runtime_dependency 'google-protobuf', '3.12.2'
28
- gem.add_runtime_dependency 'grpc', '1.30.1'
28
+ gem.add_runtime_dependency 'grpc', '1.31.1'
29
29
  gem.add_runtime_dependency 'json', '2.2.0'
30
30
  gem.add_runtime_dependency 'opencensus', '0.5.0'
31
31
  gem.add_runtime_dependency 'opencensus-stackdriver', '0.3.2'
@@ -15,6 +15,9 @@
15
15
  require 'fileutils'
16
16
  require 'fluent/config'
17
17
  require 'fluent/config/v1_parser'
18
+ require 'googleauth'
19
+ require 'google/apis/logging_v2'
20
+ require 'open-uri'
18
21
  require 'set'
19
22
 
20
23
  require_relative 'common'
@@ -155,8 +158,8 @@ module Fluent
155
158
  super
156
159
  @log = $log # rubocop:disable Style/GlobalVars
157
160
 
158
- # Initialize the insertID.
159
- @log.info 'Started the analyze_config plugin to analyze configuration.'
161
+ @log.info(
162
+ 'analyze_config plugin: Started the plugin to analyze configuration.')
160
163
  end
161
164
 
162
165
  def parse_config(path)
@@ -205,6 +208,7 @@ module Fluent
205
208
 
206
209
  def configure(conf)
207
210
  super
211
+ @log.info('analyze_config plugin: Starting to configure the plugin.')
208
212
  if File.file?(@google_fluentd_config_path) &&
209
213
  File.file?(@google_fluentd_baseline_config_path)
210
214
  @log.info(
@@ -232,24 +236,28 @@ module Fluent
232
236
 
233
237
  unless Monitoring::MonitoringRegistryFactory.supports_monitoring_type(
234
238
  @monitoring_type)
235
- @log.warn "monitoring_type '#{@monitoring_type}' is unknown; "\
236
- 'there will be no metrics'
239
+ @log.warn(
240
+ "analyze_config plugin: monitoring_type #{@monitoring_type} is " \
241
+ 'unknown; there will be no metrics.')
237
242
  end
238
243
  registry = Monitoring::MonitoringRegistryFactory.create(
239
244
  @monitoring_type, project_id, resource, @gcm_service_address)
240
245
 
241
246
  plugin_usage = registry.counter(
242
- :stackdriver_enabled_plugins,
243
- [:plugin_name, :is_default_plugin, :has_default_value],
244
- 'Enabled plugins')
247
+ :enabled_plugins,
248
+ [:plugin_name, :is_default_plugin, :has_default_config],
249
+ 'Enabled plugins',
250
+ 'agent.googleapis.com/agent/internal/logging/config')
245
251
  config_usage = registry.counter(
246
- :stackdriver_config_usage,
247
- [:plugin_name, :param, :is_present, :has_default_value],
248
- 'Parameter usage for Google Cloud plugins')
252
+ :plugin_config,
253
+ [:plugin_name, :param, :is_present, :has_default_config],
254
+ 'Configuration parameter usage for plugins relevant to Google Cloud.',
255
+ 'agent.googleapis.com/agent/internal/logging/config')
249
256
  config_bool_values = registry.counter(
250
- :stackdriver_config_bool_values,
257
+ :config_bool_values,
251
258
  [:plugin_name, :param, :value],
252
- 'Values for bool parameters in Google Cloud plugins')
259
+ 'Values for bool parameters in Google Cloud plugins',
260
+ 'agent.googleapis.com/agent/internal/logging/config')
253
261
 
254
262
  config = parse_config(@google_fluentd_config_path)
255
263
  baseline_config = parse_config(@google_fluentd_baseline_config_path)
@@ -276,17 +284,17 @@ module Fluent
276
284
  plugin_name = default_plugin_name(e)
277
285
  if baseline_elements.key?(plugin_name)
278
286
  is_default_plugin = true
279
- has_default_value = (baseline_elements[plugin_name] == e)
287
+ has_default_config = (baseline_elements[plugin_name] == e)
280
288
  else
281
289
  plugin_name = custom_plugin_name(e)
282
290
  is_default_plugin = false
283
- has_default_value = false
291
+ has_default_config = false
284
292
  end
285
293
  plugin_usage.increment(
286
294
  labels: {
287
295
  plugin_name: plugin_name,
288
296
  is_default_plugin: is_default_plugin,
289
- has_default_value: has_default_value,
297
+ has_default_config: has_default_config,
290
298
  has_ruby_snippet: embedded_ruby?(e)
291
299
  },
292
300
  by: 1)
@@ -300,7 +308,7 @@ module Fluent
300
308
  plugin_name: e['@type'],
301
309
  param: p,
302
310
  is_present: e.key?(p),
303
- has_default_value: (e.key?(p) &&
311
+ has_default_config: (e.key?(p) &&
304
312
  baseline_google_element.key?(p) &&
305
313
  e[p] == baseline_google_element[p])
306
314
  },
@@ -317,17 +325,18 @@ module Fluent
317
325
  end
318
326
  else
319
327
  @log.info(
320
- 'google-fluentd configuration file does not exist at' \
321
- " #{@google_fluentd_config_path} or " \
322
- 'google-fluentd baseline configuration file does not exist at' \
323
- " #{@google_fluentd_baseline_config_path} or " \
324
- '. Skipping configuration analysis.')
328
+ 'analyze_config plugin: google-fluentd configuration file does not ' \
329
+ "exist at #{@google_fluentd_config_path} or google-fluentd " \
330
+ 'baseline configuration file does not exist at' \
331
+ " #{@google_fluentd_baseline_config_path}. Skipping configuration " \
332
+ 'analysis.')
325
333
  end
326
334
  rescue => e
327
335
  # Do not crash the agent due to configuration analysis failures.
328
336
  @log.warn(
329
- 'Failed to optionally analyze the google-fluentd configuration' \
330
- " file. Proceeding anyway. Error: #{e}")
337
+ 'analyze_config plugin: Failed to optionally analyze the ' \
338
+ "google-fluentd configuration file. Proceeding anyway. Error: #{e}. " \
339
+ "Trace: #{e.backtrace}")
331
340
  end
332
341
 
333
342
  def shutdown
@@ -52,7 +52,7 @@ module Monitoring
52
52
  def initialize(_project_id, _monitored_resource, _gcm_service_address)
53
53
  end
54
54
 
55
- def counter(_name, _labels, _docstring)
55
+ def counter(_name, _labels, _docstring, _prefix)
56
56
  BaseCounter.new
57
57
  end
58
58
 
@@ -75,7 +75,7 @@ module Monitoring
75
75
  end
76
76
 
77
77
  # Exception-driven behavior to avoid synchronization errors.
78
- def counter(name, _labels, docstring)
78
+ def counter(name, _labels, docstring, _prefix)
79
79
  # When we upgrade to Prometheus client 0.10.0 or higher, pass the
80
80
  # labels in the metric constructor. The 'labels' field in
81
81
  # Prometheus client 0.9.0 has a different function and will not
@@ -97,21 +97,14 @@ module Monitoring
97
97
  require 'opencensus'
98
98
  require 'opencensus-stackdriver'
99
99
  @log = $log # rubocop:disable Style/GlobalVars
100
- @recorder = OpenCensus::Stats.ensure_recorder
101
- @exporter = OpenCensus::Stats::Exporters::Stackdriver.new(
102
- project_id: project_id,
103
- metric_prefix: 'agent.googleapis.com/agent',
104
- resource_type: monitored_resource.type,
105
- resource_labels: monitored_resource.labels,
106
- gcm_service_address: gcm_service_address
107
- )
108
- OpenCensus.configure do |c|
109
- c.stats.exporter = @exporter
110
- end
111
- @log.debug "OpenCensus config=#{OpenCensus.config}"
100
+ @project_id = project_id
101
+ @metrics_monitored_resource = monitored_resource
102
+ @gcm_service_address = gcm_service_address
103
+ @recorders = {}
104
+ @exporters = {}
112
105
  end
113
106
 
114
- def counter(name, labels, docstring)
107
+ def counter(name, labels, docstring, prefix)
115
108
  translator = MetricTranslator.new(name, labels)
116
109
  measure = OpenCensus::Stats::MeasureRegistry.get(translator.name)
117
110
  if measure.nil?
@@ -121,6 +114,17 @@ module Monitoring
121
114
  description: docstring
122
115
  )
123
116
  end
117
+ unless @exporters.keys.include?(prefix)
118
+ @recorders[prefix] = OpenCensus::Stats.ensure_recorder
119
+ @exporters[prefix] = \
120
+ OpenCensus::Stats::Exporters::Stackdriver.new(
121
+ project_id: @project_id,
122
+ metric_prefix: prefix,
123
+ resource_type: @metrics_monitored_resource.type,
124
+ resource_labels: @metrics_monitored_resource.labels,
125
+ gcm_service_address: @gcm_service_address
126
+ )
127
+ end
124
128
  OpenCensus::Stats.create_and_register_view(
125
129
  name: translator.name,
126
130
  measure: measure,
@@ -128,11 +132,19 @@ module Monitoring
128
132
  description: docstring,
129
133
  columns: translator.view_labels.map(&:to_s)
130
134
  )
131
- OpenCensusCounter.new(@recorder, measure, translator)
135
+ OpenCensusCounter.new(@recorders[prefix], measure, translator)
136
+ rescue StandardError => e
137
+ @log.warn "Failed to count metrics for #{name}.", error: e
138
+ raise e
132
139
  end
133
140
 
134
141
  def export
135
- @exporter.export @recorder.views_data
142
+ @exporters.keys.each do |prefix|
143
+ @exporters[prefix].export @recorders[prefix].views_data
144
+ end
145
+ rescue StandardError => e
146
+ @log.warn 'Failed to export some metrics.', error: e
147
+ raise e
136
148
  end
137
149
  end
138
150
 
@@ -563,32 +563,38 @@ module Fluent
563
563
  # Uptime should be a gauge, but the metric definition is a counter and
564
564
  # we can't change it.
565
565
  @uptime_metric = @registry.counter(
566
- :uptime, [:version], 'Uptime of Logging agent')
566
+ :uptime, [:version], 'Uptime of Logging agent',
567
+ 'agent.googleapis.com/agent')
567
568
  update_uptime
568
569
  timer_execute(:update_uptime, 1) { update_uptime }
569
570
  @successful_requests_count = @registry.counter(
570
571
  :stackdriver_successful_requests_count,
571
572
  [:grpc, :code],
572
- 'A number of successful requests to the Stackdriver Logging API')
573
+ 'A number of successful requests to the Stackdriver Logging API',
574
+ 'agent.googleapis.com/agent')
573
575
  @failed_requests_count = @registry.counter(
574
576
  :stackdriver_failed_requests_count,
575
577
  [:grpc, :code],
576
578
  'A number of failed requests to the Stackdriver Logging '\
577
- 'API, broken down by the error code')
579
+ 'API, broken down by the error code',
580
+ 'agent.googleapis.com/agent')
578
581
  @ingested_entries_count = @registry.counter(
579
582
  :stackdriver_ingested_entries_count,
580
583
  [:grpc, :code],
581
- 'A number of log entries ingested by Stackdriver Logging')
584
+ 'A number of log entries ingested by Stackdriver Logging',
585
+ 'agent.googleapis.com/agent')
582
586
  @dropped_entries_count = @registry.counter(
583
587
  :stackdriver_dropped_entries_count,
584
588
  [:grpc, :code],
585
- 'A number of log entries dropped by the Stackdriver output plugin')
589
+ 'A number of log entries dropped by the Stackdriver output plugin',
590
+ 'agent.googleapis.com/agent')
586
591
  @retried_entries_count = @registry.counter(
587
592
  :stackdriver_retried_entries_count,
588
593
  [:grpc, :code],
589
594
  'The number of log entries that failed to be ingested by '\
590
595
  'the Stackdriver output plugin due to a transient error '\
591
- 'and were retried')
596
+ 'and were retried',
597
+ 'agent.googleapis.com/agent')
592
598
  @ok_code = @use_grpc ? GRPC::Core::StatusCodes::OK : 200
593
599
  end
594
600
 
@@ -169,10 +169,11 @@ module BaseTest
169
169
  assert_true d.instance.instance_variable_get(:@enable_monitoring)
170
170
  registry = d.instance.instance_variable_get(:@registry)
171
171
  assert_not_nil registry
172
- exporter = registry.instance_variable_get(:@exporter)
173
- assert_equal 'custom_resource', exporter.resource_type, "Index #{index}"
172
+ monitored_resource = registry.instance_variable_get(
173
+ :@metrics_monitored_resource)
174
+ assert_equal('custom_resource', monitored_resource.type, "Index #{index}")
174
175
  assert_equal({ 'label1' => '123', 'label2' => 'abc' },
175
- exporter.resource_labels, "Index #{index}")
176
+ monitored_resource.labels, "Index #{index}")
176
177
  end
177
178
  end
178
179
 
@@ -2018,18 +2019,6 @@ module BaseTest
2018
2019
  }
2019
2020
  end
2020
2021
 
2021
- def gke_container_log_entry(log)
2022
- {
2023
- log: log,
2024
- LOCAL_RESOURCE_ID_KEY =>
2025
- "#{CONTAINER_LOCAL_RESOURCE_ID_PREFIX}.#{CONTAINER_NAMESPACE_ID}" \
2026
- ".#{K8S_POD_NAME}.#{K8S_CONTAINER_NAME}"
2027
- }
2028
- end
2029
-
2030
- # TODO(qingling128): Temporary fallback for metadata agent restarts.
2031
- # k8s resources.
2032
-
2033
2022
  def k8s_container_log_entry(log,
2034
2023
  local_resource_id: K8S_LOCAL_RESOURCE_ID)
2035
2024
  {
@@ -55,81 +55,81 @@ class FilterAnalyzeConfigTest < Test::Unit::TestCase
55
55
 
56
56
  # Default plugins, with default config.
57
57
  assert_metric_value.call(
58
- :stackdriver_enabled_plugins,
58
+ :enabled_plugins,
59
59
  1,
60
60
  plugin_name: 'source/syslog/tcp',
61
61
  is_default_plugin: true,
62
- has_default_value: true,
62
+ has_default_config: true,
63
63
  has_ruby_snippet: false)
64
64
  assert_metric_value.call(
65
- :stackdriver_enabled_plugins,
65
+ :enabled_plugins,
66
66
  1,
67
67
  plugin_name: 'source/tail/apache-access',
68
68
  is_default_plugin: true,
69
- has_default_value: true,
69
+ has_default_config: true,
70
70
  has_ruby_snippet: false)
71
71
  assert_metric_value.call(
72
- :stackdriver_enabled_plugins,
72
+ :enabled_plugins,
73
73
  1,
74
74
  plugin_name: 'filter/add_insert_ids',
75
75
  is_default_plugin: true,
76
- has_default_value: true,
76
+ has_default_config: true,
77
77
  has_ruby_snippet: false)
78
78
 
79
79
  # Default plugins, with custom config.
80
80
  assert_metric_value.call(
81
- :stackdriver_enabled_plugins,
81
+ :enabled_plugins,
82
82
  1,
83
83
  plugin_name: 'match/google_cloud',
84
84
  is_default_plugin: true,
85
- has_default_value: false,
85
+ has_default_config: false,
86
86
  has_ruby_snippet: false)
87
87
 
88
88
  # Custom plugins, some with embedded Ruby.
89
89
  assert_metric_value.call(
90
- :stackdriver_enabled_plugins,
90
+ :enabled_plugins,
91
91
  1,
92
92
  plugin_name: 'filter',
93
93
  is_default_plugin: false,
94
- has_default_value: false,
94
+ has_default_config: false,
95
95
  has_ruby_snippet: false)
96
96
  assert_metric_value.call(
97
- :stackdriver_enabled_plugins,
97
+ :enabled_plugins,
98
98
  1,
99
99
  plugin_name: 'filter/record_transformer',
100
100
  is_default_plugin: false,
101
- has_default_value: false,
101
+ has_default_config: false,
102
102
  has_ruby_snippet: true)
103
103
  assert_metric_value.call(
104
- :stackdriver_enabled_plugins,
104
+ :enabled_plugins,
105
105
  1,
106
106
  plugin_name: 'match/stdout',
107
107
  is_default_plugin: false,
108
- has_default_value: false,
108
+ has_default_config: false,
109
109
  has_ruby_snippet: true)
110
110
 
111
111
  # For out_google_cloud, 3 params are present.
112
112
  assert_metric_value.call(
113
- :stackdriver_config_usage,
113
+ :plugin_config,
114
114
  1,
115
115
  plugin_name: 'google_cloud',
116
116
  param: 'adjust_invalid_timestamps',
117
117
  is_present: true,
118
- has_default_value: true)
118
+ has_default_config: true)
119
119
  assert_metric_value.call(
120
- :stackdriver_config_usage,
120
+ :plugin_config,
121
121
  1,
122
122
  plugin_name: 'google_cloud',
123
123
  param: 'autoformat_stackdriver_trace',
124
124
  is_present: true,
125
- has_default_value: false)
125
+ has_default_config: false)
126
126
  assert_metric_value.call(
127
- :stackdriver_config_usage,
127
+ :plugin_config,
128
128
  1,
129
129
  plugin_name: 'google_cloud',
130
130
  param: 'coerce_to_utf8',
131
131
  is_present: true,
132
- has_default_value: false)
132
+ has_default_config: false)
133
133
  # The remaining "google_cloud" params are not present.
134
134
  # The are no params for "detect_exceptions".
135
135
  %w(
@@ -163,29 +163,29 @@ class FilterAnalyzeConfigTest < Test::Unit::TestCase
163
163
  zone
164
164
  ).each do |p|
165
165
  assert_metric_value.call(
166
- :stackdriver_config_usage,
166
+ :plugin_config,
167
167
  1,
168
168
  plugin_name: 'google_cloud',
169
169
  param: p,
170
170
  is_present: false,
171
- has_default_value: false)
171
+ has_default_config: false)
172
172
  end
173
173
 
174
174
  # We also export values for the bools.
175
175
  assert_metric_value.call(
176
- :stackdriver_config_bool_values,
176
+ :config_bool_values,
177
177
  1,
178
178
  plugin_name: 'google_cloud',
179
179
  param: 'adjust_invalid_timestamps',
180
180
  value: true)
181
181
  assert_metric_value.call(
182
- :stackdriver_config_bool_values,
182
+ :config_bool_values,
183
183
  1,
184
184
  plugin_name: 'google_cloud',
185
185
  param: 'autoformat_stackdriver_trace',
186
186
  value: false)
187
187
  assert_metric_value.call(
188
- :stackdriver_config_bool_values,
188
+ :config_bool_values,
189
189
  1,
190
190
  plugin_name: 'google_cloud',
191
191
  param: 'coerce_to_utf8',
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.9.0
4
+ version: 0.10.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: 2020-07-16 00:00:00.000000000 Z
11
+ date: 2020-09-26 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.7.4
19
+ version: 1.11.2
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.7.4
26
+ version: 1.11.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: googleapis-common-protos
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 1.30.1
103
+ version: 1.31.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 1.30.1
110
+ version: 1.31.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: json
113
113
  requirement: !ruby/object:Gem::Requirement