google-cloud-trace 0.33.1 → 0.33.2

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: 72f583302c7f227c7286b69a817b865126bb46f4e81db80032758a17cbd29bbb
4
- data.tar.gz: cdba7500b430fadb4aca52ab717a0604aa2217f1fa5afc7341f5f0f070d015cf
3
+ metadata.gz: bbe89b5a4aa636dcf475f45b2b41df253c2d1427d481db8ab2cfda9643a12fee
4
+ data.tar.gz: 292766346502eb6508d029dd5e495439cc470ee01b472e4262a81a4dd6a39254
5
5
  SHA512:
6
- metadata.gz: 82a08cfe8604df23297959ce11f140dd316cfa3b692ed27d7b4ff1c7a2854836a38f67e7b835082f6ba1dc27ff78e8b03093487414c4d347b8e1501a2b347bf9
7
- data.tar.gz: 8519a7df8948dc32b16540f0ee1f2e2d0d92d61af90081e824e14f6a1fc499960d9c15b90fc056c2107763119b972129080db4d0dc7adbb6ef39517a7dc89c05
6
+ metadata.gz: 6d355e9fe1200109bdc9713956fb23b819ecf593a2f539bd431feaea61c588eaeb61296a6571bef78b4f1f7e7ec741047d277f57a0dd308cf0c0406331f46311
7
+ data.tar.gz: 91568ca426efe1becad8debc38ffce4f7ef0f6f94d27dbbf104daefc72f5df6797b48f8246c91b4225662261283df586fb76443b4d4921f69a7c66b3a40f7aad
data/.yardopts CHANGED
@@ -1,7 +1,8 @@
1
1
  --no-private
2
2
  --title=Stackdriver Trace
3
- --exclude lib/google/devtools/cloudtrace/v1
3
+ --exclude _pb\.rb$
4
4
  --markup markdown
5
+ --markup-provider redcarpet
5
6
 
6
7
  ./lib/**/*.rb
7
8
  -
data/README.md CHANGED
@@ -207,14 +207,14 @@ end
207
207
 
208
208
  ## Supported Ruby Versions
209
209
 
210
- This library is supported on Ruby 2.0+.
211
-
212
- However, Ruby 2.3 or later is strongly recommended, as earlier releases have
213
- reached or are nearing end-of-life. After June 1, 2018, Google will provide
214
- official support only for Ruby versions that are considered current and
215
- supported by Ruby Core (that is, Ruby versions that are either in normal
216
- maintenance or in security maintenance).
217
- See https://www.ruby-lang.org/en/downloads/branches/ for further details.
210
+ This library is supported on Ruby 2.3+.
211
+
212
+ Google provides official support for Ruby versions that are actively supported
213
+ by Ruby Core—that is, Ruby versions that are either in normal maintenance or
214
+ in security maintenance, and not end of life. Currently, this means Ruby 2.3
215
+ and later. Older versions of Ruby _may_ still work, but are unsupported and not
216
+ recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
217
+ about the Ruby support schedule.
218
218
 
219
219
  ## Versioning
220
220
 
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- require "googleauth"
16
+ require "google/cloud/trace/v1/credentials"
17
17
 
18
18
  module Google
19
19
  module Cloud
@@ -37,20 +37,7 @@ module Google
37
37
  #
38
38
  # trace.project_id #=> "my-project"
39
39
  #
40
- class Credentials < Google::Auth::Credentials
41
- SCOPE = ["https://www.googleapis.com/auth/cloud-platform"].freeze
42
- PATH_ENV_VARS = %w[TRACE_CREDENTIALS
43
- TRACE_KEYFILE
44
- GOOGLE_CLOUD_CREDENTIALS
45
- GOOGLE_CLOUD_KEYFILE
46
- GCLOUD_KEYFILE].freeze
47
- JSON_ENV_VARS = %w[TRACE_CREDENTIALS_JSON
48
- TRACE_KEYFILE_JSON
49
- GOOGLE_CLOUD_CREDENTIALS_JSON
50
- GOOGLE_CLOUD_KEYFILE_JSON
51
- GCLOUD_KEYFILE_JSON].freeze
52
- DEFAULT_PATHS = \
53
- ["~/.config/gcloud/application_default_credentials.json"].freeze
40
+ class Credentials < Google::Cloud::Trace::V1::Credentials
54
41
  end
55
42
  end
56
43
  end
@@ -0,0 +1,38 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "googleauth"
16
+
17
+ module Google
18
+ module Cloud
19
+ module Trace
20
+ module V1
21
+ class Credentials < Google::Auth::Credentials
22
+ SCOPE = ["https://www.googleapis.com/auth/cloud-platform"].freeze
23
+ PATH_ENV_VARS = %w(TRACE_CREDENTIALS
24
+ TRACE_KEYFILE
25
+ GOOGLE_CLOUD_CREDENTIALS
26
+ GOOGLE_CLOUD_KEYFILE
27
+ GCLOUD_KEYFILE)
28
+ JSON_ENV_VARS = %w(TRACE_CREDENTIALS_JSON
29
+ TRACE_KEYFILE_JSON
30
+ GOOGLE_CLOUD_CREDENTIALS_JSON
31
+ GOOGLE_CLOUD_KEYFILE_JSON
32
+ GCLOUD_KEYFILE_JSON)
33
+ DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -15,17 +15,6 @@
15
15
  module Google
