opentelemetry-propagator-ottrace 0.19.2 → 0.19.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: 7b42bdd108dcc74802f5129b21a756d6486032683609c39a25fc90ed02f7db1b
4
- data.tar.gz: d9b91353856cd6dc03273964bb8c616ce1481a0fd5ca9ac3e97e828393ec40dc
3
+ metadata.gz: 7a060f65dc3023d234e5ac579656cdac5d342b0065304ab353755c63ee91d01f
4
+ data.tar.gz: 64bbd78fbb886ff8efe8ea05956f71fb50f16a1d3243c0592c378edcecd82964
5
5
  SHA512:
6
- metadata.gz: 1b64964eddc665db4ccd5352c60b2a0bc060368a1b93381364e431d94fe5e68288713c996759abda22124ce13d99aee730086defa736c8cee8a9336e5a594977
7
- data.tar.gz: b03132fe3a08a5a0e08674aa1213e8476d8f1c62f4edacb76f2d0c7e58af7ff71c275a14bb0441f03eac23152d875a0a587b0a3680240de854a65458f73a476f
6
+ metadata.gz: 0b2ea92bb675dbf1aad7668b63bf4cee0869df54eab39cf158ab4e15c9dc951d15293fbc3af82b288699798b11be0caef6538681d6ee0540d1ff6e1209bc44ab
7
+ data.tar.gz: f53cfa0001f2dd3f9cd48bc420e9330eea959c68ed1da1b79bcb44fa4e1b539f471f9d7da9010c6c9bbcd96b35adbe592a8c57525e3cb1251b7ab2fc0be37e8d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-propagator-ottrace
2
2
 
3
+ ### v0.19.3 / 2021-10-29
4
+
5
+ * FIXED: Add Support fo OTTrace Bit Encoded Sampled Flags
6
+
3
7
  ### v0.19.2 / 2021-09-29
4
8
 
5
9
  * (No significant changes)
data/README.md CHANGED
@@ -9,9 +9,19 @@ The `opentelemetry-propagator-ottrace` gem contains injectors and extractors for
9
9
  | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
10
10
  | `ot-tracer-traceid` | uint64 encoded as a string of 16 hex characters | yes |
11
11
  | `ot-tracer-spanid` | uint64 encoded as a string of 16 hex characters | yes |
12
- | `ot-tracer-sampled` | boolean encoded as a string with the values `'true'` or `'false'` | no |
12
+ | `ot-tracer-sampled` | boolean or bit encoded as a string with the values `'true'`,`'false'`, `'1'`, or `'0'` | no |
13
13
  | `ot-baggage-*` | repeated string to string key-value baggage items; keys are prefixed with `ot-baggage-` and the corresponding value is the raw string. | if baggage is present |
14
14
 
15
+ ### Sampled Flag vs Bit
16
+
17
+ The `ot-tracer-sampled` header is a `boolean` encoded string however the Golang SDK incorrectly sets the `ot-tracer-sampled` header to a `bit` flag.
18
+ This and other language SDKs compensate for this by supporting both a `bit` and `boolean` encoded strings upon extraction:
19
+
20
+ - [Java](https://github.com/open-telemetry/opentelemetry-java/blob/9cea4ef1f92d3186b1bd8296e9daac4281c0f759/extensions/trace-propagators/src/main/java/io/opentelemetry/extension/trace/propagation/Common.java#L41)
21
+ - [Golang](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/b72c2cd63b9a9917554cbcd709e61f5d8541eea5/propagators/ot/ot_propagator.go#L118)
22
+
23
+ This issue was [fixed](https://github.com/open-telemetry/opentelemetry-go-contrib/pull/1358) however this SDK supports both for backward compatibility with older versions of the Golang propagator.
24
+
15
25
  ### Interop and trace ids
16
26
 
17
27
  The OT trace propagation format expects trace ids to be 64-bits. In order to
@@ -56,7 +56,7 @@ module OpenTelemetry
56
56
  span_context = Trace::SpanContext.new(
57
57
  trace_id: Array(trace_id).pack('H*'),
58
58
  span_id: Array(span_id).pack('H*'),
59
- trace_flags: sampled == 'true' ? Trace::TraceFlags::SAMPLED : Trace::TraceFlags::DEFAULT,
59
+ trace_flags: as_trace_flags(sampled),
60
60
  remote: true
61
61
  )
62
62
 
@@ -89,6 +89,15 @@ module OpenTelemetry
89
89
 
90
90
  private
91
91
 
92
+ def as_trace_flags(sampled)
93
+ case sampled
94
+ when 'true', '1'
95
+ Trace::TraceFlags::SAMPLED
96
+ else
97
+ Trace::TraceFlags::DEFAULT
98
+ end
99
+ end
100
+
92
101
  def valid?(trace_id:, span_id:)
93
102
  !(VALID_TRACE_ID_REGEX !~ trace_id || VALID_SPAN_ID_REGEX !~ span_id)
94
103
  end
@@ -15,7 +15,7 @@ module OpenTelemetry
15
15
  module Propagator
16
16
  # Namespace for OpenTelemetry OTTrace propagation
17
17
  module OTTrace
18
- VERSION = '0.19.2'
18
+ VERSION = '0.19.3'
19
19
  end
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-propagator-ottrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.2
4
+ version: 0.19.3
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-09-30 00:00:00.000000000 Z
11
+ date: 2021-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -155,10 +155,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
155
155
  licenses:
156
156
  - Apache-2.0
157
157
  metadata:
158
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-propagator-ottrace/v0.19.2/file.CHANGELOG.html
158
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-propagator-ottrace/v0.19.3/file.CHANGELOG.html
159
159
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/propagator/ottrace
160
160
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
161
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-propagator-ottrace/v0.19.2
161
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-propagator-ottrace/v0.19.3
162
162
  post_install_message:
163
163
  rdoc_options: []
164
164
  require_paths: