uptrace 1.2.1 → 1.2.3

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: 7fd9cbd69a42da344856df5d7fd7a7a1ae391e8a831ce045bd8008be07050de6
4
- data.tar.gz: 45bfcec0d69d51ff61ec5c00a7d3a9b3b7764614eac0981ccdad34ffc9b6e7ef
3
+ metadata.gz: c94eb656b6d3d4a34ffd82f07b8241283ac0df131a1830dbaab1e267151efe26
4
+ data.tar.gz: c3992f5a354ee5377578526ffa523373d7623752ad6d61a700a8e8725e6486bc
5
5
  SHA512:
6
- metadata.gz: c5884bb52fb260f9ef122115d5e399d64db3a5a0c0c37fffe7ec12cd3c521e0de8276cb8e04bc0c8ae1f5d868df5f90e8bd4849d2c733d30d558b0b4c3ddc82c
7
- data.tar.gz: '0852731f85c1ac9d7fec78f9ab7dbbd8bf0365080532a54afbc6860d6facaff9dfd717ba202f456bdba56180ae732466ca267e2a6e25b0e9482b61165621081b'
6
+ metadata.gz: 29fea8f23477b55985c87e813342e08899f7f1182f535b3d4f868c5eaaf5ae97cdee203b4f5f9fb89c1544bc24861d7dd91ac9fa2c9e53fc215ec234c2cb8d95
7
+ data.tar.gz: ab741518c70fb6f755c0b7e4ce5805bc8448f3ece174862b8305275cf2b04349555a6abcc0f0bc4acfc72c805c1fe1782e3d2a8e1f068b6eb5f8202dae5eaf01
@@ -15,20 +15,14 @@ module Uptrace
15
15
  # @return [#bytes]
16
16
  RANDOM = Random.respond_to?(:bytes) ? Random : Random::DEFAULT
17
17
 
18
- # An invalid trace identifier, a 16-byte string with all zero bytes.
19
- INVALID_TRACE_ID = ("\0" * 16).b
20
-
21
- # An invalid span identifier, an 8-byte string with all zero bytes.
22
- INVALID_SPAN_ID = ("\0" * 8).b
23
-
24
18
  # Generates a valid trace identifier, a 16-byte string with at least one
25
19
  # non-zero byte.
26
20
  #
27
21
  # @return [String] a valid trace ID.
28
22
  def generate_trace_id
29
- time = (Time.now.to_f * 1_000_000).to_i
30
- high = RANDOM.bytes(8)
31
- low = [time & 0xFFFFFFFF, time >> 32].pack('VV')
23
+ time = (Time.now.to_f * 1_000_000_000).to_i
24
+ high = [time >> 32, time & 0xFFFFFFFF].pack('NN')
25
+ low = RANDOM.bytes(8)
32
26
  high << low
33
27
  end
34
28
 
@@ -38,8 +32,8 @@ module Uptrace
38
32
  # @return [String] a valid span ID.
39
33
  def generate_span_id
40
34
  time = (Time.now.to_f * 1000).to_i
41
- high = RANDOM.bytes(4)
42
- low = [time].pack('V')
35
+ high = [time].pack('N')
36
+ low = RANDOM.bytes(4)
43
37
  high << low
44
38
  end
45
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uptrace
4
- VERSION = '1.2.1'
4
+ VERSION = '1.2.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uptrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uptrace Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-28 00:00:00.000000000 Z
11
+ date: 2022-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-exporter-otlp