opentelemetry-common 0.10.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/LICENSE +1 -1
- data/lib/opentelemetry-common.rb +1 -1
- data/lib/opentelemetry/common.rb +1 -1
- data/lib/opentelemetry/common/http.rb +1 -1
- data/lib/opentelemetry/common/http/client_context.rb +1 -1
- data/lib/opentelemetry/common/utilities.rb +34 -4
- data/lib/opentelemetry/common/version.rb +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f86e8eee2106263ab1861cf3da36048a1643ef8f3e6c4d91049ce8a0777aa425
|
4
|
+
data.tar.gz: 35588a66483da3c9613c78eca2ac1fc2bf5ed71186a2ce7e086de3f8b495e15f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7fbf2eb4bafc48993e24b06a878f2d9131821e53235d8f270519fb0a20f2158416d68280b383e559f6e78666818fe4fde5c7f13766bb6eb03e1c149369e24d6
|
7
|
+
data.tar.gz: c4c2dd1b418925ad23c93daa4829e290c55befdc7c65e3f48e4d6334a2c53c6c713aab4ca510a15f3aae3d65cf3a4501ec8911e3ddb27f2977ef4397928bdb4a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
|
2
2
|
|
3
|
+
### v0.15.0 / 2021-02-18
|
4
|
+
|
5
|
+
* (No significant changes)
|
6
|
+
|
7
|
+
### v0.14.0 / 2021-02-03
|
8
|
+
|
9
|
+
* (No significant changes)
|
10
|
+
|
11
|
+
### v0.13.0 / 2021-01-29
|
12
|
+
|
13
|
+
* ADDED: Add untraced wrapper to common utils
|
14
|
+
|
15
|
+
### v0.12.0 / 2020-12-24
|
16
|
+
|
17
|
+
* (No significant changes)
|
18
|
+
|
19
|
+
### v0.11.0 / 2020-12-11
|
20
|
+
|
21
|
+
* ADDED: Move utf8 encoding to common utils
|
22
|
+
* FIXED: Copyright comments to not reference year
|
23
|
+
|
3
24
|
### v0.10.0 / 2020-12-03
|
4
25
|
|
5
26
|
* FIXED: Common gem should depend on api gem
|
data/LICENSE
CHANGED
@@ -186,7 +186,7 @@
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright
|
189
|
+
Copyright The OpenTelemetry Authors
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
data/lib/opentelemetry-common.rb
CHANGED
data/lib/opentelemetry/common.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright
|
3
|
+
# Copyright The OpenTelemetry Authors
|
4
4
|
#
|
5
5
|
# SPDX-License-Identifier: Apache-2.0
|
6
6
|
|
@@ -10,15 +10,45 @@ module OpenTelemetry
|
|
10
10
|
module Utilities
|
11
11
|
extend self
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
# Returns nil if timeout is nil, 0 if timeout has expired,
|
13
|
+
STRING_PLACEHOLDER = ''.encode(::Encoding::UTF_8).freeze
|
14
|
+
|
15
|
+
# Returns nil if timeout is nil, 0 if timeout has expired,
|
16
|
+
# or the remaining (positive) time left in seconds.
|
16
17
|
def maybe_timeout(timeout, start_time)
|
17
18
|
return nil if timeout.nil?
|
18
19
|
|
19
20
|
timeout -= (Time.now - start_time)
|
20
21
|
timeout.positive? ? timeout : 0
|
21
22
|
end
|
23
|
+
|
24
|
+
# Encodes a string in utf8
|
25
|
+
#
|
26
|
+
# @param [String] string The string to be utf8 encoded
|
27
|
+
# @param [optional boolean] binary This option is for displaying binary data
|
28
|
+
# @param [optional String] placeholder The fallback string to be used if encoding fails
|
29
|
+
#
|
30
|
+
# @return [String]
|
31
|
+
def utf8_encode(string, binary: false, placeholder: STRING_PLACEHOLDER)
|
32
|
+
string = string.to_s
|
33
|
+
|
34
|
+
if binary
|
35
|
+
# This option is useful for "gracefully" displaying binary data that
|
36
|
+
# often contains text such as marshalled objects
|
37
|
+
string.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
38
|
+
elsif string.encoding == ::Encoding::UTF_8
|
39
|
+
string
|
40
|
+
else
|
41
|
+
string.encode(::Encoding::UTF_8)
|
42
|
+
end
|
43
|
+
rescue StandardError => e
|
44
|
+
OpenTelemetry.logger.debug("Error encoding string in UTF-8: #{e}")
|
45
|
+
|
46
|
+
placeholder
|
47
|
+
end
|
48
|
+
|
49
|
+
def untraced
|
50
|
+
OpenTelemetry::Trace.with_span(OpenTelemetry::Trace::Span.new) { yield }
|
51
|
+
end
|
22
52
|
end
|
23
53
|
end
|
24
54
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright
|
3
|
+
# Copyright The OpenTelemetry Authors
|
4
4
|
#
|
5
5
|
# SPDX-License-Identifier: Apache-2.0
|
6
6
|
|
7
7
|
module OpenTelemetry
|
8
8
|
module Common
|
9
|
-
VERSION = '0.
|
9
|
+
VERSION = '0.15.0'
|
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.
|
4
|
+
version: 0.15.0
|
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-02-18 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.
|
19
|
+
version: 0.15.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.
|
26
|
+
version: 0.15.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,10 +143,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
143
143
|
licenses:
|
144
144
|
- Apache-2.0
|
145
145
|
metadata:
|
146
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.
|
147
|
-
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/
|
146
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.15.0/file.CHANGELOG.html
|
147
|
+
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/common
|
148
148
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
149
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.
|
149
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.15.0
|
150
150
|
post_install_message:
|
151
151
|
rdoc_options: []
|
152
152
|
require_paths:
|