google-cloud-trace 0.37.1 → 0.39.0

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: fb504eda6827a2043808556ae16548e74e495428bd812e03978dcce06395458a
4
- data.tar.gz: 451e718b271274eb29e194dbcb0de641834f67e7d41d424cacecbe48de885b6f
3
+ metadata.gz: 0f15f8177b7c46712bfa65de95e962f1d33ee86e7772af0252fa0f992f842095
4
+ data.tar.gz: d2eef2c11e859c11a73a573a95a10f9b755d230770b9c91f5ed758ddbefdb3b5
5
5
  SHA512:
6
- metadata.gz: bb1bef8801444f3cda27c7a3882ec5efb10ddc7cb0ce5981278a710f505bc96b6c5808d6f4e7f6f4c3607fb2f2b04f9846a55495791862f618687e6d68b5c0e5
7
- data.tar.gz: 715289c04a4e7450c42c9d050688477272d690bd622c97a45c0e94b5d6c2bfac4294b20d43b15363fddd4791034572ba00dc3c81e2236d768ec52aca52e048a8
6
+ metadata.gz: 921009ab5e7b4c391fc663d5f2e9c81c5122b4101d53f13664a89bdae60ac2cf115f684d6fe6950df36ad5d77d688ab74c45adf2c818e0740d5f145ba61269cf
7
+ data.tar.gz: c4536a16227854be8b0dbb8cc42b3741cbe3e52729bdb27b85e7dc032e224fd03ac95d1d9b6fe0594d61443bea50e3a8a8c3b9319bc18597c3a3e33ec361a42b
@@ -1,5 +1,35 @@
1
1
  # Release History
2
2
 
3
+ ### 0.39.0 / 2020-07-07
4
+
5
+ #### Features
6
+
7
+ * Added support for span kind in the low-level V2 API
8
+
9
+ ### 0.38.3 / 2020-05-28
10
+
11
+ #### Documentation
12
+
13
+ * Fix a few broken links
14
+
15
+ ### 0.38.2 / 2020-05-19
16
+
17
+ #### Bug Fixes
18
+
19
+ * Adjusted some default timeout and retry settings
20
+
21
+ ### 0.38.1 / 2020-05-08
22
+
23
+ #### Bug Fixes
24
+
25
+ * Add service_address and service_port to v2 factory method
26
+
27
+ ### 0.38.0 / 2020-03-11
28
+
29
+ #### Features
30
+
31
+ * Support separate project setting for quota/billing
32
+
3
33
  ### 0.37.1 / 2020-01-23
4
34
 
5
35
  #### Documentation
@@ -24,14 +24,8 @@ improved, *please* create a new issue on GitHub so we can talk about it.
24
24
 
25
25
  - [New issue][gh-ruby]
26
26
 
27
- Or, you can ask questions on the [Google Cloud Platform Slack][slack-ruby]. You
28
- can use the "ruby" channel for general Ruby questions, or use the
29
- "google-cloud-ruby" channel if you have questions about this gem in particular.
30
-
31
27
  [so-ruby]: http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby+trace
32
28
 
33
- [gh-search-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues?q=label%3A%22api%3A+trace%22
34
-
35
- [gh-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues/new
29
+ [gh-search-ruby]: https://github.com/googleapis/google-cloud-ruby/issues?q=label%3A%22api%3A+trace%22
36
30
 
37
- [slack-ruby]: https://gcp-slack.appspot.com/
31
+ [gh-ruby]: https://github.com/googleapis/google-cloud-ruby/issues/new
@@ -151,6 +151,9 @@ module Google
151
151
  google_api_client.freeze
152
152
 
153
153
  headers = { :"x-goog-api-client" => google_api_client }
154
+ if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
155
+ headers[:"x-goog-user-project"] = credentials.quota_project_id
156
+ end
154
157
  headers.merge!(metadata) unless metadata.nil?
155
158
  client_config_file = Pathname.new(__dir__).join(
156
159
  "trace_service_client_config.json"
@@ -183,6 +186,14 @@ module Google
183
186
  &Google::Devtools::Cloudtrace::V1::TraceService::Stub.method(:new)
184
187
  )
185
188
 
189
+ @patch_traces = Google::Gax.create_api_call(
190
+ @trace_service_stub.method(:patch_traces),
191
+ defaults["patch_traces"],
192
+ exception_transformer: exception_transformer,
193
+ params_extractor: proc do |request|
194
+ {'project_id' => request.project_id}
195
+ end
196
+ )
186
197
  @list_traces = Google::Gax.create_api_call(
187
198
  @trace_service_stub.method(:list_traces),
188
199
  defaults["list_traces"],
@@ -196,18 +207,55 @@ module Google
196
207
  defaults["get_trace"],
197
208
  exception_transformer: exception_transformer
198
209
  )
199
- @patch_traces = Google::Gax.create_api_call(
200
- @trace_service_stub.method(:patch_traces),
201
- defaults["patch_traces"],
202
- exception_transformer: exception_transformer,
203
- params_extractor: proc do |request|
204
- {'project_id' => request.project_id}
205
- end
206
- )
207
210
  end
208
211
 
209
212
  # Service calls
210
213
 
214
+ # Sends new traces to Stackdriver Trace or updates existing traces. If the ID
215
+ # of a trace that you send matches that of an existing trace, any fields
216
+ # in the existing trace and its spans are overwritten by the provided values,
217
+ # and any new fields provided are merged with the existing trace data. If the
218
+ # ID does not match, a new trace is created.
219
+ #
220
+ # @param project_id [String]
221
+ # Required. ID of the Cloud project where the trace data is stored.
222
+ # @param traces [Google::Devtools::Cloudtrace::V1::Traces | Hash]
223
+ # Required. The body of the message.
224
+ # A hash of the same form as `Google::Devtools::Cloudtrace::V1::Traces`
225
+ # can also be provided.
226
+ # @param options [Google::Gax::CallOptions]
227
+ # Overrides the default settings for this call, e.g, timeout,
228
+ # retries, etc.
229
+ # @yield [result, operation] Access the result along with the RPC operation
230
+ # @yieldparam result []
231
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
232
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
233
+ # @example
234
+ # require "google/cloud/trace"
235
+ #
236
+ # trace_client = Google::Cloud::Trace.new(version: :v1)
237
+ #
238
+ # # TODO: Initialize `project_id`:
239
+ # project_id = ''
240
+ #
241
+ # # TODO: Initialize `traces`:
242
+ # traces = {}
243
+ # trace_client.patch_traces(project_id, traces)
244
+
245
+ def patch_traces \
246
+ project_id,
247
+ traces,
248
+ options: nil,
249
+ &block
250
+ req = {
251
+ project_id: project_id,
252
+ traces: traces
253
+ }.delete_if { |_, v| v.nil? }
254
+ req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::PatchTracesRequest)
255
+ @patch_traces.call(req, options, &block)
256
+ nil
257
+ end
258
+
211
259
  # Returns of a list of traces that match the specified filter conditions.
212
260
  #
213
261
  # @param project_id [String]
@@ -370,51 +418,6 @@ module Google
370
418
  req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::GetTraceRequest)
371
419
  @get_trace.call(req, options, &block)
372
420
  end
373
-
374
- # Sends new traces to Stackdriver Trace or updates existing traces. If the ID
375
- # of a trace that you send matches that of an existing trace, any fields
376
- # in the existing trace and its spans are overwritten by the provided values,
377
- # and any new fields provided are merged with the existing trace data. If the
378
- # ID does not match, a new trace is created.
379
- #
380
- # @param project_id [String]
381
- # Required. ID of the Cloud project where the trace data is stored.
382
- # @param traces [Google::Devtools::Cloudtrace::V1::Traces | Hash]
383
- # Required. The body of the message.
384
- # A hash of the same form as `Google::Devtools::Cloudtrace::V1::Traces`
385
- # can also be provided.
386
- # @param options [Google::Gax::CallOptions]
387
- # Overrides the default settings for this call, e.g, timeout,
388
- # retries, etc.
389
- # @yield [result, operation] Access the result along with the RPC operation
390
- # @yieldparam result []
391
- # @yieldparam operation [GRPC::ActiveCall::Operation]
392
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
393
- # @example
394
- # require "google/cloud/trace"
395
- #
396
- # trace_client = Google::Cloud::Trace.new(version: :v1)
397
- #
398
- # # TODO: Initialize `project_id`:
399
- # project_id = ''
400
- #
401
- # # TODO: Initialize `traces`:
402
- # traces = {}
403
- # trace_client.patch_traces(project_id, traces)
404
-
405
- def patch_traces \
406
- project_id,
407
- traces,
408
- options: nil,
409
- &block
410
- req = {
411
- project_id: project_id,
412
- traces: traces
413
- }.delete_if { |_, v| v.nil? }
414
- req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::PatchTracesRequest)
415
- @patch_traces.call(req, options, &block)
416
- nil
417
- end
418
421
  end
419
422
  end
420
423
  end
@@ -11,28 +11,28 @@
11
11
  "retry_params": {
12
12
  "default": {
13
13
  "initial_retry_delay_millis": 100,
14
- "retry_delay_multiplier": 1.3,
15
- "max_retry_delay_millis": 60000,
14
+ "retry_delay_multiplier": 1.2,
15
+ "max_retry_delay_millis": 1000,
16
16
  "initial_rpc_timeout_millis": 20000,
17
- "rpc_timeout_multiplier": 1.0,
18
- "max_rpc_timeout_millis": 20000,
19
- "total_timeout_millis": 600000
17
+ "rpc_timeout_multiplier": 1.5,
18
+ "max_rpc_timeout_millis": 30000,
19
+ "total_timeout_millis": 45000
20
20
  }
21
21
  },