16
16
  module Devtools
17
17
  module Cloudtrace
18
- ##
19
- # # Stackdriver Trace API Contents
20
- #
21
- # | Class | Description |
22
- # | ----- | ----------- |
23
- # | [TraceServiceClient][] | Send and retrieve trace data from Stackdriver Trace. Data is generated and available by default for all App Engine applications. Data from other applications can be written to Stackdriver Trace for display, reporting, and analysis. |
24
- # | [Data Types][] | Data types for Google::Cloud::Trace::V1 |
25
- #
26
- # [TraceServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-trace/latest/google/devtools/cloudtrace/v1/traceserviceclient
27
- # [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-trace/latest/google/devtools/cloudtrace/v1/datatypes
28
- #
29
18
  module V1
30
19
  # A trace describes how long it takes for an application to perform an
31
20
  # operation. It consists of a set of spans, each of which represent a single
@@ -66,7 +55,7 @@ module Google
66
55
  # @return [String]
67
56
  # Name of the span. Must be less than 128 bytes. The span name is sanitized
68
57
  # and displayed in the Stackdriver Trace tool in the
69
- # {% dynamic print site_values.console_name %}.
58
+ # Google Cloud Platform Console.
70
59
  # The name may be a method name or some other per-call site name.
71
60
  # For the same executable and the same call point, a best practice is
72
61
  # to use a consistent name, which makes it easier to correlate
@@ -106,9 +95,11 @@ module Google
106
95
  # * +/http/client_region+
107
96
  # * +/http/host+
108
97
  # * +/http/method+
98
+ # * +/http/path+
109
99
  # * +/http/redirected_url+
110
100
  # * +/http/request/size+
111
101
  # * +/http/response/size+
102
+ # * +/http/route+
112
103
  # * +/http/status_code+
113
104
  # * +/http/url+
114
105
  # * +/http/user_agent+
@@ -0,0 +1,28 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Protobuf
17
+ # A generic empty message that you can re-use to avoid defining duplicated
18
+ # empty messages in your APIs. A typical example is to use it as the request
19
+ # or the response type of an API method. For instance:
20
+ #
21
+ # service Foo {
22
+ # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
23
+ # }
24
+ #
25
+ # The JSON representation for +Empty+ is empty JSON object +{}+.
26
+ class Empty; end
27
+ end
28
+ end
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -18,9 +18,6 @@
18
18
  # and updates to that file get reflected here through a refresh process.
19
19
  # For the short term, the refresh process will only be runnable by Google
20
20
  # engineers.
21
- #
22
- # The only allowed edits are to method and file documentation. A 3-way
23
- # merge preserves those additions if the generated source changes.
24
21
 
25
22
  require "json"
26
23
  require "pathname"
@@ -28,7 +25,7 @@ require "pathname"
28
25
  require "google/gax"
29
26
 
30
27
  require "google/devtools/cloudtrace/v1/trace_pb"
31
- require "google/cloud/trace/credentials"
28
+ require "google/cloud/trace/v1/credentials"
32
29
 
33
30
  module Google
34
31
  module Cloud
@@ -51,6 +48,9 @@ module Google
51
48
  # The default port of the service.
52
49
  DEFAULT_SERVICE_PORT = 443
53
50
 
51
+ # The default set of gRPC interceptors.
52
+ GRPC_INTERCEPTORS = []
53
+
54
54
  DEFAULT_TIMEOUT = 30
55
55
 
56
56
  PAGE_DESCRIPTORS = {
@@ -70,6 +70,7 @@ module Google
70
70
  "https://www.googleapis.com/auth/trace.readonly"
71
71
  ].freeze
72
72
 
73
+
73
74
  # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
74
75
  # Provides the means for authenticating requests made by the client. This parameter can
75
76
  # be many types.
@@ -94,16 +95,18 @@ module Google
94
95
  # or the specified config is missing data points.
95
96
  # @param timeout [Numeric]
96
97
  # The default timeout, in seconds, for calls made through this client.
98
+ # @param metadata [Hash]
99
+ # Default metadata to be sent with each request. This can be overridden on a per call basis.
100
+ # @param exception_transformer [Proc]
101
+ # An optional proc that intercepts any exceptions raised during an API call to inject
102
+ # custom error handling.
97
103
  def initialize \
98
- service_path: SERVICE_ADDRESS,
99
- port: DEFAULT_SERVICE_PORT,
100
- channel: nil,
101
- chan_creds: nil,
102
- updater_proc: nil,
103
104
  credentials: nil,
104
105
  scopes: ALL_SCOPES,
105
106
  client_config: {},
106
107
  timeout: DEFAULT_TIMEOUT,
108
+ metadata: nil,
109
+ exception_transformer: nil,
107
110
  lib_name: nil,
108
111
  lib_version: ""
109
112
  # These require statements are intentionally placed here to initialize
@@ -112,21 +115,10 @@ module Google
112
115
  require "google/gax/grpc"
113
116
  require "google/devtools/cloudtrace/v1/trace_services_pb"
114
117
 
