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

chore(tracing): Adds trace_remote field to TraceDigest #3516

Merged
merged 12 commits into from
Mar 18, 2024

Conversation

mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Mar 11, 2024

What does this PR do?

Adds a mechanism to track whether a TraceDigest represents a remote span or if it is local to a host. This change is analogous to a change made in NodeJS: DataDog/dd-trace-js#4153.

is_remote or trace_remote is an opentelemetry concept and is defined here: https://opentelemetry.io/docs/specs/otel/trace/api/#isremote.

Motivation:

This new field will be used to propagate the last datadog parent id in w3c tracecontext headers. This change blocks: #3488

Additional Notes:

How to test the change?

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.07%. Comparing base (344441e) to head (dd684ac).

Additional details and impacted files
@@           Coverage Diff           @@
##              2.0    #3516   +/-   ##
=======================================
  Coverage   98.07%   98.07%           
=======================================
  Files        1237     1237           
  Lines       72254    72276   +22     
  Branches     3408     3408           
=======================================
+ Hits        70863    70886   +23     
+ Misses       1391     1390    -1     

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

@mabdinur mabdinur marked this pull request as ready for review March 12, 2024 20:14
@mabdinur mabdinur requested a review from a team as a code owner March 12, 2024 20:14
@mabdinur mabdinur requested a review from marcotc March 12, 2024 20:44
@mabdinur mabdinur changed the base branch from master to 2.0 March 15, 2024 14:55
@mabdinur mabdinur requested a review from a team as a code owner March 15, 2024 14:55
@mabdinur mabdinur changed the base branch from 2.0 to master March 15, 2024 14:56
@mabdinur mabdinur requested review from a team as code owners March 15, 2024 14:59
@mabdinur mabdinur changed the base branch from master to 2.0 March 15, 2024 14:59
@mabdinur mabdinur changed the title chore(tracing): Adds IsRemote field chore(tracing): Adds trace_remote field to TraceDigest Mar 15, 2024
Copy link

@estherk15 estherk15 left a comment

Choose a reason for hiding this comment

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

No docs review needed

@mabdinur mabdinur requested review from TonyCTHsu and removed request for marcotc March 15, 2024 17:13
@@ -299,6 +302,7 @@ def to_digest
trace_service: service,
trace_state: @trace_state,
trace_state_unknown_fields: @trace_state_unknown_fields,
trace_remote: (@remote_parent && @active_span.nil?),
Copy link
Member

Choose a reason for hiding this comment

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

Do we need @active_span.nil? here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. If we are creating a digest for an active span then trace_remote should be False. The digest represent a span that is local to the process.

Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

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

Minor changes requested.

@mabdinur mabdinur merged commit fddce26 into 2.0 Mar 18, 2024
143 of 146 checks passed
@mabdinur mabdinur deleted the munir/add-is-remote branch March 18, 2024 22:28
@TonyCTHsu TonyCTHsu modified the milestones: 2.0, 2.0.0.beta1 Mar 20, 2024
@TonyCTHsu TonyCTHsu added the 2.0 label Apr 12, 2024
@TonyCTHsu TonyCTHsu mentioned this pull request Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants