opentelemetry-common 0.17.0 → 0.19.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: 92344b19100f4c680d20658c4787ca04d9f6d7f5e2da5a13a5380f9b4f32d997
4
- data.tar.gz: 2801ab187f3230630cb3a5691e3b5eb1e0f5ac0016d67f6ee492d335905ca7cd
3
+ metadata.gz: ccd5d53613769dd8795434123d1c3b5d0c487831226174799c37cd160c5d594a
4
+ data.tar.gz: 487b2d429364fe80cc4bfcbb90b8e2ca242978ec12a95460fed9d83ceb6e0ce3
5
5
  SHA512:
6
- metadata.gz: 90f71ca02e6553136f02e791750fd0c01e3dafb436c032e9bd1b7907bfeb5ead5a5c583215b552951bb9468e235f9e169526ad23a11d5668de8d04aeeca6667f
7
- data.tar.gz: e200ce72b93f1fdfa1b5e77727f50ecdeb314c4f47cc42064dc13b34d9306d2cfcd4bc16967864aaee2d3847acddb25d026f507aa18a491d8f5b8aa63b461d2a
6
+ metadata.gz: 3895f4fef1bdf2505ccee89a38c1769450733233f2e2e59ac5fa8a2b38205efd638809f65fb7335890ed5086cd0026b00361f62ccaad89240024680fb357ce53
7
+ data.tar.gz: be977cd4cf43b117b5004ed17946cd7c72412aac568e859738ab460db16be3fad2e9053ba6ae2c046483de3d609e23290060a3958c59f419a5732de4cb873bcf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
 
2
2
 
3
+ ### v0.19.2 / 2021-09-29
4
+
5
+ * (No significant changes)
6
+
7
+ ### v0.19.1 / 2021-08-12
8
+
9
+ * (No significant changes)
10
+
11
+ ### v0.19.0 / 2021-06-23
12
+
13
+ * ADDED: Add Tracer.non_recording_span to API
14
+
15
+ ### v0.18.0 / 2021-05-21
16
+
17
+ * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
18
+
19
+ * FIXED: Replace Time.now with Process.clock_gettime
20
+
3
21
  ### v0.17.0 / 2021-04-22
4
22
 
5
23
  * ADDED: Add zipkin exporter
@@ -13,3 +13,7 @@ ensure
13
13
  env_to_reset.each_pair { |k, v| ENV[k] = v }
14
14
  keys_to_delete.each { |k| ENV.delete(k) }
15
15
  end
16
+
17
+ def exportable_timestamp(time = Time.now)
18
+ (time.to_r * 1_000_000_000).to_i
19
+ end
@@ -14,13 +14,29 @@ module OpenTelemetry
14
14
 
15
15
  # Returns nil if timeout is nil, 0 if timeout has expired,
16
16
  # or the remaining (positive) time left in seconds.
17
+ #
18
+ # @param [Numeric] timeout The timeout in seconds. May be nil.
19
+ # @param [Numeric] start_time Start time for timeout returned
20
+ # by {timeout_timestamp}.
21
+ #
22
+ # @return [Numeric] remaining (positive) time left in seconds.
23
+ # May be nil.
17
24
  def maybe_timeout(timeout, start_time)
18
25
  return nil if timeout.nil?
19
26
 
20
- timeout -= (Time.now - start_time)
27
+ timeout -= (timeout_timestamp - start_time)
21
28
  timeout.positive? ? timeout : 0
22
29
  end
23
30
 
31
+ # Returns a timestamp suitable to pass as the start_time
32
+ # argument to {maybe_timeout}. This has no meaning outside
33
+ # of the current process.
34
+ #
35
+ # @return [Numeric]
36
+ def timeout_timestamp
37
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
38
+ end
39
+
24
40
  # Encodes a string in utf8
25
41
  #
26
42
  # @param [String] string The string to be utf8 encoded
@@ -57,7 +73,7 @@ module OpenTelemetry
57
73
  end
58
74
 
59
75
  def untraced
60
- OpenTelemetry::Trace.with_span(OpenTelemetry::Trace::Span.new) { yield }
76
+ OpenTelemetry::Trace.with_span(OpenTelemetry::Trace.non_recording_span(OpenTelemetry::Trace::SpanContext.new)) { yield }
61
77
  end
62
78
 
63
79
  # Returns a URL string with userinfo removed.
@@ -6,6 +6,6 @@
6
6
 
7
7
  module OpenTelemetry
8
8
  module Common
9
- VERSION = '0.17.0'
9
+ VERSION = '0.19.2'
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-23 00:00:00.000000000 Z
11
+ date: 2021-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.17.0
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.17.0
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -144,10 +144,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
144
144
  licenses:
145
145
  - Apache-2.0
146
146
  metadata:
147
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.17.0/file.CHANGELOG.html
147
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.19.2/file.CHANGELOG.html
148
148
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/common
149
149
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
150
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.17.0
150
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.19.2
151
151
  post_install_message:
152
152
  rdoc_options: []
153
153
  require_paths: