Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace: spec compliant trace and span ids #689

Merged
merged 3 commits into from
Jan 1, 2022

Conversation

jtescher
Copy link
Member

@jtescher jtescher commented Jan 1, 2022

The spec only defines conversions between ids and hex/binary values. This updates the TraceId and SpanId APIs to be compliant by removing explicit conversions from u128/u64 (except for test convenience methods) and adding methods for converting to/from byte arrays and hex strings.

The spec only defines conversions between ids and hex/binary values.
This patch updates the `TraceId` and `SpanId` APIs to be compliant by
removing explicit conversions from u128/u64 (except for test convenience
methods) and adding methods for converting to/from byte arrays and hex
strings.
@jtescher jtescher requested a review from a team as a code owner January 1, 2022 18:08
@codecov
Copy link

codecov bot commented Jan 1, 2022

Codecov Report

Merging #689 (a697fa6) into main (28d2f28) will decrease coverage by 0.17%.
The diff coverage is 83.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #689      +/-   ##
==========================================
- Coverage   63.73%   63.56%   -0.18%     
==========================================
  Files          96       96              
  Lines        7708     7715       +7     
==========================================
- Hits         4913     4904       -9     
- Misses       2795     2811      +16     
Impacted Files Coverage Δ
opentelemetry-jaeger/src/exporter/mod.rs 58.43% <0.00%> (-0.29%) ⬇️
opentelemetry/src/sdk/trace/tracer.rs 90.76% <ø> (-0.05%) ⬇️
opentelemetry/src/trace/noop.rs 75.00% <ø> (-0.52%) ⬇️
opentelemetry-datadog/src/exporter/model/v03.rs 87.03% <66.66%> (-4.63%) ⬇️
opentelemetry-datadog/src/exporter/model/v05.rs 86.44% <66.66%> (-4.13%) ⬇️
opentelemetry/src/trace/span_context.rs 89.54% <90.47%> (-2.04%) ⬇️
opentelemetry-aws/src/lib.rs 90.50% <100.00%> (-0.58%) ⬇️
opentelemetry-datadog/src/exporter/mod.rs 12.06% <100.00%> (ø)
opentelemetry-datadog/src/lib.rs 91.30% <100.00%> (-0.08%) ⬇️
opentelemetry-jaeger/src/lib.rs 92.55% <100.00%> (-0.08%) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28d2f28...a697fa6. Read the comment docs.

Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor concerns, but this mostly looks good. I like having INVALID as a const.

opentelemetry/src/trace/span_context.rs Outdated Show resolved Hide resolved
opentelemetry/src/trace/span_context.rs Show resolved Hide resolved
opentelemetry/src/trace/span_context.rs Show resolved Hide resolved
@jtescher jtescher merged commit fd480e7 into open-telemetry:main Jan 1, 2022
@jtescher jtescher deleted the spec-compliant-ids branch January 1, 2022 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants