google-cloud-error_reporting-v1beta1 0.11.1 → 0.12.0

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: 8b3a448eec7dca67a2bcdce6d2415163094f98d125426a5dffa893566b662f23
4
- data.tar.gz: d25acf9e8cc7e1d159ffb594c8b820a472ceecd1bfe738764678d5eef2772cd7
3
+ metadata.gz: e0ba9e9797cbf836af91a4d638774703444f5a024d64cae4b795c1019f1b789a
4
+ data.tar.gz: 8e85ae3a0b2ac4cc06cf842a3744138175feeb50116c900c2ffb65d0654d0681
5
5
  SHA512:
6
- metadata.gz: 18bb6d2ec62ccab2fbe17f98e8510713e0c13296378f1995d401060c9e1bb235292c3a2f39a4c9ba3bb20afc17c1889149fb30796a9ea7b8837b7ed2a067a51c
7
- data.tar.gz: ea459892ed5ca26f66842f2d98543ca77f88d3bb7394083b05ea8d2479cff163d8098edd5b2fbaed2529201ab91c28edf5fc2130fb7d7d61f404efe8203cbae7
6
+ metadata.gz: 736fb52f3e6863e492e34e52d44e726785fdea10210b7ba1191c000d2265265032e08fa008b66b75672f9ec09f79a713d973b8e567097207b33573ef820e660d
7
+ data.tar.gz: 79989519b0b8ae70d52d9df244a2477e552ab2043849735dc3f81d926cf146c7714a910b3aebe5ac910224c936fe7afce35590678a24d87e31784a97a9d5c8f0
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/error-reporting)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/error_reporting/v1beta1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -162,8 +162,28 @@ module Google
162
162
  universe_domain: @config.universe_domain,
163
163
  channel_args: @config.channel_args,
164
164
  interceptors: @config.interceptors,
165
- channel_pool_config: @config.channel_pool
165
+ channel_pool_config: @config.channel_pool,
166
+ logger: @config.logger
166
167
  )
168
+
169
+ @error_group_service_stub.stub_logger&.info do |entry|
170
+ entry.set_system_name
171
+ entry.set_service
172
+ entry.message = "Created client for #{entry.service}"
173
+ entry.set_credentials_fields credentials
174
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
175
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
176
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
177
+ end
178
+ end
179
+
180
+ ##
181
+ # The logger used for request/response debug logging.
182
+ #
183
+ # @return [Logger]
184
+ #
185
+ def logger
186
+ @error_group_service_stub.logger
167
187
  end
168
188
 
169
189
  # Service calls
@@ -266,7 +286,6 @@ module Google
266
286
 
267
287
  @error_group_service_stub.call_rpc :get_group, request, options: options do |response, operation|
268
288
  yield response, operation if block_given?
269
- return response
270
289
  end
271
290
  rescue ::GRPC::BadStatus => e
272
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -353,7 +372,6 @@ module Google
353
372
 
354
373
  @error_group_service_stub.call_rpc :update_group, request, options: options do |response, operation|
355
374
  yield response, operation if block_given?
356
- return response
357
375
  end
358
376
  rescue ::GRPC::BadStatus => e
359
377
  raise ::Google::Cloud::Error.from_error(e)
@@ -442,6 +460,11 @@ module Google
442
460
  # default endpoint URL. The default value of nil uses the environment
443
461
  # universe (usually the default "googleapis.com" universe).
444
462
  # @return [::String,nil]
463
+ # @!attribute [rw] logger
464
+ # A custom logger to use for request/response debug logging, or the value
465
+ # `:default` (the default) to construct a default logger, or `nil` to
466
+ # explicitly disable logging.
467
+ # @return [::Logger,:default,nil]
445
468
  #
446
469
  class Configuration
447
470
  extend ::Gapic::Config
@@ -466,6 +489,7 @@ module Google
466
489
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
467
490
  config_attr :quota_project, nil, ::String, nil
468
491
  config_attr :universe_domain, nil, ::String, nil
492
+ config_attr :logger, :default, ::Logger, nil, :default
469
493
 
470
494
  # @private
471
495
  def initialize parent_config = nil
@@ -155,8 +155,28 @@ module Google
155
155
  endpoint: @config.endpoint,
156
156
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
157
  universe_domain: @config.universe_domain,
158
- credentials: credentials
158
+ credentials: credentials,
159
+ logger: @config.logger
159
160
  )
