opentelemetry-common 0.21.0 → 0.23.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7eb64734094d294359454868323d59319f1f659b6bbaba38a2d41fd80fae5d5
4
- data.tar.gz: 1d5e0ff8282c8fce4d7052a522a7a96c2d03f0082ba5a3bdf3b8ad7875329560
3
+ metadata.gz: c97ebd296d9da60f453c437cd6a74e1d3a3d9bde2d063199724ae597dfb42f0e
4
+ data.tar.gz: eefe7a798007c7ae10adf84811084dbd6f29c52b93dafedbf3ea684ac4920621
5
5
  SHA512:
6
- metadata.gz: b71c04529036aea6f16376c3b8e3718c2a6794ef964306412ffa349f0dafece57c18c494577e4852ec383b0260c07c966c2bc574dcdd6b2b9505e6a60eb823ca
7
- data.tar.gz: ded4a0fcaa3287910d5fd468bf9273fd163bcce98ce1e7cb85c1c76cf6089668e6ed42e6c0ddac53137e061572199b573dd362163bf6fb24af57a9c1868dfb42
6
+ metadata.gz: 3dd1af6800d614a857370059e6fb50e0d119975e6181a8db3672367bc8fd9fcd32a9935feae376905a6413937f3124985439c04442430d85605e006ecf2d4ecf
7
+ data.tar.gz: 2b1124bf3f57424210250caf894214992c620693719a5f2bfbd9e08370725b48ec1822575aab0147dd9a1cd2d9a85af9bfe0b52e585638295f7e1ecacba94a54
data/CHANGELOG.md CHANGED
@@ -1,94 +1,102 @@
1
1
  # Release History: opentelemetry-common
2
2
 
3
+ ### v0.23.0 / 2025-10-14
4
+
5
+ * ADDED: Create method for returning timestamp in nanoseconds
6
+
7
+ ### v0.22.0 / 2025-02-25
8
+
9
+ - ADDED: Support 3.1 Min Version
10
+
3
11
  ### v0.21.0 / 2024-05-08
4
12
 
5
- * ADDED: Untraced method updated to support both block and non block structured calls
13
+ - ADDED: Untraced method updated to support both block and non block structured calls
6
14
 
7
15
  ### v0.20.1 / 2024-02-06
8
16
 
9
- * FIXED: Patch the issue for frozen string on ruby < 3.0 with string interpolation
17
+ - FIXED: Patch the issue for frozen string on ruby < 3.0 with string interpolation
10
18
 
11
19
  ### v0.20.0 / 2023-06-08
12
20
 
13
- * BREAKING CHANGE: Remove support for EoL Ruby 2.7
21
+ - BREAKING CHANGE: Remove support for EoL Ruby 2.7
14
22
 
15
- * ADDED: Remove support for EoL Ruby 2.7
23
+ - ADDED: Remove support for EoL Ruby 2.7
16
24
 
17
25
  ### v0.19.7 / 2023-05-30
18
26
 
19
- * FIXED: Untraced only works with parent-based sampler
27
+ - FIXED: Untraced only works with parent-based sampler
20
28
 
21
29
  ### v0.19.6 / 2022-05-18
22
30
 
23
- * (No significant changes)
31
+ - (No significant changes)
24
32
 
25
33
  ### v0.19.5 / 2022-05-10
26
34
 
27
- * FIXED: Common changelog
35
+ - FIXED: Common changelog
28
36
 
29
37
  ### v0.19.4 / 2022-05-08
30
38
 
31
- * FIXED: Check that a variable is a string before truncating
32
- * FIXED: Attribute length limit. only truncate strings and strings in arrays
39
+ - FIXED: Check that a variable is a string before truncating
40
+ - FIXED: Attribute length limit. only truncate strings and strings in arrays
33
41
 
34
42
  ### v0.19.3 / 2021-12-01
35
43
 
36
- * FIXED: Change net attribute names to match the semantic conventions spec for http
44
+ - FIXED: Change net attribute names to match the semantic conventions spec for http
37
45
 
38
46
  ### v0.19.2 / 2021-09-29
39
47
 
40
- * (No significant changes)
48
+ - (No significant changes)
41
49
 
42
50
  ### v0.19.1 / 2021-08-12
43
51
 
44
- * (No significant changes)
52
+ - (No significant changes)
45
53
 
46
54
  ### v0.19.0 / 2021-06-23
47
55
 
48
- * ADDED: Add Tracer.non_recording_span to API
56
+ - ADDED: Add Tracer.non_recording_span to API
49
57
 
50
58
  ### v0.18.0 / 2021-05-21
51
59
 
52
- * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
60
+ - BREAKING CHANGE: Replace Time.now with Process.clock_gettime
53
61
 
54
- * FIXED: Replace Time.now with Process.clock_gettime
62
+ - FIXED: Replace Time.now with Process.clock_gettime
55
63
 
56
64
  ### v0.17.0 / 2021-04-22
57
65
 
58
- * ADDED: Add zipkin exporter
59
- * ADDED: Processors validate exporters on init.
66
+ - ADDED: Add zipkin exporter
67
+ - ADDED: Processors validate exporters on init.
60
68
 
61
69
  ### v0.16.0 / 2021-03-17
62
70
 
63
- * ADDED: Instrument lmdb gem
64
- * FIXED: Remove passwords from http.url
65
- * DOCS: Replace Gitter with GitHub Discussions
71
+ - ADDED: Instrument lmdb gem
72
+ - FIXED: Remove passwords from http.url
73
+ - DOCS: Replace Gitter with GitHub Discussions
66
74
 
67
75
  ### v0.15.0 / 2021-02-18
68
76
 
69
- * (No significant changes)
77
+ - (No significant changes)
70
78
 
71
79
  ### v0.14.0 / 2021-02-03
72
80
 
73
- * (No significant changes)
81
+ - (No significant changes)
74
82
 
75
83
  ### v0.13.0 / 2021-01-29
76
84
 
77
- * ADDED: Add untraced wrapper to common utils
85
+ - ADDED: Add untraced wrapper to common utils
78
86
 
79
87
  ### v0.12.0 / 2020-12-24
80
88
 
81
- * (No significant changes)
89
+ - (No significant changes)
82
90
 
83
91
  ### v0.11.0 / 2020-12-11
84
92
 
85
- * ADDED: Move utf8 encoding to common utils
86
- * FIXED: Copyright comments to not reference year
93
+ - ADDED: Move utf8 encoding to common utils
94
+ - FIXED: Copyright comments to not reference year
87
95
 
88
96
  ### v0.10.0 / 2020-12-03
89
97
 
90
- * FIXED: Common gem should depend on api gem
98
+ - FIXED: Common gem should depend on api gem
91
99
 
92
100
  ### v0.9.0 / 2020-11-27
93
101
 
94
- * Initial release.
102
+ - Initial release.
data/README.md CHANGED
@@ -16,7 +16,7 @@ The `opentelemetry-common` gem provides common helpers for semantic conventions,
16
16
 
17
17
  Install the gem using:
18
18
 
19
- ```
19
+ ```sh
20
20
  gem install opentelemetry-common
21
21
  ```
22
22
 
@@ -42,6 +42,14 @@ module OpenTelemetry
42
42
  Process.clock_gettime(Process::CLOCK_MONOTONIC)
43
43
  end
44
44
 
45
+ # Converts the provided timestamp to nanosecond integer
46
+ #
47
+ # @param timestamp [Time] the timestamp to convert, defaults to Time.now
48
+ # @return [Integer]
49
+ def time_in_nanoseconds(timestamp = Time.now)
50
+ (timestamp.to_r * 1_000_000_000).to_i
51
+ end
52
+
45
53
  # Encodes a string in utf8
46
54
  #
47
55
  # @param [String] string The string to be utf8 encoded
@@ -129,7 +137,7 @@ module OpenTelemetry
129
137
  # @param default The fallback value to return if the requested
130
138
  # env var(s) are not present
131
139
  #
132
- # @returns [String]
140
+ # @return [String]
133
141
  def config_opt(*env_vars, default: nil)
134
142
  ENV.values_at(*env_vars).compact.fetch(0, default)
135
143
  end
@@ -6,6 +6,6 @@
6
6
 
7
7
  module OpenTelemetry
8
8
  module Common
9
- VERSION = '0.21.0'
9
+ VERSION = '0.23.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.21.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-08 00:00:00.000000000 Z
11
+ date: 2025-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.3'
89
+ version: '1.65'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.3'
96
+ version: '1.65'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -160,11 +160,11 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
160
160
  licenses:
161
161
  - Apache-2.0
162
162
  metadata:
163
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.21.0/file.CHANGELOG.html
163
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.23.0/file.CHANGELOG.html
164
164
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/common
165
165
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
166
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.21.0
167
- post_install_message:
166
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.23.0
167
+ post_install_message:
168
168
  rdoc_options: []
169
169
  require_paths:
170
170
  - lib
@@ -172,15 +172,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  requirements:
173
173
  - - ">="
174
174
  - !ruby/object:Gem::Version
175
- version: '3.0'
175
+ version: '3.1'
176
176
  required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  requirements: []
182
- rubygems_version: 3.2.33
183
- signing_key:
182
+ rubygems_version: 3.3.27
183
+ signing_key:
184
184
  specification_version: 4
185
185
  summary: Common helpers for OpenTelemetry
186
186
  test_files: []