google-cloud-trace 0.36.1 → 0.37.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 +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/google/cloud/trace/async_reporter.rb +3 -3
- data/lib/google/cloud/trace/faraday_middleware.rb +34 -0
- data/lib/google/cloud/trace/v1/doc/google/devtools/cloudtrace/v1/trace.rb +16 -15
- data/lib/google/cloud/trace/v1/trace_service_client.rb +94 -94
- data/lib/google/cloud/trace/v1/trace_service_client_config.json +8 -8
- data/lib/google/cloud/trace/v2/doc/google/devtools/cloudtrace/v2/trace.rb +5 -5
- data/lib/google/cloud/trace/v2/doc/google/devtools/cloudtrace/v2/tracing.rb +1 -1
- data/lib/google/cloud/trace/v2/trace_service_client.rb +8 -25
- data/lib/google/cloud/trace/v2/trace_service_client_config.json +7 -7
- data/lib/google/cloud/trace/version.rb +1 -1
- data/lib/google/devtools/cloudtrace/v1/trace_pb.rb +3 -0
- data/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb +1 -1
- data/lib/google/devtools/cloudtrace/v2/trace_pb.rb +2 -0
- data/lib/google/devtools/cloudtrace/v2/tracing_pb.rb +3 -0
- data/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 384b1cafe16ad5de310f82ade0a2fe59941cb76ca5cd9a23dabceb3d59df0d5d
|
4
|
+
data.tar.gz: 74c9edde35e5de3a9b780a3e352a4713b09b90d84a351686b43d02b24ead6bea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01a6f53b2db9df587f396421db83b4861beae464f5fb36cddfbe7b7457750f8e760bfcfdb994a374aa583e253fabc2ebb3806aa75faaa1f47460dbcbc509634e
|
7
|
+
data.tar.gz: 237e306b7ea598485bfa475740cfd8e956ed62d52e8f16d5aa67b2ffe752c837bd96a3e7bbd6ff40ea8a030b7fd91b21da169ab02e4c2166f5829cbdc7e2cbd2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.37.0 / 2019-12-19
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* Introduce enable_cross_project_tracing option to the Faraday middleware
|
8
|
+
|
9
|
+
#### Bug Fixes
|
10
|
+
|
11
|
+
* Fix MonitorMixin usage on Ruby 2.7
|
12
|
+
* Ruby 2.7 will error if new_cond is called before super()
|
13
|
+
* Make the call to super() be the first call in initialize where possible
|
14
|
+
|
15
|
+
#### Performance Improvements
|
16
|
+
|
17
|
+
* Remove TraceServiceClient.span_path from the lower-level API
|
18
|
+
* Update network configuration
|
19
|
+
|
3
20
|
### 0.36.1 / 2019-11-06
|
4
21
|
|
5
22
|
#### Bug Fixes
|
@@ -38,6 +38,9 @@ module Google
|
|
38
38
|
# @private Creates a new AsyncReporter instance.
|
39
39
|
def initialize service, max_count: 1000, max_bytes: 4000000,
|
40
40
|
max_queue: 100, interval: 5, threads: 10
|
41
|
+
# init MonitorMixin
|
42
|
+
super()
|
43
|
+
|
41
44
|
@service = service
|
42
45
|
|
43
46
|
@max_count = max_count
|
@@ -52,9 +55,6 @@ module Google
|
|
52
55
|
|
53
56
|
# Make sure all buffered messages are sent when process exits.
|
54
57
|
at_exit { stop! }
|
55
|
-
|
56
|
-
# init MonitorMixin
|
57
|
-
super()
|
58
58
|
end
|
59
59
|
|
60
60
|
##
|
@@ -20,11 +20,37 @@ module Google
|
|
20
20
|
module Cloud
|
21
21
|
module Trace
|
22
22
|
class FaradayMiddleware < Faraday::Middleware
|
23
|
+
##
|
24
|
+
# # Trace FaradayMiddleware
|
25
|
+
#
|
26
|
+
# A faraday middleware that setup request/response labels for trace.
|
27
|
+
#
|
28
|
+
# ## Installing
|
29
|
+
#
|
30
|
+
# To use this middleware, simply install it in your middleware stack.
|
31
|
+
# Here is an example configuration enable the Trace middleware:
|
32
|
+
#
|
33
|
+
# ```ruby
|
34
|
+
# conn = Faraday.new(:url => 'http://example.com') do |faraday|
|
35
|
+
# # enable cross project tracing with option to true
|
36
|
+
# faraday.use Google::Cloud::Trace, enable_cross_project_tracing: true
|
37
|
+
# faraday.request :url_encoded # form-encode POST params
|
38
|
+
# faraday.response :logger # log requests to $stdout
|
39
|
+
# faraday.adapter Faraday.default_adapter # use Net::HTTP adapter
|
40
|
+
# end
|
41
|
+
# ```
|
42
|
+
|
43
|
+
def initialize app, enable_cross_project_tracing: false
|
44
|
+
super(app)
|
45
|
+
@enable_cross_project_tracing = enable_cross_project_tracing || false
|
46
|
+
end
|
47
|
+
|
23
48
|
##
|
24
49
|
# Create a Trace span with the HTTP request/response information.
|
25
50
|
def call env
|
26
51
|
Google::Cloud::Trace.in_span "faraday_request" do |span|
|
27
52
|
add_request_labels span, env if span
|
53
|
+
add_trace_context_header env if @enable_cross_project_tracing
|
28
54
|
|
29
55
|
response = @app.call env
|
30
56
|
|
@@ -84,6 +110,14 @@ module Google
|
|
84
110
|
def set_label labels, key, value
|
85
111
|
labels[key] = value if value.is_a? ::String
|
86
112
|
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# @private Add X-Cloud-Trace-Context for request header
|
116
|
+
def add_trace_context_header env
|
117
|
+
if (trace_ctx = Stackdriver::Core::TraceContext.get)
|
118
|
+
env[:request_headers]["X-Cloud-Trace-Context"] = trace_ctx.to_string
|
119
|
+
end
|
120
|
+
end
|
87
121
|
end
|
88
122
|
end
|
89
123
|
end
|
@@ -26,7 +26,8 @@ module Google
|
|
26
26
|
# @!attribute [rw] trace_id
|
27
27
|
# @return [String]
|
28
28
|
# Globally unique identifier for the trace. This identifier is a 128-bit
|
29
|
-
# numeric value formatted as a 32-byte hex string.
|
29
|
+
# numeric value formatted as a 32-byte hex string. For example,
|
30
|
+
# `382d4f4c6b7bb2f4a972559d9085001d`.
|
30
31
|
# @!attribute [rw] spans
|
31
32
|
# @return [Array<Google::Devtools::Cloudtrace::V1::TraceSpan>]
|
32
33
|
# Collection of spans in the trace.
|
@@ -46,7 +47,7 @@ module Google
|
|
46
47
|
# @!attribute [rw] span_id
|
47
48
|
# @return [Integer]
|
48
49
|
# Identifier for the span. Must be a 64-bit integer other than 0 and
|
49
|
-
# unique within a trace.
|
50
|
+
# unique within a trace. For example, `2205310701640571284`.
|
50
51
|
# @!attribute [rw] kind
|
51
52
|
# @return [Google::Devtools::Cloudtrace::V1::TraceSpan::SpanKind]
|
52
53
|
# Distinguishes between spans generated in a particular context. For example,
|
@@ -69,7 +70,7 @@ module Google
|
|
69
70
|
# End time of the span in nanoseconds from the UNIX epoch.
|
70
71
|
# @!attribute [rw] parent_span_id
|
71
72
|
# @return [Integer]
|
72
|
-
# ID of the parent span, if any.
|
73
|
+
# Optional. ID of the parent span, if any.
|
73
74
|
# @!attribute [rw] labels
|
74
75
|
# @return [Hash{String => String}]
|
75
76
|
# Collection of labels associated with the span. Label keys must be less than
|
@@ -128,20 +129,20 @@ module Google
|
|
128
129
|
# unless specified.
|
129
130
|
# @!attribute [rw] project_id
|
130
131
|
# @return [String]
|
131
|
-
# ID of the Cloud project where the trace data is stored.
|
132
|
+
# Required. ID of the Cloud project where the trace data is stored.
|
132
133
|
# @!attribute [rw] view
|
133
134
|
# @return [Google::Devtools::Cloudtrace::V1::ListTracesRequest::ViewType]
|
134
|
-
# Type of data returned for traces in the list.
|
135
|
+
# Optional. Type of data returned for traces in the list. Default is
|
135
136
|
# `MINIMAL`.
|
136
137
|
# @!attribute [rw] page_size
|
137
138
|
# @return [Integer]
|
138
|
-
# Maximum number of traces to return. If not specified or <= 0, the
|
139
|
+
# Optional. Maximum number of traces to return. If not specified or <= 0, the
|
139
140
|
# implementation selects a reasonable value. The implementation may
|
140
|
-
# return fewer traces than the requested page size.
|
141
|
+
# return fewer traces than the requested page size.
|
141
142
|
# @!attribute [rw] page_token
|
142
143
|
# @return [String]
|
143
144
|
# Token identifying the page of results to return. If provided, use the
|
144
|
-
# value of the `next_page_token` field from a previous request.
|
145
|
+
# value of the `next_page_token` field from a previous request.
|
145
146
|
# @!attribute [rw] start_time
|
146
147
|
# @return [Google::Protobuf::Timestamp]
|
147
148
|
# Start of the time interval (inclusive) during which the trace data was
|
@@ -152,7 +153,7 @@ module Google
|
|
152
153
|
# collected from the application.
|
153
154
|
# @!attribute [rw] filter
|
154
155
|
# @return [String]
|
155
|
-
#
|
156
|
+
# Optional. A filter against labels for the request.
|
156
157
|
#
|
157
158
|
# By default, searches use prefix matching. To specify exact match, prepend
|
158
159
|
# a plus symbol (`+`) to the search term.
|
@@ -184,7 +185,7 @@ module Google
|
|
184
185
|
# * `url:VALUE`: Equivalent to `/http/url:VALUE`.
|
185
186
|
# @!attribute [rw] order_by
|
186
187
|
# @return [String]
|
187
|
-
# Field used to sort the returned traces.
|
188
|
+
# Optional. Field used to sort the returned traces.
|
188
189
|
# Can be one of the following:
|
189
190
|
#
|
190
191
|
# * `trace_id`
|
@@ -221,7 +222,7 @@ module Google
|
|
221
222
|
# The response message for the `ListTraces` method.
|
222
223
|
# @!attribute [rw] traces
|
223
224
|
# @return [Array<Google::Devtools::Cloudtrace::V1::Trace>]
|
224
|
-
# List of trace records
|
225
|
+
# List of trace records as specified by the view parameter.
|
225
226
|
# @!attribute [rw] next_page_token
|
226
227
|
# @return [String]
|
227
228
|
# If defined, indicates that there are more traces that match the request
|
@@ -232,19 +233,19 @@ module Google
|
|
232
233
|
# The request message for the `GetTrace` method.
|
233
234
|
# @!attribute [rw] project_id
|
234
235
|
# @return [String]
|
235
|
-
# ID of the Cloud project where the trace data is stored.
|
236
|
+
# Required. ID of the Cloud project where the trace data is stored.
|
236
237
|
# @!attribute [rw] trace_id
|
237
238
|
# @return [String]
|
238
|
-
# ID of the trace to return.
|
239
|
+
# Required. ID of the trace to return.
|
239
240
|
class GetTraceRequest; end
|
240
241
|
|
241
242
|
# The request message for the `PatchTraces` method.
|
242
243
|
# @!attribute [rw] project_id
|
243
244
|
# @return [String]
|
244
|
-
# ID of the Cloud project where the trace data is stored.
|
245
|
+
# Required. ID of the Cloud project where the trace data is stored.
|
245
246
|
# @!attribute [rw] traces
|
246
247
|
# @return [Google::Devtools::Cloudtrace::V1::Traces]
|
247
|
-
# The body of the message.
|
248
|
+
# Required. The body of the message.
|
248
249
|
class PatchTracesRequest; end
|
249
250
|
end
|
250
251
|
end
|
@@ -183,9 +183,9 @@ module Google
|
|
183
183
|
&Google::Devtools::Cloudtrace::V1::TraceService::Stub.method(:new)
|
184
184
|
)
|
185
185
|
|
186
|
-
@
|
187
|
-
@trace_service_stub.method(:
|
188
|
-
defaults["
|
186
|
+
@list_traces = Google::Gax.create_api_call(
|
187
|
+
@trace_service_stub.method(:list_traces),
|
188
|
+
defaults["list_traces"],
|
189
189
|
exception_transformer: exception_transformer,
|
190
190
|
params_extractor: proc do |request|
|
191
191
|
{'project_id' => request.project_id}
|
@@ -196,9 +196,9 @@ module Google
|
|
196
196
|
defaults["get_trace"],
|
197
197
|
exception_transformer: exception_transformer
|
198
198
|
)
|
199
|
-
@
|
200
|
-
@trace_service_stub.method(:
|
201
|
-
defaults["
|
199
|
+
@patch_traces = Google::Gax.create_api_call(
|
200
|
+
@trace_service_stub.method(:patch_traces),
|
201
|
+
defaults["patch_traces"],
|
202
202
|
exception_transformer: exception_transformer,
|
203
203
|
params_extractor: proc do |request|
|
204
204
|
{'project_id' => request.project_id}
|
@@ -208,96 +208,12 @@ module Google
|
|
208
208
|
|
209
209
|
# Service calls
|
210
210
|
|
211
|
-
# Sends new traces to Stackdriver Trace or updates existing traces. If the ID
|
212
|
-
# of a trace that you send matches that of an existing trace, any fields
|
213
|
-
# in the existing trace and its spans are overwritten by the provided values,
|
214
|
-
# and any new fields provided are merged with the existing trace data. If the
|
215
|
-
# ID does not match, a new trace is created.
|
216
|
-
#
|
217
|
-
# @param project_id [String]
|
218
|
-
# ID of the Cloud project where the trace data is stored.
|
219
|
-
# @param traces [Google::Devtools::Cloudtrace::V1::Traces | Hash]
|
220
|
-
# The body of the message.
|
221
|
-
# A hash of the same form as `Google::Devtools::Cloudtrace::V1::Traces`
|
222
|
-
# can also be provided.
|
223
|
-
# @param options [Google::Gax::CallOptions]
|
224
|
-
# Overrides the default settings for this call, e.g, timeout,
|
225
|
-
# retries, etc.
|
226
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
227
|
-
# @yieldparam result []
|
228
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
229
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
230
|
-
# @example
|
231
|
-
# require "google/cloud/trace"
|
232
|
-
#
|
233
|
-
# trace_client = Google::Cloud::Trace.new(version: :v1)
|
234
|
-
#
|
235
|
-
# # TODO: Initialize `project_id`:
|
236
|
-
# project_id = ''
|
237
|
-
#
|
238
|
-
# # TODO: Initialize `traces`:
|
239
|
-
# traces = {}
|
240
|
-
# trace_client.patch_traces(project_id, traces)
|
241
|
-
|
242
|
-
def patch_traces \
|
243
|
-
project_id,
|
244
|
-
traces,
|
245
|
-
options: nil,
|
246
|
-
&block
|
247
|
-
req = {
|
248
|
-
project_id: project_id,
|
249
|
-
traces: traces
|
250
|
-
}.delete_if { |_, v| v.nil? }
|
251
|
-
req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::PatchTracesRequest)
|
252
|
-
@patch_traces.call(req, options, &block)
|
253
|
-
nil
|
254
|
-
end
|
255
|
-
|
256
|
-
# Gets a single trace by its ID.
|
257
|
-
#
|
258
|
-
# @param project_id [String]
|
259
|
-
# ID of the Cloud project where the trace data is stored.
|
260
|
-
# @param trace_id [String]
|
261
|
-
# ID of the trace to return.
|
262
|
-
# @param options [Google::Gax::CallOptions]
|
263
|
-
# Overrides the default settings for this call, e.g, timeout,
|
264
|
-
# retries, etc.
|
265
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
266
|
-
# @yieldparam result [Google::Devtools::Cloudtrace::V1::Trace]
|
267
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
268
|
-
# @return [Google::Devtools::Cloudtrace::V1::Trace]
|
269
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
270
|
-
# @example
|
271
|
-
# require "google/cloud/trace"
|
272
|
-
#
|
273
|
-
# trace_client = Google::Cloud::Trace.new(version: :v1)
|
274
|
-
#
|
275
|
-
# # TODO: Initialize `project_id`:
|
276
|
-
# project_id = ''
|
277
|
-
#
|
278
|
-
# # TODO: Initialize `trace_id`:
|
279
|
-
# trace_id = ''
|
280
|
-
# response = trace_client.get_trace(project_id, trace_id)
|
281
|
-
|
282
|
-
def get_trace \
|
283
|
-
project_id,
|
284
|
-
trace_id,
|
285
|
-
options: nil,
|
286
|
-
&block
|
287
|
-
req = {
|
288
|
-
project_id: project_id,
|
289
|
-
trace_id: trace_id
|
290
|
-
}.delete_if { |_, v| v.nil? }
|
291
|
-
req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::GetTraceRequest)
|
292
|
-
@get_trace.call(req, options, &block)
|
293
|
-
end
|
294
|
-
|
295
211
|
# Returns of a list of traces that match the specified filter conditions.
|
296
212
|
#
|
297
213
|
# @param project_id [String]
|
298
|
-
# ID of the Cloud project where the trace data is stored.
|
214
|
+
# Required. ID of the Cloud project where the trace data is stored.
|
299
215
|
# @param view [Google::Devtools::Cloudtrace::V1::ListTracesRequest::ViewType]
|
300
|
-
# Type of data returned for traces in the list.
|
216
|
+
# Optional. Type of data returned for traces in the list. Default is
|
301
217
|
# `MINIMAL`.
|
302
218
|
# @param page_size [Integer]
|
303
219
|
# The maximum number of resources contained in the underlying API
|
@@ -316,7 +232,7 @@ module Google
|
|
316
232
|
# A hash of the same form as `Google::Protobuf::Timestamp`
|
317
233
|
# can also be provided.
|
318
234
|
# @param filter [String]
|
319
|
-
#
|
235
|
+
# Optional. A filter against labels for the request.
|
320
236
|
#
|
321
237
|
# By default, searches use prefix matching. To specify exact match, prepend
|
322
238
|
# a plus symbol (`+`) to the search term.
|
@@ -347,7 +263,7 @@ module Google
|
|
347
263
|
# * `method:VALUE`: Equivalent to `/http/method:VALUE`.
|
348
264
|
# * `url:VALUE`: Equivalent to `/http/url:VALUE`.
|
349
265
|
# @param order_by [String]
|
350
|
-
# Field used to sort the returned traces.
|
266
|
+
# Optional. Field used to sort the returned traces.
|
351
267
|
# Can be one of the following:
|
352
268
|
#
|
353
269
|
# * `trace_id`
|
@@ -415,6 +331,90 @@ module Google
|
|
415
331
|
req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::ListTracesRequest)
|
416
332
|
@list_traces.call(req, options, &block)
|
417
333
|
end
|
334
|
+
|
335
|
+
# Gets a single trace by its ID.
|
336
|
+
#
|
337
|
+
# @param project_id [String]
|
338
|
+
# Required. ID of the Cloud project where the trace data is stored.
|
339
|
+
# @param trace_id [String]
|
340
|
+
# Required. ID of the trace to return.
|
341
|
+
# @param options [Google::Gax::CallOptions]
|
342
|
+
# Overrides the default settings for this call, e.g, timeout,
|
343
|
+
# retries, etc.
|
344
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
345
|
+
# @yieldparam result [Google::Devtools::Cloudtrace::V1::Trace]
|
346
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
347
|
+
# @return [Google::Devtools::Cloudtrace::V1::Trace]
|
348
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
349
|
+
# @example
|
350
|
+
# require "google/cloud/trace"
|
351
|
+
#
|
352
|
+
# trace_client = Google::Cloud::Trace.new(version: :v1)
|
353
|
+
#
|
354
|
+
# # TODO: Initialize `project_id`:
|
355
|
+
# project_id = ''
|
356
|
+
#
|
357
|
+
# # TODO: Initialize `trace_id`:
|
358
|
+
# trace_id = ''
|
359
|
+
# response = trace_client.get_trace(project_id, trace_id)
|
360
|
+
|
361
|
+
def get_trace \
|
362
|
+
project_id,
|
363
|
+
trace_id,
|
364
|
+
options: nil,
|
365
|
+
&block
|
366
|
+
req = {
|
367
|
+
project_id: project_id,
|
368
|
+
trace_id: trace_id
|
369
|
+
}.delete_if { |_, v| v.nil? }
|
370
|
+
req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::GetTraceRequest)
|
371
|
+
@get_trace.call(req, options, &block)
|
372
|
+
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
418
|
end
|
419
419
|
end
|
420
420
|
end
|
@@ -11,16 +11,16 @@
|
|
11
11
|
"retry_params": {
|
12
12
|
"default": {
|
13
13
|
"initial_retry_delay_millis": 100,
|
14
|
-
"retry_delay_multiplier": 1.
|
15
|
-
"max_retry_delay_millis":
|
14
|
+
"retry_delay_multiplier": 1.3,
|
15
|
+
"max_retry_delay_millis": 60000,
|
16
16
|
"initial_rpc_timeout_millis": 20000,
|
17
|
-
"rpc_timeout_multiplier": 1.
|
18
|
-
"max_rpc_timeout_millis":
|
19
|
-
"total_timeout_millis":
|
17
|
+
"rpc_timeout_multiplier": 1.0,
|
18
|
+
"max_rpc_timeout_millis": 20000,
|
19
|
+
"total_timeout_millis": 600000
|
20
20
|
}
|
21
21
|
},
|
22
22
|
"methods": {
|
23
|
-
"
|
23
|
+
"ListTraces": {
|
24
24
|
"timeout_millis": 60000,
|
25
25
|
"retry_codes_name": "idempotent",
|
26
26
|
"retry_params_name": "default"
|
@@ -30,9 +30,9 @@
|
|
30
30
|
"retry_codes_name": "idempotent",
|
31
31
|
"retry_params_name": "default"
|
32
32
|
},
|
33
|
-
"
|
33
|
+
"PatchTraces": {
|
34
34
|
"timeout_millis": 60000,
|
35
|
-
"retry_codes_name": "
|
35
|
+
"retry_codes_name": "non_idempotent",
|
36
36
|
"retry_params_name": "default"
|
37
37
|
}
|
38
38
|
}
|
@@ -76,24 +76,24 @@ module Google
|
|
76
76
|
# Links associated with the span. You can have up to 128 links per Span.
|
77
77
|
# @!attribute [rw] status
|
78
78
|
# @return [Google::Rpc::Status]
|
79
|
-
#
|
79
|
+
# Optional. The final status for this span.
|
80
80
|
# @!attribute [rw] same_process_as_parent_span
|
81
81
|
# @return [Google::Protobuf::BoolValue]
|
82
|
-
#
|
82
|
+
# Optional. Set this parameter to indicate whether this span is in
|
83
83
|
# the same process as its parent. If you do not set this parameter,
|
84
84
|
# Stackdriver Trace is unable to take advantage of this helpful
|
85
85
|
# information.
|
86
86
|
# @!attribute [rw] child_span_count
|
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
90
|
class Span
|
91
91
|
# A set of attributes, each in the format `[KEY]:[VALUE]`.
|
92
92
|
# @!attribute [rw] attribute_map
|
93
93
|
# @return [Hash{String => Google::Devtools::Cloudtrace::V2::AttributeValue}]
|
94
94
|
# The set of attributes. Each attribute's key can be up to 128 bytes
|
95
|
-
# long. The value can be a string up to 256 bytes,
|
96
|
-
# Boolean values `true` and `false`. For example:
|
95
|
+
# long. The value can be a string up to 256 bytes, a signed 64-bit integer,
|
96
|
+
# or the Boolean values `true` and `false`. For example:
|
97
97
|
#
|
98
98
|
# "/instance_id": "my-instance"
|
99
99
|
# "/http/user_agent": ""
|
@@ -24,7 +24,7 @@ module Google
|
|
24
24
|
# `projects/[PROJECT_ID]`.
|
25
25
|
# @!attribute [rw] spans
|
26
26
|
# @return [Array<Google::Devtools::Cloudtrace::V2::Span>]
|
27
|
-
# A list of new spans. The span names must not match existing
|
27
|
+
# Required. A list of new spans. The span names must not match existing
|
28
28
|
# spans, or the results are undefined.
|
29
29
|
class BatchWriteSpansRequest; end
|
30
30
|
end
|
@@ -70,12 +70,6 @@ module Google
|
|
70
70
|
|
71
71
|
private_constant :PROJECT_PATH_TEMPLATE
|
72
72
|
|
73
|
-
SPAN_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
74
|
-
"projects/{project}/traces/{trace}/spans/{span}"
|
75
|
-
)
|
76
|
-
|
77
|
-
private_constant :SPAN_PATH_TEMPLATE
|
78
|
-
|
79
73
|
# Returns a fully-qualified project resource name string.
|
80
74
|
# @param project [String]
|
81
75
|
# @return [String]
|
@@ -85,19 +79,6 @@ module Google
|
|
85
79
|
)
|
86
80
|
end
|
87
81
|
|
88
|
-
# Returns a fully-qualified span resource name string.
|
89
|
-
# @param project [String]
|
90
|
-
# @param trace [String]
|
91
|
-
# @param span [String]
|
92
|
-
# @return [String]
|
93
|
-
def self.span_path project, trace, span
|
94
|
-
SPAN_PATH_TEMPLATE.render(
|
95
|
-
:"project" => project,
|
96
|
-
:"trace" => trace,
|
97
|
-
:"span" => span
|
98
|
-
)
|
99
|
-
end
|
100
|
-
|
101
82
|
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
102
83
|
# Provides the means for authenticating requests made by the client. This parameter can
|
103
84
|
# be many types.
|
@@ -233,7 +214,7 @@ module Google
|
|
233
214
|
# Required. The name of the project where the spans belong. The format is
|
234
215
|
# `projects/[PROJECT_ID]`.
|
235
216
|
# @param spans [Array<Google::Devtools::Cloudtrace::V2::Span | Hash>]
|
236
|
-
# A list of new spans. The span names must not match existing
|
217
|
+
# Required. A list of new spans. The span names must not match existing
|
237
218
|
# spans, or the results are undefined.
|
238
219
|
# A hash of the same form as `Google::Devtools::Cloudtrace::V2::Span`
|
239
220
|
# can also be provided.
|
@@ -326,18 +307,18 @@ module Google
|
|
326
307
|
# A hash of the same form as `Google::Devtools::Cloudtrace::V2::Span::Links`
|
327
308
|
# can also be provided.
|
328
309
|
# @param status [Google::Rpc::Status | Hash]
|
329
|
-
#
|
310
|
+
# Optional. The final status for this span.
|
330
311
|
# A hash of the same form as `Google::Rpc::Status`
|
331
312
|
# can also be provided.
|
332
313
|
# @param same_process_as_parent_span [Google::Protobuf::BoolValue | Hash]
|
333
|
-
#
|
314
|
+
# Optional. Set this parameter to indicate whether this span is in
|
334
315
|
# the same process as its parent. If you do not set this parameter,
|
335
316
|
# Stackdriver Trace is unable to take advantage of this helpful
|
336
317
|
# information.
|
337
318
|
# A hash of the same form as `Google::Protobuf::BoolValue`
|
338
319
|
# can also be provided.
|
339
320
|
# @param child_span_count [Google::Protobuf::Int32Value | Hash]
|
340
|
-
#
|
321
|
+
# Optional. The number of child spans that were generated while this span
|
341
322
|
# was active. If set, allows implementation to detect missing child spans.
|
342
323
|
# A hash of the same form as `Google::Protobuf::Int32Value`
|
343
324
|
# can also be provided.
|
@@ -353,7 +334,9 @@ module Google
|
|
353
334
|
# require "google/cloud/trace"
|
354
335
|
#
|
355
336
|
# trace_client = Google::Cloud::Trace.new(version: :v2)
|
356
|
-
#
|
337
|
+
#
|
338
|
+
# # TODO: Initialize `name`:
|
339
|
+
# name = ''
|
357
340
|
#
|
358
341
|
# # TODO: Initialize `span_id`:
|
359
342
|
# span_id = ''
|
@@ -366,7 +349,7 @@ module Google
|
|
366
349
|
#
|
367
350
|
# # TODO: Initialize `end_time`:
|
368
351
|
# end_time = {}
|
369
|
-
# response = trace_client.create_span(
|
352
|
+
# response = trace_client.create_span(name, span_id, display_name, start_time, end_time)
|
370
353
|
|
371
354
|
def create_span \
|
372
355
|
name,
|
@@ -11,12 +11,12 @@
|
|
11
11
|
"retry_params": {
|
12
12
|
"default": {
|
13
13
|
"initial_retry_delay_millis": 100,
|
14
|
-
"retry_delay_multiplier": 1.
|
15
|
-
"max_retry_delay_millis":
|
16
|
-
"initial_rpc_timeout_millis":
|
17
|
-
"rpc_timeout_multiplier": 1.
|
18
|
-
"max_rpc_timeout_millis":
|
19
|
-
"total_timeout_millis":
|
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
|
20
20
|
}
|
21
21
|
},
|
22
22
|
"methods": {
|
@@ -27,7 +27,7 @@
|
|
27
27
|
},
|
28
28
|
"CreateSpan": {
|
29
29
|
"timeout_millis": 60000,
|
30
|
-
"retry_codes_name": "
|
30
|
+
"retry_codes_name": "non_idempotent",
|
31
31
|
"retry_params_name": "default"
|
32
32
|
}
|
33
33
|
}
|
@@ -5,6 +5,9 @@
|
|
5
5
|
require 'google/protobuf'
|
6
6
|
|
7
7
|
require 'google/api/annotations_pb'
|
8
|
+
require 'google/api/client_pb'
|
9
|
+
require 'google/api/field_behavior_pb'
|
10
|
+
require 'google/api/resource_pb'
|
8
11
|
require 'google/protobuf/empty_pb'
|
9
12
|
require 'google/protobuf/timestamp_pb'
|
10
13
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/devtools/cloudtrace/v1/trace.proto for package 'google.devtools.cloudtrace.v1'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2019 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.
|
@@ -5,6 +5,9 @@
|
|
5
5
|
require 'google/protobuf'
|
6
6
|
|
7
7
|
require 'google/api/annotations_pb'
|
8
|
+
require 'google/api/client_pb'
|
9
|
+
require 'google/api/field_behavior_pb'
|
10
|
+
require 'google/api/resource_pb'
|
8
11
|
require 'google/devtools/cloudtrace/v2/trace_pb'
|
9
12
|
require 'google/protobuf/empty_pb'
|
10
13
|
require 'google/protobuf/timestamp_pb'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/devtools/cloudtrace/v2/tracing.proto for package 'google.devtools.cloudtrace.v2'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2019 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,6 +15,7 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
+
#
|
18
19
|
|
19
20
|
|
20
21
|
require 'grpc'
|
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.
|
4
|
+
version: 0.37.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: 2019-
|
11
|
+
date: 2019-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|