22
22
  "methods": {
23
- "ListTraces": {
23
+ "PatchTraces": {
24
24
  "timeout_millis": 60000,
25
25
  "retry_codes_name": "idempotent",
26
26
  "retry_params_name": "default"
27
27
  },
28
- "GetTrace": {
28
+ "ListTraces": {
29
29
  "timeout_millis": 60000,
30
30
  "retry_codes_name": "idempotent",
31
31
  "retry_params_name": "default"
32
32
  },
33
- "PatchTraces": {
33
+ "GetTrace": {
34
34
  "timeout_millis": 60000,
35
- "retry_codes_name": "non_idempotent",
35
+ "retry_codes_name": "idempotent",
36
36
  "retry_params_name": "default"
37
37
  }
38
38
  }
@@ -20,7 +20,7 @@ module Google
20
20
  # rubocop:disable LineLength
21
21
 
22
22
  ##
23
- # # Ruby Client for Stackdriver Trace API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
23
+ # # Ruby Client for Stackdriver Trace API
24
24
  #
25
25
  # [Stackdriver Trace API][Product Documentation]:
26
26
  # Sends application trace data to Stackdriver Trace for viewing. Trace data is
@@ -92,13 +92,19 @@ module Google
92
92
  # or the specified config is missing data points.
93
93
  # @param timeout [Numeric]
94
94
  # The default timeout, in seconds, for calls made through this client.
95
+ # @param service_address [String]
96
+ # Override for the service hostname, or `nil` to leave as the default.
97
+ # @param service_port [Integer]
98
+ # Override for the service port, or `nil` to leave as the default.
95
99
  def self.new \
96
100
  credentials: nil,
97
101
  scopes: nil,
98
102
  client_config: nil,
99
103
  timeout: nil,
100
104
  lib_name: nil,
101
- lib_version: nil
105
+ lib_version: nil,
106
+ service_address: nil,
107
+ service_port: nil
102
108
  kwargs = {
103
109
  credentials: credentials,
104
110
  scopes: scopes,
@@ -25,7 +25,7 @@ module Google
25
25
  # gaps or overlaps between spans in a trace.
26
26
  # @!attribute [rw] name
27
27
  # @return [String]
28
- # The resource name of the span in the following format:
28
+ # Required. The resource name of the span in the following format:
29
29
  #
30
30
  # projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
31
31
  #
@@ -36,14 +36,14 @@ module Google
36
36
  # is a 16-character hexadecimal encoding of an 8-byte array.
37
37
  # @!attribute [rw] span_id
38
38
  # @return [String]
39
- # The [SPAN_ID] portion of the span's resource name.
39
+ # Required. The [SPAN_ID] portion of the span's resource name.
40
40
  # @!attribute [rw] parent_span_id
41
41
  # @return [String]
42
42
  # The [SPAN_ID] of this span's parent span. If this is a root span,
43
43
  # then this field must be empty.
44
44
  # @!attribute [rw] display_name
45
45
  # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
46
- # A description of the span's operation (up to 128 bytes).
46
+ # Required. A description of the span's operation (up to 128 bytes).
47
47
  # Stackdriver Trace displays the description in the
48
48
  # Google Cloud Platform Console.
49
49
  # For example, the display name can be a qualified method name or a file name
@@ -52,12 +52,12 @@ module Google
52
52
  # This makes it easier to correlate spans in different traces.
53
53
  # @!attribute [rw] start_time
54
54
  # @return [Google::Protobuf::Timestamp]
55
- # The start time of the span. On the client side, this is the time kept by
55
+ # Required. The start time of the span. On the client side, this is the time kept by
56
56
  # the local machine where the span execution starts. On the server side, this
57
57
  # is the time when the server's application handler starts running.
58
58
  # @!attribute [rw] end_time
59
59
  # @return [Google::Protobuf::Timestamp]
60
- # The end time of the span. On the client side, this is the time kept by
60
+ # Required. The end time of the span. On the client side, this is the time kept by
61
61
  # the local machine where the span execution ends. On the server side, this
62
62
  # is the time when the server application handler stops running.
63
63
  # @!attribute [rw] attributes
@@ -87,6 +87,11 @@ module Google
87
87
  # @return [Google::Protobuf::Int32Value]
88
88
  # Optional. The number of child spans that were generated while this span
89
89
  # was active. If set, allows implementation to detect missing child spans.
90
+ # @!attribute [rw] span_kind
91
+ # @return [Google::Devtools::Cloudtrace::V2::Span::SpanKind]
92
+ # Optional. Distinguishes between spans generated in a particular context. For example,
93
+ # two spans with the same name may be distinguished using `CLIENT` (caller)
94
+ # and `SERVER` (callee) to identify an RPC call.
90
95
  class Span
91
96
  # A set of attributes, each in the format `[KEY]:[VALUE]`.
92
97
  # @!attribute [rw] attribute_map
@@ -95,10 +100,9 @@ module Google
95
100
  # long. The value can be a string up to 256 bytes, a signed 64-bit integer,
96
101
  # or the Boolean values `true` and `false`. For example:
97
102
  #
98
- # "/instance_id": "my-instance"
99
- # "/http/user_agent": ""
100
- # "/http/request_bytes": 300
101
- # "abc.com/myattribute": true
103
+ # "/instance_id": { "string_value": { "value": "my-instance" } }
104
+ # "/http/request_bytes": { "int_value": 300 }
105
+ # "abc.com/myattribute": { "bool_value": false }
102
106
  # @!attribute [rw] dropped_attributes_count
103
107
  # @return [Integer]
104
108
  # The number of attributes that were discarded. Attributes can be discarded
@@ -218,6 +222,37 @@ module Google
218
222
  # The number of dropped links after the maximum size was enforced. If
219
223
  # this value is 0, then no links were dropped.
220
224
  class Links; end
225
+
226
+ # Type of span. Can be used to specify additional relationships between spans
227
+ # in addition to a parent/child relationship.
228
+ module SpanKind
229
+ # Unspecified. Do NOT use as default.
230
+ # Implementations MAY assume SpanKind.INTERNAL to be default.
231
+ SPAN_KIND_UNSPECIFIED = 0
232
+
233
+ # Indicates that the span is used internally. Default value.
234
+ INTERNAL = 1
235
+
236
+ # Indicates that the span covers server-side handling of an RPC or other
237
+ # remote network request.
238
+ SERVER = 2
239
+
240
+ # Indicates that the span covers the client-side wrapper around an RPC or
241
+ # other remote request.
242
+ CLIENT = 3
243
+
244
+ # Indicates that the span describes producer sending a message to a broker.
245
+ # Unlike client and server, there is no direct critical path latency
246
+ # relationship between producer and consumer spans (e.g. publishing a
247
+ # message to a pubsub service).
248
+ PRODUCER = 4
249
+
250
+ # Indicates that the span describes consumer receiving a message from a
251
+ # broker. Unlike client and server, there is no direct critical path
252
+ # latency relationship between producer and consumer spans (e.g. receiving
253
+ # a message from a pubsub service subscription).
254
+ CONSUMER = 5
255
+ end
221
256
  end
222
257
 
223
258
  # The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
@@ -175,6 +175,9 @@ module Google
175
175
  google_api_client.freeze
176
176
 
177
177
  headers = { :"x-goog-api-client" => google_api_client }
178
+ if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
179
+ headers[:"x-goog-user-project"] = credentials.quota_project_id
180
+ end
178
181
  headers.merge!(metadata) unless metadata.nil?
179
182
  client_config_file = Pathname.new(__dir__).join(
180
183
  "trace_service_client_config.json"
@@ -206,17 +209,17 @@ module Google
206
209
  &Google::Devtools::Cloudtrace::V2::TraceService::Stub.method(:new)
207
210
  )
208
211
 
209
- @batch_write_spans = Google::Gax.create_api_call(
210
- @trace_service_stub.method(:batch_write_spans),
211
- defaults["batch_write_spans"],
212
+ @create_span = Google::Gax.create_api_call(
213
+ @trace_service_stub.method(:create_span),
214
+ defaults["create_span"],
212
215
  exception_transformer: exception_transformer,
213
216
  params_extractor: proc do |request|
214
217
  {'name' => request.name}
215
218
  end
216
219
  )
217
- @create_span = Google::Gax.create_api_call(
218
- @trace_service_stub.method(:create_span),
219
- defaults["create_span"],
220
+ @batch_write_spans = Google::Gax.create_api_call(
221
+ @trace_service_stub.method(:batch_write_spans),
222
+ defaults["batch_write_spans"],
220
223
  exception_transformer: exception_transformer,
221
224
  params_extractor: proc do |request|
222
225
  {'name' => request.name}
@@ -226,52 +229,10 @@ module Google
226
229
 
227
230
  # Service calls
228
231
 
229
- # Sends new spans to new or existing traces. You cannot update
230
- # existing spans.
231
- #
232
- # @param name [String]
233
- # Required. The name of the project where the spans belong. The format is
234
- # `projects/[PROJECT_ID]`.
235
- # @param spans [Array<Google::Devtools::Cloudtrace::V2::Span | Hash>]
236
- # Required. A list of new spans. The span names must not match existing
237
- # spans, or the results are undefined.
238
- # A hash of the same form as `Google::Devtools::Cloudtrace::V2::Span`
239
- # can also be provided.
240
- # @param options [Google::Gax::CallOptions]
241
- # Overrides the default settings for this call, e.g, timeout,
242
- # retries, etc.
243
- # @yield [result, operation] Access the result along with the RPC operation
244
- # @yieldparam result []
245
- # @yieldparam operation [GRPC::ActiveCall::Operation]
246
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
247
- # @example
248
- # require "google/cloud/trace"
249
- #
250
- # trace_client = Google::Cloud::Trace.new(version: :v2)
251
- # formatted_name = Google::Cloud::Trace::V2::TraceServiceClient.project_path("[PROJECT]")
252
- #
253
- # # TODO: Initialize `spans`:
254
- # spans = []
255
- # trace_client.batch_write_spans(formatted_name, spans)
256
-
257
- def batch_write_spans \
258
- name,
259
- spans,
260
- options: nil,
261
- &block
262
- req = {
263
- name: name,
264
- spans: spans
265
- }.delete_if { |_, v| v.nil? }
266
- req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V2::BatchWriteSpansRequest)
267
- @batch_write_spans.call(req, options, &block)
268
- nil
269
- end
270
-
271
232
  # Creates a new span.
272
233
  #
273
234
  # @param name [String]
274
- # The resource name of the span in the following format:
235
+ # Required. The resource name of the span in the following format:
275
236
  #
276
237
  # projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
277
238
  #
@@ -281,9 +242,9 @@ module Google
281
242
  # [SPAN_ID] is a unique identifier for a span within a trace; it
282
243
  # is a 16-character hexadecimal encoding of an 8-byte array.
283
244
  # @param span_id [String]
284
- # The [SPAN_ID] portion of the span's resource name.
245
+ # Required. The [SPAN_ID] portion of the span's resource name.
285
246
  # @param display_name [Google::Devtools::Cloudtrace::V2::TruncatableString | Hash]
286
- # A description of the span's operation (up to 128 bytes).
247
+ # Required. A description of the span's operation (up to 128 bytes).
287
248
  # Stackdriver Trace displays the description in the
288
249
  # Google Cloud Platform Console.
289
250
  # For example, the display name can be a qualified method name or a file name
@@ -293,13 +254,13 @@ module Google
293
254
  # A hash of the same form as `Google::Devtools::Cloudtrace::V2::TruncatableString`
294
255
  # can also be provided.
295
256
  # @param start_time [Google::Protobuf::Timestamp | Hash]
296
- # The start time of the span. On the client side, this is the time kept by
257
+ # Required. The start time of the span. On the client side, this is the time kept by
297
258
  # the local machine where the span execution starts. On the server side, this
298
259
  # is the time when the server's application handler starts running.
299
260
  # A hash of the same form as `Google::Protobuf::Timestamp`
300
261
  # can also be provided.
301
262
  # @param end_time [Google::Protobuf::Timestamp | Hash]
302
- # The end time of the span. On the client side, this is the time kept by
263
+ # Required. The end time of the span. On the client side, this is the time kept by
303
264
  # the local machine where the span execution ends. On the server side, this
304
265
  # is the time when the server application handler stops running.
305
266
  # A hash of the same form as `Google::Protobuf::Timestamp`
@@ -341,6 +302,10 @@ module Google
341
302
  # was active. If set, allows implementation to detect missing child spans.
342
303
  # A hash of the same form as `Google::Protobuf::Int32Value`
343
304
  # can also be provided.
305
+ # @param span_kind [Google::Devtools::Cloudtrace::V2::Span::SpanKind]
306
+ # Optional. Distinguishes between spans generated in a particular context. For example,
307
+ # two spans with the same name may be distinguished using `CLIENT` (caller)
308
+ # and `SERVER` (callee) to identify an RPC call.
344
309
  # @param options [Google::Gax::CallOptions]
345
310
  # Overrides the default settings for this call, e.g, timeout,
346
311
  # retries, etc.
@@ -382,6 +347,7 @@ module Google
382
347
  status: nil,
383
348
  same_process_as_parent_span: nil,
384
349
  child_span_count: nil,
350
+ span_kind: nil,
385
351
  options: nil,
386
352
  &block
387
353
  req = {
@@ -397,11 +363,54 @@ module Google
397
363
  links: links,
398
364
  status: status,
399
365
  same_process_as_parent_span: same_process_as_parent_span,
400
- child_span_count: child_span_count
366
+ child_span_count: child_span_count,
367
+ span_kind: span_kind
401
368
  }.delete_if { |_, v| v.nil? }
402
369
  req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V2::Span)
403
370
  @create_span.call(req, options, &block)
404
371
  end
372
+
373
+ # Sends new spans to new or existing traces. You cannot update
374
+ # existing spans.
375
+ #
376
+ # @param name [String]
377
+ # Required. The name of the project where the spans belong. The format is
378
+ # `projects/[PROJECT_ID]`.
379
+ # @param spans [Array<Google::Devtools::Cloudtrace::V2::Span | Hash>]
380
+ # Required. A list of new spans. The span names must not match existing
381
+ # spans, or the results are undefined.
382
+ # A hash of the same form as `Google::Devtools::Cloudtrace::V2::Span`
383
+ # can also be provided.
384
+ # @param options [Google::Gax::CallOptions]
385
+ # Overrides the default settings for this call, e.g, timeout,
386
+ # retries, etc.
387
+ # @yield [result, operation] Access the result along with the RPC operation
388
+ # @yieldparam result []
389
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
390
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
391
+ # @example
392
+ # require "google/cloud/trace"
393
+ #
394
+ # trace_client = Google::Cloud::Trace.new(version: :v2)
395
+ # formatted_name = Google::Cloud::Trace::V2::TraceServiceClient.project_path("[PROJECT]")
396
+ #
397
+ # # TODO: Initialize `spans`:
398
+ # spans = []
399
+ # trace_client.batch_write_spans(formatted_name, spans)
400
+
401
+ def batch_write_spans \
402
+ name,
403
+ spans,
404
+ options: nil,
405
+ &block
406
+ req = {
407
+ name: name,
408
+ spans: spans
409
+ }.delete_if { |_, v| v.nil? }
410
+ req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V2::BatchWriteSpansRequest)
411
+ @batch_write_spans.call(req, options, &block)
412
+ nil
413
+ end
405
414
  end
406
415
  end
407
416
  end
@@ -11,21 +11,21 @@
11
11
  "retry_params": {
12
12
  "default": {
13
13
  "initial_retry_delay_millis": 100,
14
- "retry_delay_multiplier": 1.3,
15
- "max_retry_delay_millis": 60000,
16
- "initial_rpc_timeout_millis": 20000,
17
- "rpc_timeout_multiplier": 1.0,
18
- "max_rpc_timeout_millis": 20000,
19
- "total_timeout_millis": 600000
14
+ "retry_delay_multiplier": 1.2,
15
+ "max_retry_delay_millis": 1000,
16
+ "initial_rpc_timeout_millis": 30000,
17
+ "rpc_timeout_multiplier": 1.5,
18
+ "max_rpc_timeout_millis": 60000,
19
+ "total_timeout_millis": 120000
20
20
  }
21
21
  },
22
22
  "methods": {
23
- "BatchWriteSpans": {
23
+ "CreateSpan": {
24
24
  "timeout_millis": 60000,
25
- "retry_codes_name": "non_idempotent",
25
+ "retry_codes_name": "idempotent",
26
26
  "retry_params_name": "default"
27
27
  },
28
- "CreateSpan": {
28
+ "BatchWriteSpans": {
29
29
  "timeout_millis": 60000,
30
30
  "retry_codes_name": "non_idempotent",
31
31
  "retry_params_name": "default"
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Trace
19
- VERSION = "0.37.1".freeze
19
+ VERSION = "0.39.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -4,12 +4,12 @@
4
4
 
5
5
  require 'google/protobuf'
6
6
 
7
- require 'google/api/annotations_pb'
8
7
  require 'google/api/client_pb'
9
8
  require 'google/api/field_behavior_pb'
10
9
  require 'google/api/resource_pb'
11
10
  require 'google/protobuf/empty_pb'
12
11
  require 'google/protobuf/timestamp_pb'
12
+ require 'google/api/annotations_pb'
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_message "google.devtools.cloudtrace.v1.Trace" do
15
15
  optional :project_id, :string, 1
@@ -66,17 +66,17 @@ end
66
66
  module Google
67
67
  module Devtools
68
68
  module Cloudtrace
69
- module V1
70
- Trace = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.Trace").msgclass
71
- Traces = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.Traces").msgclass
72
- TraceSpan = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.TraceSpan").msgclass
73
- TraceSpan::SpanKind = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.TraceSpan.SpanKind").enummodule
74
- ListTracesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesRequest").msgclass
75
- ListTracesRequest::ViewType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesRequest.ViewType").enummodule
76
- ListTracesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesResponse").msgclass
77
- GetTraceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.GetTraceRequest").msgclass
78
- PatchTracesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.PatchTracesRequest").msgclass
79
- end
80
69
  end
81
70
  end
82
71
  end
72
+ module Google::Devtools::Cloudtrace::V1
73
+ Trace = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.Trace").msgclass
74
+ Traces = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.Traces").msgclass
75
+ TraceSpan = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.TraceSpan").msgclass
76
+ TraceSpan::SpanKind = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.TraceSpan.SpanKind").enummodule
77
+ ListTracesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesRequest").msgclass
78
+ ListTracesRequest::ViewType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesRequest.ViewType").enummodule
79
+ ListTracesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesResponse").msgclass
80
+ GetTraceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.GetTraceRequest").msgclass
81
+ PatchTracesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.PatchTracesRequest").msgclass
82
+ end
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/devtools/cloudtrace/v1/trace.proto for package 'google.devtools.cloudtrace.v1'
2
+ # Source: google/devtools/cloudtrace/v1/trace.proto for package 'Google::Cloud::Trace::V1'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2020 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -23,36 +23,36 @@ require 'google/devtools/cloudtrace/v1/trace_pb'
23
23
  module Google
24
24
  module Devtools
25
25
  module Cloudtrace
26
- module V1
27
- module TraceService
28
- # This file describes an API for collecting and viewing traces and spans
29
- # within a trace. A Trace is a collection of spans corresponding to a single
30
- # operation or set of operations for an application. A span is an individual
31
- # timed event which forms a node of the trace tree. Spans for a single trace
32
- # may span multiple services.
33
- class Service
34
-
35
- include GRPC::GenericService
26
+ end
27
+ end
28
+ end
29
+ module Google::Devtools::Cloudtrace::V1
30
+ module TraceService
31
+ # This file describes an API for collecting and viewing traces and spans
32
+ # within a trace. A Trace is a collection of spans corresponding to a single
33
+ # operation or set of operations for an application. A span is an individual
34
+ # timed event which forms a node of the trace tree. Spans for a single trace
35
+ # may span multiple services.
36
+ class Service
36
37
 
37
- self.marshal_class_method = :encode
38
- self.unmarshal_class_method = :decode
39
- self.service_name = 'google.devtools.cloudtrace.v1.TraceService'
38
+ include GRPC::GenericService
40
39
 
41
- # Returns of a list of traces that match the specified filter conditions.
42
- rpc :ListTraces, ListTracesRequest, ListTracesResponse
43
- # Gets a single trace by its ID.
44
- rpc :GetTrace, GetTraceRequest, Trace
45
- # Sends new traces to Stackdriver Trace or updates existing traces. If the ID
46
- # of a trace that you send matches that of an existing trace, any fields
47
- # in the existing trace and its spans are overwritten by the provided values,
48
- # and any new fields provided are merged with the existing trace data. If the
49
- # ID does not match, a new trace is created.
50
- rpc :PatchTraces, PatchTracesRequest, Google::Protobuf::Empty
51
- end
40
+ self.marshal_class_method = :encode
41
+ self.unmarshal_class_method = :decode
42
+ self.service_name = 'google.devtools.cloudtrace.v1.TraceService'
52
43
 
53
- Stub = Service.rpc_stub_class
54
- end
55
- end
44
+ # Returns of a list of traces that match the specified filter conditions.
45
+ rpc :ListTraces, ListTracesRequest, ListTracesResponse
46
+ # Gets a single trace by its ID.
47
+ rpc :GetTrace, GetTraceRequest, Trace
48
+ # Sends new traces to Stackdriver Trace or updates existing traces. If the ID
49
+ # of a trace that you send matches that of an existing trace, any fields
50
+ # in the existing trace and its spans are overwritten by the provided values,
51
+ # and any new fields provided are merged with the existing trace data. If the
52
+ # ID does not match, a new trace is created.
53
+ rpc :PatchTraces, PatchTracesRequest, Google::Protobuf::Empty
56
54
  end
55
+
56
+ Stub = Service.rpc_stub_class
57
57
  end
58
58
  end
@@ -4,12 +4,12 @@
4
4
 
5
5
  require 'google/protobuf'
6
6
 
7
- require 'google/api/annotations_pb'
8
7
  require 'google/api/field_behavior_pb'
9
8
  require 'google/api/resource_pb'
10
9
  require 'google/protobuf/timestamp_pb'
11
10
  require 'google/protobuf/wrappers_pb'
12
11
  require 'google/rpc/status_pb'
12
+ require 'google/api/annotations_pb'
13
13
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
14
  add_message "google.devtools.cloudtrace.v2.Span" do
15
15
  optional :name, :string, 1
@@ -25,6 +25,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
25
25
  optional :status, :message, 11, "google.rpc.Status"
26
26
  optional :same_process_as_parent_span, :message, 12, "google.protobuf.BoolValue"
27
27
  optional :child_span_count, :message, 13, "google.protobuf.Int32Value"
28
+ optional :span_kind, :enum, 14, "google.devtools.cloudtrace.v2.Span.SpanKind"
28
29
  end
29
30
  add_message "google.devtools.cloudtrace.v2.Span.Attributes" do
30
31
  map :attribute_map, :string, :message, 1, "google.devtools.cloudtrace.v2.AttributeValue"
@@ -72,6 +73,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
72
73
  repeated :link, :message, 1, "google.devtools.cloudtrace.v2.Span.Link"
73
74
  optional :dropped_links_count, :int32, 2
74
75
  end
76
+ add_enum "google.devtools.cloudtrace.v2.Span.SpanKind" do
77
+ value :SPAN_KIND_UNSPECIFIED, 0
78
+ value :INTERNAL, 1
79
+ value :SERVER, 2
80
+ value :CLIENT, 3
81
+ value :PRODUCER, 4
82
+ value :CONSUMER, 5
83
+ end
75
84
  add_message "google.devtools.cloudtrace.v2.AttributeValue" do
76
85
  oneof :value do
77
86
  optional :string_value, :message, 1, "google.devtools.cloudtrace.v2.TruncatableString"
@@ -109,24 +118,25 @@ end
109
118
  module Google
110
119
  module Devtools
111
120
  module Cloudtrace
112
- module V2
113
- Span = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span").msgclass
114
- Span::Attributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Attributes").msgclass
115
- Span::TimeEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent").msgclass
116
- Span::TimeEvent::Annotation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation").msgclass
117
- Span::TimeEvent::MessageEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent").msgclass
118
- Span::TimeEvent::MessageEvent::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type").enummodule
119
- Span::TimeEvents = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvents").msgclass
120
- Span::Link = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Link").msgclass
121
- Span::Link::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Link.Type").enummodule
122
- Span::Links = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Links").msgclass
123
- AttributeValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.AttributeValue").msgclass
124
- StackTrace = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace").msgclass
125
- StackTrace::StackFrame = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace.StackFrame").msgclass
126
- StackTrace::StackFrames = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace.StackFrames").msgclass
127
- Module = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Module").msgclass
128
- TruncatableString = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.TruncatableString").msgclass
129
- end
130
121
  end
131
122
  end
132
123
  end
124
+ module Google::Devtools::Cloudtrace::V2
125
+ Span = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span").msgclass
126
+ Span::Attributes = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Attributes").msgclass
127
+ Span::TimeEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent").msgclass
128
+ Span::TimeEvent::Annotation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation").msgclass
129
+ Span::TimeEvent::MessageEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent").msgclass
130
+ Span::TimeEvent::MessageEvent::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type").enummodule
131
+ Span::TimeEvents = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvents").msgclass
132
+ Span::Link = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Link").msgclass
133
+ Span::Link::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Link.Type").enummodule
134
+ Span::Links = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Links").msgclass
135
+ Span::SpanKind = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.SpanKind").enummodule
136
+ AttributeValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.AttributeValue").msgclass
137
+ StackTrace = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace").msgclass
138
+ StackTrace::StackFrame = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace.StackFrame").msgclass
139
+ StackTrace::StackFrames = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace.StackFrames").msgclass
140
+ Module = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Module").msgclass
141
+ TruncatableString = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.TruncatableString").msgclass
142
+ end
@@ -21,9 +21,9 @@ end
21
21
  module Google
22
22
  module Devtools
23
23
  module Cloudtrace
24
- module V2
25
- BatchWriteSpansRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.BatchWriteSpansRequest").msgclass
26
- end
27
24
  end
28
25
  end
29
26
  end
27
+ module Google::Devtools::Cloudtrace::V2
28
+ BatchWriteSpansRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.BatchWriteSpansRequest").msgclass
29
+ end
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/devtools/cloudtrace/v2/tracing.proto for package 'google.devtools.cloudtrace.v2'
2
+ # Source: google/devtools/cloudtrace/v2/tracing.proto for package 'Google::Cloud::Trace::V2'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2020 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
 
21
20
  require 'grpc'
@@ -24,31 +23,31 @@ require 'google/devtools/cloudtrace/v2/tracing_pb'
24
23
  module Google
25
24
  module Devtools
26
25
  module Cloudtrace
27
- module V2
28
- module TraceService
29
- # This file describes an API for collecting and viewing traces and spans
30
- # within a trace. A Trace is a collection of spans corresponding to a single
31
- # operation or set of operations for an application. A span is an individual
32
- # timed event which forms a node of the trace tree. A single trace may
33
- # contain span(s) from multiple services.
34
- class Service
35
-
36
- include GRPC::GenericService
26
+ end
27
+ end
28
+ end
29
+ module Google::Devtools::Cloudtrace::V2
30
+ module TraceService
31
+ # This file describes an API for collecting and viewing traces and spans
32
+ # within a trace. A Trace is a collection of spans corresponding to a single
33
+ # operation or set of operations for an application. A span is an individual
34
+ # timed event which forms a node of the trace tree. A single trace may
35
+ # contain span(s) from multiple services.
36
+ class Service
37
37
 
38
- self.marshal_class_method = :encode
39
- self.unmarshal_class_method = :decode
40
- self.service_name = 'google.devtools.cloudtrace.v2.TraceService'
38
+ include GRPC::GenericService
41
39
 
42
- # Sends new spans to new or existing traces. You cannot update
43
- # existing spans.
44
- rpc :BatchWriteSpans, BatchWriteSpansRequest, Google::Protobuf::Empty
45
- # Creates a new span.
46
- rpc :CreateSpan, Span, Span
47
- end
40
+ self.marshal_class_method = :encode
41
+ self.unmarshal_class_method = :decode
42
+ self.service_name = 'google.devtools.cloudtrace.v2.TraceService'
48
43
 
49
- Stub = Service.rpc_stub_class
50
- end
51
- end
44
+ # Sends new spans to new or existing traces. You cannot update
45
+ # existing spans.
46
+ rpc :BatchWriteSpans, BatchWriteSpansRequest, Google::Protobuf::Empty
47
+ # Creates a new span.
48
+ rpc :CreateSpan, Span, Span
52
49
  end
50
+
51
+ Stub = Service.rpc_stub_class
53
52
  end
54
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-trace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.1
4
+ version: 0.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-23 00:00:00.000000000 Z
11
+ date: 2020-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core
@@ -368,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
368
368
  - !ruby/object:Gem::Version
369
369
  version: '0'
370
370
  requirements: []
371
- rubygems_version: 3.0.6
371
+ rubygems_version: 3.1.3
372
372
  signing_key:
373
373
  specification_version: 4
374
374
  summary: Application Instrumentation and API Client library for Stackdriver Trace