161
+
162
+ @error_group_service_stub.logger(stub: true)&.info do |entry|
163
+ entry.set_system_name
164
+ entry.set_service
165
+ entry.message = "Created client for #{entry.service}"
166
+ entry.set_credentials_fields credentials
167
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
168
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
169
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
170
+ end
171
+ end
172
+
173
+ ##
174
+ # The logger used for request/response debug logging.
175
+ #
176
+ # @return [Logger]
177
+ #
178
+ def logger
179
+ @error_group_service_stub.logger
160
180
  end
161
181
 
162
182
  # Service calls
@@ -252,7 +272,6 @@ module Google
252
272
 
253
273
  @error_group_service_stub.get_group request, options do |result, operation|
254
274
  yield result, operation if block_given?
255
- return result
256
275
  end
257
276
  rescue ::Gapic::Rest::Error => e
258
277
  raise ::Google::Cloud::Error.from_error(e)
@@ -332,7 +351,6 @@ module Google
332
351
 
333
352
  @error_group_service_stub.update_group request, options do |result, operation|
334
353
  yield result, operation if block_given?
335
- return result
336
354
  end
337
355
  rescue ::Gapic::Rest::Error => e
338
356
  raise ::Google::Cloud::Error.from_error(e)
@@ -412,6 +430,11 @@ module Google
412
430
  # default endpoint URL. The default value of nil uses the environment
413
431
  # universe (usually the default "googleapis.com" universe).
414
432
  # @return [::String,nil]
433
+ # @!attribute [rw] logger
434
+ # A custom logger to use for request/response debug logging, or the value
435
+ # `:default` (the default) to construct a default logger, or `nil` to
436
+ # explicitly disable logging.
437
+ # @return [::Logger,:default,nil]
415
438
  #
416
439
  class Configuration
417
440
  extend ::Gapic::Config
@@ -433,6 +456,7 @@ module Google
433
456
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
434
457
  config_attr :quota_project, nil, ::String, nil
435
458
  config_attr :universe_domain, nil, ::String, nil
459
+ config_attr :logger, :default, ::Logger, nil, :default
436
460
 
437
461
  # @private
438
462
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the get_group REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "get_group",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "update_group",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroup.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,8 +163,28 @@ module Google
163
163
  universe_domain: @config.universe_domain,
164
164
  channel_args: @config.channel_args,
165
165
  interceptors: @config.interceptors,
166
- channel_pool_config: @config.channel_pool
166
+ channel_pool_config: @config.channel_pool,
167
+ logger: @config.logger
167
168
  )
169
+
170
+ @error_stats_service_stub.stub_logger&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+ end
180
+
181
+ ##
182
+ # The logger used for request/response debug logging.
183
+ #
184
+ # @return [Logger]
185
+ #
186
+ def logger
187
+ @error_stats_service_stub.logger
168
188
  end
169
189
 
170
190
  # Service calls
@@ -319,7 +339,7 @@ module Google
319
339
  @error_stats_service_stub.call_rpc :list_group_stats, request, options: options do |response, operation|
320
340
  response = ::Gapic::PagedEnumerable.new @error_stats_service_stub, :list_group_stats, request, response, operation, options
321
341
  yield response, operation if block_given?
322
- return response
342
+ throw :response, response
323
343
  end
324
344
  rescue ::GRPC::BadStatus => e
325
345
  raise ::Google::Cloud::Error.from_error(e)
@@ -440,7 +460,7 @@ module Google
440
460
  @error_stats_service_stub.call_rpc :list_events, request, options: options do |response, operation|
441
461
  response = ::Gapic::PagedEnumerable.new @error_stats_service_stub, :list_events, request, response, operation, options
442
462
  yield response, operation if block_given?
443
- return response
463
+ throw :response, response
444
464
  end
445
465
  rescue ::GRPC::BadStatus => e
446
466
  raise ::Google::Cloud::Error.from_error(e)
@@ -537,7 +557,6 @@ module Google
537
557
 
538
558
  @error_stats_service_stub.call_rpc :delete_events, request, options: options do |response, operation|
539
559
  yield response, operation if block_given?
540
- return response
541
560
  end
542
561
  rescue ::GRPC::BadStatus => e
543
562
  raise ::Google::Cloud::Error.from_error(e)
@@ -626,6 +645,11 @@ module Google
626
645
  # default endpoint URL. The default value of nil uses the environment