115
- if channel || chan_creds || updater_proc
116
- warn "The `channel`, `chan_creds`, and `updater_proc` parameters will be removed " \
117
- "on 2017/09/08"
118
- credentials ||= channel
119
- credentials ||= chan_creds
120
- credentials ||= updater_proc
121
- end
122
- if service_path != SERVICE_ADDRESS || port != DEFAULT_SERVICE_PORT
123
- warn "`service_path` and `port` parameters are deprecated and will be removed"
124
- end
125
-
126
- credentials ||= Google::Cloud::Trace::Credentials.default
118
+ credentials ||= Google::Cloud::Trace::V1::Credentials.default
127
119
 
128
120
  if credentials.is_a?(String) || credentials.is_a?(Hash)
129
- updater_proc = Google::Cloud::Trace::Credentials.new(credentials).updater_proc
121
+ updater_proc = Google::Cloud::Trace::V1::Credentials.new(credentials).updater_proc
130
122
  end
131
123
  if credentials.is_a?(GRPC::Core::Channel)
132
124
  channel = credentials
@@ -141,13 +133,16 @@ module Google
141
133
  updater_proc = credentials.updater_proc
142
134
  end
143
135
 
136
+ package_version = Gem.loaded_specs['google-cloud-trace'].version.version
137
+
144
138
  google_api_client = "gl-ruby/#{RUBY_VERSION}"
145
139
  google_api_client << " #{lib_name}/#{lib_version}" if lib_name
146
- google_api_client << " gapic/0.1.0 gax/#{Google::Gax::VERSION}"
140
+ google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
147
141
  google_api_client << " grpc/#{GRPC::VERSION}"
148
142
  google_api_client.freeze
149
143
 
150
144
  headers = { :"x-goog-api-client" => google_api_client }
145
+ headers.merge!(metadata) unless metadata.nil?
151
146
  client_config_file = Pathname.new(__dir__).join(
152
147
  "trace_service_client_config.json"
153
148
  )
@@ -160,9 +155,14 @@ module Google
160
155
  timeout,
161
156
  page_descriptors: PAGE_DESCRIPTORS,
162
157
  errors: Google::Gax::Grpc::API_ERRORS,
163
- kwargs: headers
158
+ metadata: headers
164
159
  )
165
160
  end
161
+
162
+ # Allow overriding the service path/port in subclasses.
163
+ service_path = self.class::SERVICE_ADDRESS
164
+ port = self.class::DEFAULT_SERVICE_PORT
165
+ interceptors = self.class::GRPC_INTERCEPTORS
166
166
  @trace_service_stub = Google::Gax::Grpc.create_stub(
167
167
  service_path,
168
168
  port,
@@ -170,25 +170,113 @@ module Google
170
170
  channel: channel,
171
171
  updater_proc: updater_proc,
172
172
  scopes: scopes,
173
+ interceptors: interceptors,
173
174
  &Google::Devtools::Cloudtrace::V1::TraceService::Stub.method(:new)
174
175
  )
175
176
 
176
- @list_traces = Google::Gax.create_api_call(
177
- @trace_service_stub.method(:list_traces),
178
- defaults["list_traces"]
177
+ @patch_traces = Google::Gax.create_api_call(
178
+ @trace_service_stub.method(:patch_traces),
179
+ defaults["patch_traces"],
180
+ exception_transformer: exception_transformer
179
181
  )
180
182
  @get_trace = Google::Gax.create_api_call(
181
183
  @trace_service_stub.method(:get_trace),
182
- defaults["get_trace"]
184
+ defaults["get_trace"],
185
+ exception_transformer: exception_transformer
183
186
  )
184
- @patch_traces = Google::Gax.create_api_call(
185
- @trace_service_stub.method(:patch_traces),
186
- defaults["patch_traces"]
187
+ @list_traces = Google::Gax.create_api_call(
188
+ @trace_service_stub.method(:list_traces),
189
+ defaults["list_traces"],
190
+ exception_transformer: exception_transformer
187
191
  )
188
192
  end
189
193
 
190
194
  # Service calls
191
195
 
196
+ # Sends new traces to Stackdriver Trace or updates existing traces. If the ID
197
+ # of a trace that you send matches that of an existing trace, any fields
198
+ # in the existing trace and its spans are overwritten by the provided values,
199
+ # and any new fields provided are merged with the existing trace data. If the
200
+ # ID does not match, a new trace is created.
201
+ #
202
+ # @param project_id [String]
203
+ # ID of the Cloud project where the trace data is stored.
204
+ # @param traces [Google::Devtools::Cloudtrace::V1::Traces | Hash]
205
+ # The body of the message.
206
+ # A hash of the same form as `Google::Devtools::Cloudtrace::V1::Traces`
207
+ # can also be provided.
208
+ # @param options [Google::Gax::CallOptions]
209
+ # Overrides the default settings for this call, e.g, timeout,
210
+ # retries, etc.
211
+ # @yield [result, operation] Access the result along with the RPC operation
212
+ # @yieldparam result []
213
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
214
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
215
+ # @example
216
+ # require "google/cloud/trace"
217
+ #
218
+ # trace_service_client = Google::Cloud::Trace.new(version: :v1)
219
+ #
220
+ # # TODO: Initialize +project_id+:
221
+ # project_id = ''
222
+ #
223
+ # # TODO: Initialize +traces+:
224
+ # traces = {}
225
+ # trace_service_client.patch_traces(project_id, traces)
226
+
227
+ def patch_traces \
228
+ project_id,
229
+ traces,
230
+ options: nil,
231
+ &block
232
+ req = {
233
+ project_id: project_id,
234
+ traces: traces
235
+ }.delete_if { |_, v| v.nil? }
236
+ req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::PatchTracesRequest)
237
+ @patch_traces.call(req, options, &block)
238
+ nil
239
+ end
240
+
241
+ # Gets a single trace by its ID.
242
+ #
243
+ # @param project_id [String]
244
+ # ID of the Cloud project where the trace data is stored.
245
+ # @param trace_id [String]
246
+ # ID of the trace to return.
247
+ # @param options [Google::Gax::CallOptions]
248
+ # Overrides the default settings for this call, e.g, timeout,
249
+ # retries, etc.
250
+ # @yield [result, operation] Access the result along with the RPC operation
251
+ # @yieldparam result [Google::Devtools::Cloudtrace::V1::Trace]
252
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
253
+ # @return [Google::Devtools::Cloudtrace::V1::Trace]
254
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
255
+ # @example
256
+ # require "google/cloud/trace"
257
+ #
258
+ # trace_service_client = Google::Cloud::Trace.new(version: :v1)
259
+ #
260
+ # # TODO: Initialize +project_id+:
261
+ # project_id = ''
262
+ #
263
+ # # TODO: Initialize +trace_id+:
264
+ # trace_id = ''
265
+ # response = trace_service_client.get_trace(project_id, trace_id)
266
+
267
+ def get_trace \
268
+ project_id,
269
+ trace_id,
270
+ options: nil,
271
+ &block
272
+ req = {
273
+ project_id: project_id,
274
+ trace_id: trace_id
275
+ }.delete_if { |_, v| v.nil? }
276
+ req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::GetTraceRequest)
277
+ @get_trace.call(req, options, &block)
278
+ end
279
+
192
280
  # Returns of a list of traces that match the specified filter conditions.
