google-cloud-trace-v2 0.3.0 → 0.3.4

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: b6864c9407d59ab77bd6e12afa32e436d06e8d3996e327ecc716837f0ba64faa
4
- data.tar.gz: 8d6379ce949eaee4f8578c698e9a4898d09a7d5049d0f4f56fa92fa921a3c89c
3
+ metadata.gz: 224234399270f0ca8d189395f5e36fed65eccf9ab7cfea542780bc737652a152
4
+ data.tar.gz: 86b28088af0d023f61ace48c765cf92cb4516abbdaf06b6ec561862543bd2b46
5
5
  SHA512:
6
- metadata.gz: 786a3640ac4b4ec0d350cb5ddaab450a7613a03ea5066658cf47e4f4fae35694740c008b3c7652b0c3d7d8c6535ef8a11e6a5415548814e004b6c24069e7b105
7
- data.tar.gz: ecfaa554aa5c8490a163a6b2064fec2beedb8f2e1c38b3731bb7de25d1e3334a853fe455eec076c225b44f7ec4a0ae42ab0a9dc0ae465fac2393e9a45ce5f836
6
+ metadata.gz: 42efcdbc937b225e674bc52b899ea4666be905f5ce0eea5e13e233de5b8a15761c4aa1b0d4d818b6742ca66822373d4f527de62ee4deca0fd9a82d121e6d7c7d
7
+ data.tar.gz: 3d6d4b5c21fdda089a92ce63d60b7ca3c7428989deefabc609a37ced651a465c0e68bbbb9d12639aa31ab037735f195c5b83297f10d638b121c967061f646a4b
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-trace-v2
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Trace::V2::TraceService::Credentials}):
68
68
 
69
- 1. `TRACE_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `TRACE_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `TRACE_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `TRACE_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/trace/v2"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Trace::V2::TraceService::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/trace/v2"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/trace/v2"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/trace/v2"
34
34
 
35
35
  client = ::Google::Cloud::Trace::V2::TraceService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new # (request fields as keyword arguments...)
37
37
  response = client.batch_write_spans request