627
646
  # universe (usually the default "googleapis.com" universe).
628
647
  # @return [::String,nil]
648
+ # @!attribute [rw] logger
649
+ # A custom logger to use for request/response debug logging, or the value
650
+ # `:default` (the default) to construct a default logger, or `nil` to
651
+ # explicitly disable logging.
652
+ # @return [::Logger,:default,nil]
629
653
  #
630
654
  class Configuration
631
655
  extend ::Gapic::Config
@@ -650,6 +674,7 @@ module Google
650
674
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
651
675
  config_attr :quota_project, nil, ::String, nil
652
676
  config_attr :universe_domain, nil, ::String, nil
677
+ config_attr :logger, :default, ::Logger, nil, :default
653
678
 
654
679
  # @private
655
680
  def initialize parent_config = nil
@@ -156,8 +156,28 @@ module Google
156
156
  endpoint: @config.endpoint,
157
157
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
158
  universe_domain: @config.universe_domain,
159
- credentials: credentials
159
+ credentials: credentials,
160
+ logger: @config.logger
160
161
  )
162
+
163
+ @error_stats_service_stub.logger(stub: true)&.info do |entry|
164
+ entry.set_system_name
165
+ entry.set_service
166
+ entry.message = "Created client for #{entry.service}"
167
+ entry.set_credentials_fields credentials
168
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
169
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
170
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
171
+ end
172
+ end
173
+
174
+ ##
175
+ # The logger used for request/response debug logging.
176
+ #
177
+ # @return [Logger]
178
+ #
179
+ def logger
180
+ @error_stats_service_stub.logger
161
181
  end
162
182
 
163
183
  # Service calls
@@ -305,7 +325,7 @@ module Google
305
325
  @error_stats_service_stub.list_group_stats request, options do |result, operation|
306
326
  result = ::Gapic::Rest::PagedEnumerable.new @error_stats_service_stub, :list_group_stats, "error_group_stats", request, result, options
307
327
  yield result, operation if block_given?
308
- return result
328
+ throw :response, result
309
329
  end
310
330
  rescue ::Gapic::Rest::Error => e
311
331
  raise ::Google::Cloud::Error.from_error(e)
@@ -419,7 +439,7 @@ module Google
419
439
  @error_stats_service_stub.list_events request, options do |result, operation|
420
440
  result = ::Gapic::Rest::PagedEnumerable.new @error_stats_service_stub, :list_events, "error_events", request, result, options
421
441
  yield result, operation if block_given?
422
- return result
442
+ throw :response, result
423
443
  end
424
444
  rescue ::Gapic::Rest::Error => e
425
445
  raise ::Google::Cloud::Error.from_error(e)
@@ -509,7 +529,6 @@ module Google
509
529
 
510
530
  @error_stats_service_stub.delete_events request, options do |result, operation|
511
531
  yield result, operation if block_given?
512
- return result
513
532
  end
514
533
  rescue ::Gapic::Rest::Error => e
515
534
  raise ::Google::Cloud::Error.from_error(e)
@@ -589,6 +608,11 @@ module Google
589
608
  # default endpoint URL. The default value of nil uses the environment
590
609
  # universe (usually the default "googleapis.com" universe).
591
610
  # @return [::String,nil]
611
+ # @!attribute [rw] logger
612
+ # A custom logger to use for request/response debug logging, or the value
613
+ # `:default` (the default) to construct a default logger, or `nil` to
614
+ # explicitly disable logging.
615
+ # @return [::Logger,:default,nil]
592
616
  #
593
617
  class Configuration
594
618
  extend ::Gapic::Config
@@ -610,6 +634,7 @@ module Google
610
634
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
611
635
  config_attr :quota_project, nil, ::String, nil
612
636
  config_attr :universe_domain, nil, ::String, nil
637
+ config_attr :logger, :default, ::Logger, nil, :default
613
638
 
614
639
  # @private
615
640
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the list_group_stats REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_group_stats",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "list_events",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::ErrorReporting::V1beta1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "delete_events",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -159,8 +159,28 @@ module Google
159
159
  universe_domain: @config.universe_domain,
160
160
  channel_args: @config.channel_args,
161
161
  interceptors: @config.interceptors,
162
- channel_pool_config: @config.channel_pool
162
+ channel_pool_config: @config.channel_pool,
163
+ logger: @config.logger
163
164
  )
165
+
166
+ @report_errors_service_stub.stub_logger&.info do |entry|
167
+ entry.set_system_name
168
+ entry.set_service
169
+ entry.message = "Created client for #{entry.service}"
170
+ entry.set_credentials_fields credentials
171
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
172
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
173
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
174
+ end
175
+ end
176
+
177
+ ##
178
+ # The logger used for request/response debug logging.
179
+ #
180
+ # @return [Logger]
181
+ #
182
+ def logger
183
+ @report_errors_service_stub.logger
164
184
  end
165
185
 
166
186
  # Service calls
@@ -271,7 +291,6 @@ module Google
271
291
 
272
292
  @report_errors_service_stub.call_rpc :report_error_event, request, options: options do |response, operation|
273
293
  yield response, operation if block_given?
274
- return response
275
294
  end
276
295
  rescue ::GRPC::BadStatus => e
277
296
  raise ::Google::Cloud::Error.from_error(e)
@@ -360,6 +379,11 @@ module Google
360
379
  # default endpoint URL. The default value of nil uses the environment
361
380
  # universe (usually the default "googleapis.com" universe).
362
381
  # @return [::String,nil]
382
+ # @!attribute [rw] logger
383
+ # A custom logger to use for request/response debug logging, or the value
384
+ # `:default` (the default) to construct a default logger, or `nil` to
385
+ # explicitly disable logging.
386
+ # @return [::Logger,:default,nil]
363
387
  #
364
388
  class Configuration
365
389
  extend ::Gapic::Config
@@ -384,6 +408,7 @@ module Google
384
408
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
385
409
  config_attr :quota_project, nil, ::String, nil
386
410
  config_attr :universe_domain, nil, ::String, nil
411
+ config_attr :logger, :default, ::Logger, nil, :default
387
412
 
388
413
  # @private
389
414
  def initialize parent_config = nil
@@ -152,8 +152,28 @@ module Google
152
152
  endpoint: @config.endpoint,
153
153
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
154
  universe_domain: @config.universe_domain,
155
- credentials: credentials
155
+ credentials: credentials,
156
+ logger: @config.logger
156
157
  )
158
+
159
+ @report_errors_service_stub.logger(stub: true)&.info do |entry|
160
+ entry.set_system_name
161
+ entry.set_service
162
+ entry.message = "Created client for #{entry.service}"
163
+ entry.set_credentials_fields credentials
164
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
165
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
166
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
167
+ end
168
+ end
169
+
170
+ ##
171
+ # The logger used for request/response debug logging.
172
+ #
173
+ # @return [Logger]
174
+ #
175
+ def logger
176
+ @report_errors_service_stub.logger
157
177
  end
158
178
 
159
179
  # Service calls
@@ -257,7 +277,6 @@ module Google
257
277
 
258
278
  @report_errors_service_stub.report_error_event request, options do |result, operation|
259
279
  yield result, operation if block_given?
260
- return result
261
280
  end
262
281
  rescue ::Gapic::Rest::Error => e
263
282
  raise ::Google::Cloud::Error.from_error(e)
@@ -337,6 +356,11 @@ module Google
337
356
  # default endpoint URL. The default value of nil uses the environment
338
357
  # universe (usually the default "googleapis.com" universe).
339
358
  # @return [::String,nil]
359
+ # @!attribute [rw] logger
360
+ # A custom logger to use for request/response debug logging, or the value
361
+ # `:default` (the default) to construct a default logger, or `nil` to
362
+ # explicitly disable logging.
363
+ # @return [::Logger,:default,nil]
340
364
  #
341
365
  class Configuration
342
366
  extend ::Gapic::Config
@@ -358,6 +382,7 @@ module Google
358
382
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
359
383
  config_attr :quota_project, nil, ::String, nil
360
384
  config_attr :universe_domain, nil, ::String, nil
385
+ config_attr :logger, :default, ::Logger, nil, :default
361
386
 
362
387
  # @private
363
388
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the report_error_event REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "report_error_event",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module ErrorReporting
23
23
  module V1beta1
24
- VERSION = "0.11.1"
24
+ VERSION = "0.12.0"
25
25
  end
26
26
  end
27
27
  end
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
217
  # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-error_reporting-v1beta1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-30 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.1
19
+ version: 0.24.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.21.1
29
+ version: 0.24.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.5.6
123
+ rubygems_version: 3.5.23
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Groups and counts similar errors from cloud services and applications, reports