193
281
  #
194
282
  # @param project_id [String]
@@ -197,11 +285,9 @@ module Google
197
285
  # Type of data returned for traces in the list. Optional. Default is
198
286
  # +MINIMAL+.
199
287
  # @param page_size [Integer]
200
- # The maximum number of resources contained in the underlying API
201
- # response. If page streaming is performed per-resource, this
202
- # parameter does not affect the return value. If page streaming is
203
- # performed per-page, this determines the maximum number of
204
- # resources in a page.
288
+ # Maximum number of traces to return. If not specified or <= 0, the
289
+ # implementation selects a reasonable value. The implementation may
290
+ # return fewer traces than the requested page size. Optional.
205
291
  # @param start_time [Google::Protobuf::Timestamp | Hash]
206
292
  # Start of the time interval (inclusive) during which the trace data was
207
293
  # collected from the application.
@@ -260,6 +346,9 @@ module Google
260
346
  # @param options [Google::Gax::CallOptions]
261
347
  # Overrides the default settings for this call, e.g, timeout,
262
348
  # retries, etc.
349
+ # @yield [result, operation] Access the result along with the RPC operation
350
+ # @yieldparam result [Google::Gax::PagedEnumerable<Google::Devtools::Cloudtrace::V1::Trace>]
351
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
263
352
  # @return [Google::Gax::PagedEnumerable<Google::Devtools::Cloudtrace::V1::Trace>]
264
353
  # An enumerable of Google::Devtools::Cloudtrace::V1::Trace instances.
265
354
  # See Google::Gax::PagedEnumerable documentation for other
@@ -267,9 +356,11 @@ module Google
267
356
  # object.
268
357
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
269
358
  # @example
270
- # require "google/cloud/trace/v1"
359
+ # require "google/cloud/trace"
271
360
  #
272
- # trace_service_client = Google::Cloud::Trace::V1.new
361
+ # trace_service_client = Google::Cloud::Trace.new(version: :v1)
362
+ #
363
+ # # TODO: Initialize +project_id+:
273
364
  # project_id = ''
274
365
  #
275
366
  # # Iterate over all results.
@@ -293,7 +384,8 @@ module Google
293
384
  end_time: nil,
294
385
  filter: nil,
295
386
  order_by: nil,
296
- options: nil
387
+ options: nil,
388
+ &block
297
389
  req = {
298
390
  project_id: project_id,
299
391
  view: view,
@@ -304,75 +396,7 @@ module Google
304
396
  order_by: order_by
305
397
  }.delete_if { |_, v| v.nil? }
306
398
  req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::ListTracesRequest)
307
- @list_traces.call(req, options)
308
- end
309
-
310
- # Gets a single trace by its ID.
311
- #
312
- # @param project_id [String]
313
- # ID of the Cloud project where the trace data is stored.
314
- # @param trace_id [String]
315
- # ID of the trace to return.
316
- # @param options [Google::Gax::CallOptions]
317
- # Overrides the default settings for this call, e.g, timeout,
318
- # retries, etc.
319
- # @return [Google::Devtools::Cloudtrace::V1::Trace]
320
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
321
- # @example
322
- # require "google/cloud/trace/v1"
323
- #
324
- # trace_service_client = Google::Cloud::Trace::V1.new
325
- # project_id = ''
326
- # trace_id = ''
327
- # response = trace_service_client.get_trace(project_id, trace_id)
328
-
329
- def get_trace \
330
- project_id,
331
- trace_id,
332
- options: nil
333
- req = {
334
- project_id: project_id,
335
- trace_id: trace_id
336
- }.delete_if { |_, v| v.nil? }
337
- req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::GetTraceRequest)
338
- @get_trace.call(req, options)
339
- end
340
-
341
- # Sends new traces to Stackdriver Trace or updates existing traces. If the ID
342
- # of a trace that you send matches that of an existing trace, any fields
343
- # in the existing trace and its spans are overwritten by the provided values,
344
- # and any new fields provided are merged with the existing trace data. If the
345
- # ID does not match, a new trace is created.
346
- #
347
- # @param project_id [String]
348
- # ID of the Cloud project where the trace data is stored.
349
- # @param traces [Google::Devtools::Cloudtrace::V1::Traces | Hash]
350
- # The body of the message.
351
- # A hash of the same form as `Google::Devtools::Cloudtrace::V1::Traces`
352
- # can also be provided.
353
- # @param options [Google::Gax::CallOptions]
354
- # Overrides the default settings for this call, e.g, timeout,
355
- # retries, etc.
356
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
357
- # @example
358
- # require "google/cloud/trace/v1"
359
- #
360
- # trace_service_client = Google::Cloud::Trace::V1.new
361
- # project_id = ''
362
- # traces = {}
363
- # trace_service_client.patch_traces(project_id, traces)
364
-
365
- def patch_traces \
366
- project_id,
367
- traces,
368
- options: nil
369
- req = {
370
- project_id: project_id,
371
- traces: traces
372
- }.delete_if { |_, v| v.nil? }
373
- req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V1::PatchTracesRequest)
374
- @patch_traces.call(req, options)
375
- nil
399
+ @list_traces.call(req, options, &block)
376
400
  end
377
401
  end
378
402
  end
@@ -17,32 +17,23 @@
17
17
  "rpc_timeout_multiplier": 1.5,
18
18
  "max_rpc_timeout_millis": 30000,
19
19
  "total_timeout_millis": 45000
20
- },
21
- "write_sink": {
22
- "initial_retry_delay_millis": 100,
23
- "retry_delay_multiplier": 1.2,
24
- "max_retry_delay_millis": 1000,
25
- "initial_rpc_timeout_millis": 30000,
26
- "rpc_timeout_multiplier": 1.5,
27
- "max_rpc_timeout_millis": 60000,
28
- "total_timeout_millis": 120000
29
20
  }
30
21
  },
31
22
  "methods": {
32
- "ListTraces": {
33
- "timeout_millis": 60000,
23
+ "PatchTraces": {
24
+ "timeout_millis": 30000,
34
25
  "retry_codes_name": "idempotent",
35
26
  "retry_params_name": "default"
36
27
  },
37
28
  "GetTrace": {
38
- "timeout_millis": 60000,
29
+ "timeout_millis": 30000,
39
30
  "retry_codes_name": "idempotent",
40
31
  "retry_params_name": "default"
41
32
  },
42
- "PatchTraces": {
33
+ "ListTraces": {
43
34
  "timeout_millis": 30000,
44
- "retry_codes_name": "non_idempotent",
45
- "retry_params_name": "write_sink"
35
+ "retry_codes_name": "idempotent",
36
+ "retry_params_name": "default"
46
37
  }
47
38
  }
48
39
  }
@@ -0,0 +1,38 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "googleauth"
16
+
17
+ module Google
18
+ module Cloud
19
+ module Trace
20
+ module V2
21
+ class Credentials < Google::Auth::Credentials
22
+ SCOPE = ["https://www.googleapis.com/auth/cloud-platform"].freeze
23
+ PATH_ENV_VARS = %w(TRACE_CREDENTIALS
24
+ TRACE_KEYFILE
25
+ GOOGLE_CLOUD_CREDENTIALS
26
+ GOOGLE_CLOUD_KEYFILE
27
+ GCLOUD_KEYFILE)
28
+ JSON_ENV_VARS = %w(TRACE_CREDENTIALS_JSON
29
+ TRACE_KEYFILE_JSON
30
+ GOOGLE_CLOUD_CREDENTIALS_JSON
31
+ GOOGLE_CLOUD_KEYFILE_JSON
32
+ GCLOUD_KEYFILE_JSON)
33
+ DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ module Google
44
44
  # @return [Google::Devtools::Cloudtrace::V2::TruncatableString]
45
45
  # A description of the span's operation (up to 128 bytes).
46
46
  # Stackdriver Trace displays the description in the
47
- # {% dynamic print site_values.console_name %}.
47
+ # Google Cloud Platform Console.
48
48
  # For example, the display name can be a qualified method name or a file name
49
49
  # and a line number where the operation is called. A best practice is to use
50
50
  # the same display name within an application and at the same call point.
@@ -0,0 +1,32 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Devtools
17
+ module Cloudtrace
18
+ module V2
19
+ # The request message for the +BatchWriteSpans+ method.
20
+ # @!attribute [rw] name
21
+ # @return [String]
22
+ # Required. The name of the project where the spans belong. The format is
23
+ # +projects/[PROJECT_ID]+.
24
+ # @!attribute [rw] spans
25
+ # @return [Array<Google::Devtools::Cloudtrace::V2::Span>]
26
+ # A list of new spans. The span names must not match existing
27
+ # spans, or the results are undefined.
28
+ class BatchWriteSpansRequest; end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -0,0 +1,28 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Protobuf
17
+ # A generic empty message that you can re-use to avoid defining duplicated
18
+ # empty messages in your APIs. A typical example is to use it as the request
19
+ # or the response type of an API method. For instance:
20
+ #
21
+ # service Foo {
22
+ # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
23
+ # }
24
+ #
25
+ # The JSON representation for +Empty+ is empty JSON object +{}+.
26
+ class Empty; end
27
+ end
28
+ end
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2017 Google LLC
1
+ # Copyright 2018 Google LLC
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -18,9 +18,6 @@
18
18
  # and updates to that file get reflected here through a refresh process.
19
19
  # For the short term, the refresh process will only be runnable by Google
20
20
  # engineers.
21
- #
22
- # The only allowed edits are to method and file documentation. A 3-way
23
- # merge preserves those additions if the generated source changes.
24
21
 
25
22
  require "json"
26
23
  require "pathname"
@@ -28,7 +25,7 @@ require "pathname"
28
25
  require "google/gax"
29
26
 
30
27
  require "google/devtools/cloudtrace/v2/tracing_pb"
31
- require "google/cloud/trace/credentials"
28
+ require "google/cloud/trace/v2/credentials"
32
29
 
33
30
  module Google
34
31
  module Cloud
@@ -51,6 +48,9 @@ module Google
51
48
  # The default port of the service.
52
49
  DEFAULT_SERVICE_PORT = 443
53
50
 
51
+ # The default set of gRPC interceptors.
52
+ GRPC_INTERCEPTORS = []
53
+
54
54
  DEFAULT_TIMEOUT = 30
55
55
 
56
56
  # The scopes needed to make gRPC calls to all of the methods defined in
@@ -119,11 +119,18 @@ module Google
119
119
  # or the specified config is missing data points.
120
120
  # @param timeout [Numeric]
121
121
  # The default timeout, in seconds, for calls made through this client.
122
+ # @param metadata [Hash]
123
+ # Default metadata to be sent with each request. This can be overridden on a per call basis.
124
+ # @param exception_transformer [Proc]
125
+ # An optional proc that intercepts any exceptions raised during an API call to inject
126
+ # custom error handling.
122
127
  def initialize \
123
128
  credentials: nil,
124
129
  scopes: ALL_SCOPES,
125
130
  client_config: {},
126
131
  timeout: DEFAULT_TIMEOUT,
132
+ metadata: nil,
133
+ exception_transformer: nil,
127
134
  lib_name: nil,
128
135
  lib_version: ""
129
136
  # These require statements are intentionally placed here to initialize
@@ -132,10 +139,10 @@ module Google
132
139
  require "google/gax/grpc"
133
140
  require "google/devtools/cloudtrace/v2/tracing_services_pb"
134
141
 
135
- credentials ||= Google::Cloud::Trace::Credentials.default
142
+ credentials ||= Google::Cloud::Trace::V2::Credentials.default
136
143
 
137
144
  if credentials.is_a?(String) || credentials.is_a?(Hash)
138
- updater_proc = Google::Cloud::Trace::Credentials.new(credentials).updater_proc
145
+ updater_proc = Google::Cloud::Trace::V2::Credentials.new(credentials).updater_proc
139
146
  end
140
147
  if credentials.is_a?(GRPC::Core::Channel)
141
148
  channel = credentials
@@ -159,6 +166,7 @@ module Google
159
166
  google_api_client.freeze
160
167
 
161
168
  headers = { :"x-goog-api-client" => google_api_client }
169
+ headers.merge!(metadata) unless metadata.nil?
162
170
  client_config_file = Pathname.new(__dir__).join(
163
171
  "trace_service_client_config.json"
164
172
  )
@@ -170,13 +178,14 @@ module Google
170
178
  Google::Gax::Grpc::STATUS_CODE_NAMES,
171
179
  timeout,
172
180
  errors: Google::Gax::Grpc::API_ERRORS,
173
- kwargs: headers
181
+ metadata: headers
174
182
  )
175
183
  end
176
184
 
177
185
  # Allow overriding the service path/port in subclasses.
178
186
  service_path = self.class::SERVICE_ADDRESS
179
187
  port = self.class::DEFAULT_SERVICE_PORT
188
+ interceptors = self.class::GRPC_INTERCEPTORS
180
189
  @trace_service_stub = Google::Gax::Grpc.create_stub(
181
190
  service_path,
182
191
  port,
@@ -184,16 +193,19 @@ module Google
184
193
  channel: channel,
185
194
  updater_proc: updater_proc,
186
195
  scopes: scopes,
196
+ interceptors: interceptors,
187
197
  &Google::Devtools::Cloudtrace::V2::TraceService::Stub.method(:new)
188
198
  )
189
199
 
190
200
  @batch_write_spans = Google::Gax.create_api_call(
191
201
  @trace_service_stub.method(:batch_write_spans),
192
- defaults["batch_write_spans"]
202
+ defaults["batch_write_spans"],
203
+ exception_transformer: exception_transformer
193
204
  )
194
205
  @create_span = Google::Gax.create_api_call(
195
206
  @trace_service_stub.method(:create_span),
196
- defaults["create_span"]
207
+ defaults["create_span"],
208
+ exception_transformer: exception_transformer
197
209
  )
198
210
  end
199
211
 
@@ -213,25 +225,31 @@ module Google
213
225
  # @param options [Google::Gax::CallOptions]
214
226
  # Overrides the default settings for this call, e.g, timeout,
215
227
  # retries, etc.
228
+ # @yield [result, operation] Access the result along with the RPC operation
229
+ # @yieldparam result []
230
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
216
231
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
217
232
  # @example
218
- # require "google/cloud/trace/v2"
233
+ # require "google/cloud/trace"
219
234
  #
220
- # trace_service_client = Google::Cloud::Trace::V2.new
235
+ # trace_service_client = Google::Cloud::Trace.new(version: :v2)
221
236
  # formatted_name = Google::Cloud::Trace::V2::TraceServiceClient.project_path("[PROJECT]")
237
+ #
238
+ # # TODO: Initialize +spans+:
222
239
  # spans = []
223
240
  # trace_service_client.batch_write_spans(formatted_name, spans)
224
241
 
225
242
  def batch_write_spans \
226
243
  name,
227
244
  spans,
228
- options: nil
245
+ options: nil,
246
+ &block
229
247
  req = {
230
248
  name: name,
231
249
  spans: spans
232
250
  }.delete_if { |_, v| v.nil? }
233
251
  req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V2::BatchWriteSpansRequest)
234
- @batch_write_spans.call(req, options)
252
+ @batch_write_spans.call(req, options, &block)
235
253
  nil
236
254
  end
237
255
 
@@ -252,7 +270,7 @@ module Google
252
270
  # @param display_name [Google::Devtools::Cloudtrace::V2::TruncatableString | Hash]
253
271
  # A description of the span's operation (up to 128 bytes).
254
272
  # Stackdriver Trace displays the description in the
255
- # {% dynamic print site_values.console_name %}.
273
+ # Google Cloud Platform Console.
256
274
  # For example, the display name can be a qualified method name or a file name
257
275
  # and a line number where the operation is called. A best practice is to use
258
276
  # the same display name within an application and at the same call point.
@@ -311,16 +329,27 @@ module Google
311
329
  # @param options [Google::Gax::CallOptions]
312
330
  # Overrides the default settings for this call, e.g, timeout,
313
331
  # retries, etc.
332
+ # @yield [result, operation] Access the result along with the RPC operation
333
+ # @yieldparam result [Google::Devtools::Cloudtrace::V2::Span]
334
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
314
335
  # @return [Google::Devtools::Cloudtrace::V2::Span]
315
336
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
316
337
  # @example
317
- # require "google/cloud/trace/v2"
338
+ # require "google/cloud/trace"
318
339
  #
319
- # trace_service_client = Google::Cloud::Trace::V2.new
340
+ # trace_service_client = Google::Cloud::Trace.new(version: :v2)
320
341
  # formatted_name = Google::Cloud::Trace::V2::TraceServiceClient.span_path("[PROJECT]", "[TRACE]", "[SPAN]")
342
+ #
343
+ # # TODO: Initialize +span_id+:
321
344
  # span_id = ''
345
+ #
346
+ # # TODO: Initialize +display_name+:
322
347
  # display_name = {}
348
+ #
349
+ # # TODO: Initialize +start_time+:
323
350
  # start_time = {}
351
+ #
352
+ # # TODO: Initialize +end_time+:
324
353
  # end_time = {}
325
354
  # response = trace_service_client.create_span(formatted_name, span_id, display_name, start_time, end_time)
326
355
 
@@ -338,7 +367,8 @@ module Google
338
367
  status: nil,
339
368
  same_process_as_parent_span: nil,
340
369
  child_span_count: nil,
341
- options: nil
370
+ options: nil,
371
+ &block
342
372
  req = {
343
373
  name: name,
344
374
  span_id: span_id,
@@ -355,7 +385,7 @@ module Google
355
385
  child_span_count: child_span_count
356
386
  }.delete_if { |_, v| v.nil? }
357
387
  req = Google::Gax::to_proto(req, Google::Devtools::Cloudtrace::V2::Span)
358
- @create_span.call(req, options)
388
+ @create_span.call(req, options, &block)
359
389
  end
360
390
  end
361
391
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Trace
19
- VERSION = "0.33.1".freeze
19
+ VERSION = "0.33.2".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -7,7 +7,7 @@
7
7
  # you may not use this file except in compliance with the License.
8
8
  # You may obtain a copy of the License at
9
9
  #
10
- # https://www.apache.org/licenses/LICENSE-2.0
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
11
  #
12
12
  # Unless required by applicable law or agreed to in writing, software
13
13
  # distributed under the License is distributed on an "AS IS" BASIS,
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.33.1
4
+ version: 0.33.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-06 00:00:00.000000000 Z
11
+ date: 2018-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
47
+ version: '1.3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.0'
54
+ version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '4.0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: redcarpet
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '3.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '3.0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: rubocop
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -250,18 +264,21 @@ files:
250
264
  - lib/google/cloud/trace/trace_record.rb