38
38
  ```
39
39
 
@@ -45,13 +45,12 @@ module Google
45
45
  # See {::Google::Cloud::Trace::V2::TraceService::Client::Configuration}
46
46
  # for a description of the configuration fields.
47
47
  #
48
- # ## Example
48
+ # @example
49
49
  #
50
- # To modify the configuration for all TraceService clients:
51
- #
52
- # ::Google::Cloud::Trace::V2::TraceService::Client.configure do |config|
53
- # config.timeout = 10.0
54
- # end
50
+ # # Modify the configuration for all TraceService clients
51
+ # ::Google::Cloud::Trace::V2::TraceService::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
55
54
  #
56
55
  # @yield [config] Configure the Client client.
57
56
  # @yieldparam config [Client::Configuration]
@@ -73,10 +72,7 @@ module Google
73
72
 
74
73
  default_config.rpcs.create_span.timeout = 120.0
75
74
  default_config.rpcs.create_span.retry_policy = {
76
- initial_delay: 0.1,
77
- max_delay: 1.0,
78
- multiplier: 1.2,
79
- retry_codes: [14, 4]
75
+ initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4]
80
76
  }
81
77
 
82
78
  default_config
@@ -108,19 +104,15 @@ module Google
108
104
  ##
109
105
  # Create a new TraceService client object.
110
106
  #
111
- # ## Examples
112
- #
113
- # To create a new TraceService client with the default
114
- # configuration:
115
- #
116
- # client = ::Google::Cloud::Trace::V2::TraceService::Client.new
107
+ # @example
117
108
  #
118
- # To create a new TraceService client with a custom
119
- # configuration:
109
+ # # Create a client using the default configuration
110
+ # client = ::Google::Cloud::Trace::V2::TraceService::Client.new
120
111
  #
121
- # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config|
122
- # config.timeout = 10.0
123
- # end
112
+ # # Create a client using a custom configuration
113
+ # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config|
114
+ # config.timeout = 10.0
115
+ # end
124
116
  #
125
117
  # @yield [config] Configure the TraceService client.
126
118
  # @yieldparam config [Client::Configuration]
@@ -140,14 +132,13 @@ module Google
140
132
 
141
133
  # Create credentials
142
134
  credentials = @config.credentials
143
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
135
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
136
  # but only if the default endpoint does not have a region prefix.
145
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
146
- @config.endpoint == Client.configure.endpoint &&
137
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
147
138
  !@config.endpoint.split(".").first.include?("-")
148
139
  credentials ||= Credentials.default scope: @config.scope,
149
140
  enable_self_signed_jwt: enable_self_signed_jwt
150
- if credentials.is_a?(String) || credentials.is_a?(Hash)
141
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
142
  credentials = Credentials.new credentials, scope: @config.scope
152
143
  end
153
144
  @quota_project_id = @config.quota_project
@@ -198,6 +189,21 @@ module Google
198
189
  #
199
190
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
200
191
  #
192
+ # @example Basic example
193
+ # require "google/cloud/trace/v2"
194
+ #
195
+ # # Create a client object. The client can be reused for multiple calls.
196
+ # client = Google::Cloud::Trace::V2::TraceService::Client.new
197
+ #
198
+ # # Create a request. To set request fields, pass in keyword arguments.
199
+ # request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new
200
+ #
201
+ # # Call the batch_write_spans method.
202
+ # result = client.batch_write_spans request
203
+ #
204
+ # # The returned object is of type Google::Protobuf::Empty.
205
+ # p result
206
+ #
201
207
  def batch_write_spans request, options = nil
202
208
  raise ::ArgumentError, "request must be provided" if request.nil?
203
209
 
@@ -215,16 +221,20 @@ module Google
215
221
  gapic_version: ::Google::Cloud::Trace::V2::VERSION
216
222
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
217
223
 
218
- header_params = {
219
- "name" => request.name
220
- }
224
+ header_params = {}
225
+ if request.name
226
+ header_params["name"] = request.name
227
+ end
228
+
221
229
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
222
230
  metadata[:"x-goog-request-params"] ||= request_params_header
223
231
 
224
232
  options.apply_defaults timeout: @config.rpcs.batch_write_spans.timeout,
225
233
  metadata: metadata,
226
234
  retry_policy: @config.rpcs.batch_write_spans.retry_policy
227
- options.apply_defaults metadata: @config.metadata,
235
+
236
+ options.apply_defaults timeout: @config.timeout,
237
+ metadata: @config.metadata,
228
238
  retry_policy: @config.retry_policy
229
239
 
230
240
  @trace_service_stub.call_rpc :batch_write_spans, request, options: options do |response, operation|
@@ -317,6 +327,21 @@ module Google
317
327
  #
318
328
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
319
329
  #
330
+ # @example Basic example
331
+ # require "google/cloud/trace/v2"
332
+ #
333
+ # # Create a client object. The client can be reused for multiple calls.
334
+ # client = Google::Cloud::Trace::V2::TraceService::Client.new
335
+ #
336
+ # # Create a request. To set request fields, pass in keyword arguments.
337
+ # request = Google::Cloud::Trace::V2::Span.new
338
+ #
339
+ # # Call the create_span method.
340
+ # result = client.create_span request
341
+ #
342
+ # # The returned object is of type Google::Cloud::Trace::V2::Span.
343
+ # p result
344
+ #
320
345
  def create_span request, options = nil
321
346
  raise ::ArgumentError, "request must be provided" if request.nil?
322
347
 
@@ -334,16 +359,20 @@ module Google
334
359
  gapic_version: ::Google::Cloud::Trace::V2::VERSION
335
360
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
336
361
 
337
- header_params = {
338
- "name" => request.name
339
- }
362
+ header_params = {}
363
+ if request.name
364
+ header_params["name"] = request.name
365
+ end
366
+
340
367
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
341
368
  metadata[:"x-goog-request-params"] ||= request_params_header
342
369
 
343
370
  options.apply_defaults timeout: @config.rpcs.create_span.timeout,
344
371
  metadata: metadata,
345
372
  retry_policy: @config.rpcs.create_span.retry_policy
346
- options.apply_defaults metadata: @config.metadata,
373
+
374
+ options.apply_defaults timeout: @config.timeout,
375
+ metadata: @config.metadata,
347
376
  retry_policy: @config.retry_policy
348
377
 
349
378
  @trace_service_stub.call_rpc :create_span, request, options: options do |response, operation|
@@ -367,22 +396,21 @@ module Google
367
396
  # Configuration can be applied globally to all clients, or to a single client
368
397
  # on construction.
369
398
  #
370
- # # Examples
371
- #
372
- # To modify the global config, setting the timeout for batch_write_spans
373
- # to 20 seconds, and all remaining timeouts to 10 seconds:
374
- #
375
- # ::Google::Cloud::Trace::V2::TraceService::Client.configure do |config|
376
- # config.timeout = 10.0
377
- # config.rpcs.batch_write_spans.timeout = 20.0
378
- # end
379
- #
380
- # To apply the above configuration only to a new client:
381
- #
382
- # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config|
383
- # config.timeout = 10.0
384
- # config.rpcs.batch_write_spans.timeout = 20.0
385
- # end
399
+ # @example
400
+ #
401
+ # # Modify the global config, setting the timeout for
402
+ # # batch_write_spans to 20 seconds,
403
+ # # and all remaining timeouts to 10 seconds.
404
+ # ::Google::Cloud::Trace::V2::TraceService::Client.configure do |config|
405
+ # config.timeout = 10.0
406
+ # config.rpcs.batch_write_spans.timeout = 20.0
407
+ # end
408
+ #
409
+ # # Apply the above configuration only to a new client.
410
+ # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config|
411
+ # config.timeout = 10.0
412
+ # config.rpcs.batch_write_spans.timeout = 20.0
413
+ # end
386
414
  #
387
415
  # @!attribute [rw] endpoint
388
416
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Trace
23
23
  module V2
24
- VERSION = "0.3.0"
24
+ VERSION = "0.3.4"
25
25
  end
26
26
  end
27
27
  end
@@ -1,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/devtools/cloudtrace/v2/trace.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/field_behavior_pb'
7
5
  require 'google/api/resource_pb'
8
6
  require 'google/protobuf/timestamp_pb'
9
7
  require 'google/protobuf/wrappers_pb'
10
8
  require 'google/rpc/status_pb'
11
9
  require 'google/api/annotations_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/devtools/cloudtrace/v2/trace.proto", :syntax => :proto3) do
14
14
  add_message "google.devtools.cloudtrace.v2.Span" do
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/devtools/cloudtrace/v2/tracing.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -10,6 +8,8 @@ require 'google/api/resource_pb'
10
8
  require 'google/devtools/cloudtrace/v2/trace_pb'
11
9
  require 'google/protobuf/empty_pb'
12
10
  require 'google/protobuf/timestamp_pb'
11
+ require 'google/protobuf'
12
+
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_file("google/devtools/cloudtrace/v2/tracing.proto", :syntax => :proto3) do
15
15
  add_message "google.devtools.cloudtrace.v2.BatchWriteSpansRequest" do
@@ -31,7 +31,7 @@ module Google
31
31
  # contain span(s) from multiple services.
32
32
  class Service
33
33
 
34
- include GRPC::GenericService
34
+ include ::GRPC::GenericService
35
35
 
36
36
  self.marshal_class_method = :encode
37
37
  self.unmarshal_class_method = :decode
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-trace-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-09 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: gapic-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.7'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.3'
22
+ version: 2.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.7'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.3'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -205,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
211
  - !ruby/object:Gem::Version
206
212
  version: '0'
207
213
  requirements: []
208
- rubygems_version: 3.2.13
214
+ rubygems_version: 3.2.17
209
215
  signing_key:
210
216
  specification_version: 4
211
217
  summary: API Client library for the Cloud Trace V2 API