google-cloud-trace 0.33.0 → 0.33.1
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/README.md +22 -0
- data/lib/google/cloud/trace.rb +33 -0
- data/lib/google/cloud/trace/rails.rb +1 -1
- data/lib/google/cloud/trace/time_sampler.rb +3 -2
- data/lib/google/cloud/trace/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f583302c7f227c7286b69a817b865126bb46f4e81db80032758a17cbd29bbb
|
4
|
+
data.tar.gz: cdba7500b430fadb4aca52ab717a0604aa2217f1fa5afc7341f5f0f070d015cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a08cfe8604df23297959ce11f140dd316cfa3b692ed27d7b4ff1c7a2854836a38f67e7b835082f6ba1dc27ff78e8b03093487414c4d347b8e1501a2b347bf9
|
7
|
+
data.tar.gz: 8519a7df8948dc32b16540f0ee1f2e2d0d92d61af90081e824e14f6a1fc499960d9c15b90fc056c2107763119b972129080db4d0dc7adbb6ef39517a7dc89c05
|
data/README.md
CHANGED
@@ -183,6 +183,28 @@ This library also supports the other authentication methods provided by the
|
|
183
183
|
`google-cloud-ruby` suite. Instructions and configuration options are covered
|
184
184
|
in the [Authentication Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-trace/guides/authentication).
|
185
185
|
|
186
|
+
## Enabling Logging
|
187
|
+
|
188
|
+
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below, or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger) that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
189
|
+
|
190
|
+
Configuring a Ruby stdlib logger:
|
191
|
+
|
192
|
+
```ruby
|
193
|
+
require "logger"
|
194
|
+
|
195
|
+
module MyLogger
|
196
|
+
LOGGER = Logger.new $stderr, level: Logger::WARN
|
197
|
+
def logger
|
198
|
+
LOGGER
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
203
|
+
module GRPC
|
204
|
+
extend MyLogger
|
205
|
+
end
|
206
|
+
```
|
207
|
+
|
186
208
|
## Supported Ruby Versions
|
187
209
|
|
188
210
|
This library is supported on Ruby 2.0+.
|
data/lib/google/cloud/trace.rb
CHANGED
@@ -190,6 +190,39 @@ module Google
|
|
190
190
|
# trace_client.patch_traces trace
|
191
191
|
# ```
|
192
192
|
#
|
193
|
+
# ## Enabling Logging
|
194
|
+
#
|
195
|
+
# To enable logging for this library, set the logger for the underlying
|
196
|
+
# [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The
|
197
|
+
# logger that you set may be a Ruby stdlib
|
198
|
+
# [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html)
|
199
|
+
# as shown below, or a
|
200
|
+
# [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
|
201
|
+
# that will write logs to [Stackdriver
|
202
|
+
# Logging](https://cloud.google.com/logging/). See
|
203
|
+
# [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
204
|
+
# and the gRPC
|
205
|
+
# [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb)
|
206
|
+
# for additional information.
|
207
|
+
#
|
208
|
+
# Configuring a Ruby stdlib logger:
|
209
|
+
#
|
210
|
+
# ```ruby
|
211
|
+
# require "logger"
|
212
|
+
#
|
213
|
+
# module MyLogger
|
214
|
+
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
215
|
+
# def logger
|
216
|
+
# LOGGER
|
217
|
+
# end
|
218
|
+
# end
|
219
|
+
#
|
220
|
+
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
221
|
+
# module GRPC
|
222
|
+
# extend MyLogger
|
223
|
+
# end
|
224
|
+
# ```
|
225
|
+
#
|
193
226
|
module Trace
|
194
227
|
THREAD_KEY = :__stackdriver_trace_span__
|
195
228
|
|
@@ -128,7 +128,7 @@ module Google
|
|
128
128
|
# Done if Google::Cloud.configure.use_trace is explicitly false
|
129
129
|
return if Google::Cloud.configure.use_trace == false
|
130
130
|
|
131
|
-
# Verify credentials and set
|
131
|
+
# Verify credentials and set use_trace to false if
|
132
132
|
# credentials are invalid
|
133
133
|
unless valid_credentials? Trace.configure.project_id,
|
134
134
|
Trace.configure.credentials
|
@@ -30,7 +30,8 @@ module Google
|
|
30
30
|
#
|
31
31
|
# 1. It allows you to blacklist certain URI paths that should never be
|
32
32
|
# traced. For example, the Google App Engine health check request
|
33
|
-
# path `/_ah/health` is blacklisted by default.
|
33
|
+
# path `/_ah/health` is blacklisted by default. Kubernetes default
|
34
|
+
# health check `/healthz` is also ignored.
|
34
35
|
# 2. It spaces samples out by delaying a minimum time between each
|
35
36
|
# sample. This enforces a maximum QPS for this Ruby process.
|
36
37
|
#
|
@@ -38,7 +39,7 @@ module Google
|
|
38
39
|
##
|
39
40
|
# Default list of paths for which to disable traces. Currently includes
|
40
41
|
# App Engine Flex health checks.
|
41
|
-
DEFAULT_PATH_BLACKLIST = ["/_ah/health"].freeze
|
42
|
+
DEFAULT_PATH_BLACKLIST = ["/_ah/health", "/healthz"].freeze
|
42
43
|
|
43
44
|
##
|
44
45
|
# Create a TimeSampler for the given QPS.
|
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.
|
4
|
+
version: 0.33.1
|
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-
|
11
|
+
date: 2018-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
290
|
version: '0'
|
291
291
|
requirements: []
|
292
292
|
rubyforge_project:
|
293
|
-
rubygems_version: 2.7.
|
293
|
+
rubygems_version: 2.7.7
|
294
294
|
signing_key:
|
295
295
|
specification_version: 4
|
296
296
|
summary: Application Instrumentation and API Client library for Stackdriver Trace
|