Skip to content

128 bits trace id - #2543

Merged
TonyCTHsu merged 41 commits into
masterfrom
tonycthsu/128bits-trace-id-propagation
Mar 3, 2023
Merged

128 bits trace id #2543
TonyCTHsu merged 41 commits into
masterfrom
tonycthsu/128bits-trace-id-propagation

Conversation

@TonyCTHsu

@TonyCTHsu TonyCTHsu commented Jan 11, 2023

Copy link
Copy Markdown
Collaborator

What does this PR do?

Support 128-bit trace id. With this change, our trace is backward compatible with 128-bit trace id, which is used for W3C trace context and b3 propagation.

  1. Implement backward compatible distributed tracing propagation with 128-bit trace id
  2. Implement backward compatible means for sending spans to agent endpoint
  3. Enable 128-bit trace id generation with environment variable DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED
  4. Option to log 128-bit trace id with environment variable DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED(Not yet supported)

@TonyCTHsu TonyCTHsu self-assigned this Jan 24, 2023
@TonyCTHsu
TonyCTHsu force-pushed the tonycthsu/128bits-trace-id-propagation branch from f9b081a to 82c343e Compare January 24, 2023 15:24
@TonyCTHsu
TonyCTHsu force-pushed the tonycthsu/128bits-trace-id-propagation branch from f97fbf3 to 7396eb3 Compare March 2, 2023 14:47
@TonyCTHsu
TonyCTHsu force-pushed the tonycthsu/128bits-trace-id-propagation branch from 7396eb3 to 4f8a8ad Compare March 2, 2023 15:04
@codecov-commenter

codecov-commenter commented Mar 2, 2023

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.56236% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.09%. Comparing base (94721a7) to head (b618b70).
⚠️ Report is 7319 commits behind head on master.

Files with missing lines Patch % Lines
lib/ddtrace/transport/serializable_trace.rb 85.71% 1 Missing ⚠️
lib/ddtrace/transport/trace_formatter.rb 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2543      +/-   ##
==========================================
+ Coverage   98.08%   98.09%   +0.01%     
==========================================
  Files        1166     1166              
  Lines       63832    64198     +366     
  Branches     2849     2861      +12     
==========================================
+ Hits        62607    62974     +367     
+ Misses       1225     1224       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread lib/datadog/tracing/utils.rb Outdated
Comment thread lib/datadog/tracing/utils.rb
tag_rate_limiter_rate!
tag_sample_rate!
tag_sampling_decision_maker!
tag_high_order_trace_id!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should also adjust the the span.trace_id on all spans in the TraceFormatter, so the TraceFormatter always makes sure the TraceSegment provided is ready to be serialized without any changes.

This simplifies the serializer's logic.

@TonyCTHsu TonyCTHsu Mar 3, 2023

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I actually hesitate to commit to this change since TraceFormatter is performing at the trace level attributes which is a constraint of agent's API. I would prefer the current approach of decorating SerailizableSpan than mutating Span from TraceFormatter.

Comment thread lib/datadog/tracing/utils.rb Outdated
Comment thread lib/datadog/tracing/metadata/ext.rb
Comment thread lib/datadog/tracing/distributed/helpers.rb
Comment thread lib/datadog/tracing/configuration/settings.rb
Comment thread lib/datadog/tracing/configuration/settings.rb
@TonyCTHsu
TonyCTHsu force-pushed the tonycthsu/128bits-trace-id-propagation branch from 86ca9af to 0aab0da Compare March 3, 2023 13:12
@TonyCTHsu
TonyCTHsu force-pushed the tonycthsu/128bits-trace-id-propagation branch from 0aab0da to c9ea54b Compare March 3, 2023 13:17
@TonyCTHsu
TonyCTHsu marked this pull request as ready for review March 3, 2023 16:44
@TonyCTHsu
TonyCTHsu requested a review from a team March 3, 2023 16:44
@TonyCTHsu
TonyCTHsu merged commit 3514f9f into master Mar 3, 2023
@TonyCTHsu
TonyCTHsu deleted the tonycthsu/128bits-trace-id-propagation branch March 3, 2023 22:43
@github-actions github-actions Bot added this to the 1.10.0 milestone Mar 3, 2023
@TonyCTHsu TonyCTHsu mentioned this pull request Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants