opentelemetry-api 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opentelemetry/trace.rb +13 -3
- data/lib/opentelemetry/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58264937365e5c87460c86fc590654f4a9ace1bb56e9b65bb05200b922e06c5a
|
4
|
+
data.tar.gz: 286b0a063e4e2f2d767edd499e8bd695f216f38328bb3e78cc129dd5640b7472
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a70ee26d082a08281ed38c292fb2eb304a5e07fee516ecc241e68cd835b6d7b37f34d82bef67728a7d687c130030e72925ca9d747c4804b0e60fa6ac1fe07ad
|
7
|
+
data.tar.gz: 452e2a3cfab14130766427d4c1aeda4a936e5a827066f6b67247c40b8e92fddfd520d79aa03c20293df1e0d9e69994a29326d3c12408de7a3edab1743dc47453
|
data/CHANGELOG.md
CHANGED
data/lib/opentelemetry/trace.rb
CHANGED
@@ -13,7 +13,17 @@ module OpenTelemetry
|
|
13
13
|
|
14
14
|
CURRENT_SPAN_KEY = Context.create_key('current-span')
|
15
15
|
|
16
|
-
|
16
|
+
# Random number generator for generating IDs. This is an object that can
|
17
|
+
# respond to `#bytes` and uses the system PRNG. The current logic is
|
18
|
+
# compatible with Ruby 2.5 (which does not implement the `Random.bytes`
|
19
|
+
# class method) and with Ruby 3.0+ (which deprecates `Random::DEFAULT`).
|
20
|
+
# When we drop support for Ruby 2.5, this can simply be replaced with
|
21
|
+
# the class `Random`.
|
22
|
+
#
|
23
|
+
# @return [#bytes]
|
24
|
+
RANDOM = Random.respond_to?(:bytes) ? Random : Random::DEFAULT
|
25
|
+
|
26
|
+
private_constant :CURRENT_SPAN_KEY, :RANDOM
|
17
27
|
|
18
28
|
# An invalid trace identifier, a 16-byte string with all zero bytes.
|
19
29
|
INVALID_TRACE_ID = ("\0" * 16).b
|
@@ -27,7 +37,7 @@ module OpenTelemetry
|
|
27
37
|
# @return [String] a valid trace ID.
|
28
38
|
def generate_trace_id
|
29
39
|
loop do
|
30
|
-
id =
|
40
|
+
id = RANDOM.bytes(16)
|
31
41
|
return id unless id == INVALID_TRACE_ID
|
32
42
|
end
|
33
43
|
end
|
@@ -38,7 +48,7 @@ module OpenTelemetry
|
|
38
48
|
# @return [String] a valid span ID.
|
39
49
|
def generate_span_id
|
40
50
|
loop do
|
41
|
-
id =
|
51
|
+
id = RANDOM.bytes(8)
|
42
52
|
return id unless id == INVALID_SPAN_ID
|
43
53
|
end
|
44
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: benchmark-ipsa
|
@@ -196,10 +196,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
196
196
|
licenses:
|
197
197
|
- Apache-2.0
|
198
198
|
metadata:
|
199
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v0.12.
|
199
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v0.12.1/file.CHANGELOG.html
|
200
200
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/api
|
201
201
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
202
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v0.12.
|
202
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v0.12.1
|
203
203
|
post_install_message:
|
204
204
|
rdoc_options: []
|
205
205
|
require_paths:
|