251
265
  - lib/google/cloud/trace/utils.rb
252
266
  - lib/google/cloud/trace/v1.rb
267
+ - lib/google/cloud/trace/v1/credentials.rb
253
268
  - lib/google/cloud/trace/v1/doc/google/devtools/cloudtrace/v1/trace.rb
269
+ - lib/google/cloud/trace/v1/doc/google/protobuf/empty.rb
254
270
  - lib/google/cloud/trace/v1/doc/google/protobuf/timestamp.rb
255
- - lib/google/cloud/trace/v1/doc/overview.rb
256
271
  - lib/google/cloud/trace/v1/trace_service_client.rb
257
272
  - lib/google/cloud/trace/v1/trace_service_client_config.json
258
273
  - lib/google/cloud/trace/v2.rb
274
+ - lib/google/cloud/trace/v2/credentials.rb
259
275
  - lib/google/cloud/trace/v2/doc/google/devtools/cloudtrace/v2/trace.rb
276
+ - lib/google/cloud/trace/v2/doc/google/devtools/cloudtrace/v2/tracing.rb
260
277
  - lib/google/cloud/trace/v2/doc/google/protobuf/any.rb
278
+ - lib/google/cloud/trace/v2/doc/google/protobuf/empty.rb
261
279
  - lib/google/cloud/trace/v2/doc/google/protobuf/timestamp.rb
262
280
  - lib/google/cloud/trace/v2/doc/google/protobuf/wrappers.rb
263
281
  - lib/google/cloud/trace/v2/doc/google/rpc/status.rb
264
- - lib/google/cloud/trace/v2/doc/overview.rb
265
282
  - lib/google/cloud/trace/v2/trace_service_client.rb
266
283
  - lib/google/cloud/trace/v2/trace_service_client_config.json
267
284
  - lib/google/cloud/trace/version.rb
@@ -1,56 +0,0 @@
1
- # Copyright 2017 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- module Google
16
- module Cloud
17
- # rubocop:disable LineLength
18
-
19
- ##
20
- # # Ruby Client for Stackdriver Trace API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
21
- #
22
- # [Stackdriver Trace API][Product Documentation]:
23
- # Send and retrieve trace data from Stackdriver Trace. Data is generated and
24
- # available by default for all App Engine applications. Data from other
25
- # applications can be written to Stackdriver Trace for display, reporting, and
26
- # analysis.
27
- # - [Product Documentation][]
28
- #
29
- # ## Quick Start
30
- # In order to use this library, you first need to go through the following
31
- # steps:
32
- #
33
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
34
- # 2. [Enable the Stackdriver Trace API.](https://console.cloud.google.com/apis/api/cloudtrace)
35
- # 3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
36
- #
37
- # ### Installation
38
- # ```
39
- # $ gem install google-cloud-trace
40
- # ```
41
- #
42
- # ### Next Steps
43
- # - Read the [Stackdriver Trace API Product documentation][Product Documentation]
44
- # to learn more about the product and see How-to Guides.
45
- # - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
46
- # to see the full list of Cloud APIs that we cover.
47
- #
48
- # [Product Documentation]: https://cloud.google.com/cloudtrace
49
- #
50
- #
51
- module Trace
52
- module V1
53
- end
54
- end
55
- end
56
- end
@@ -1,67 +0,0 @@
1
- # Copyright 2017 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- module Google
16
- module Cloud
17
- # rubocop:disable LineLength
18
-
19
- ##
20
- # # Ruby Client for Stackdriver Trace API ([Beta](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
21
- #
22
- # [Stackdriver Trace API][Product Documentation]:
23
- # Sends application trace data to Stackdriver Trace for viewing. Trace data is
24
- # collected for all App Engine applications by default. Trace data from other
25
- # applications can be provided using this API.
26
- # - [Product Documentation][]
27
- #
28
- # ## Quick Start
29
- # In order to use this library, you first need to go through the following
30
- # steps:
31
- #
32
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
33
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
34
- # 3. [Enable the Stackdriver Trace API.](https://console.cloud.google.com/apis/api/trace)
35
- # 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
36
- #
37
- # ### Installation
38
- # ```
39
- # $ gem install google-cloud-trace
40
- # ```
41
- #
42
- # ### Preview
43
- # #### TraceServiceClient
44
- # ```rb
45
- # require "google/cloud/trace"
46
- #
47
- # trace_service_client = Google::Cloud::Trace.new
48
- # formatted_name = Google::Cloud::Trace::V2::TraceServiceClient.project_path(project_id)
49
- # spans = []
50
- # trace_service_client.batch_write_spans(formatted_name, spans)
51
- # ```
52
- #
53
- # ### Next Steps
54
- # - Read the [Stackdriver Trace API Product documentation][Product Documentation]
55
- # to learn more about the product and see How-to Guides.
56
- # - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
57
- # to see the full list of Cloud APIs that we cover.
58
- #
59
- # [Product Documentation]: https://cloud.google.com/trace
60
- #
61
- #
62
- module Trace
63
- module V2
64
- end
65
- end
66
- end
67
- end