Skip to content

Adds support for 'x-datadog-origin' http header#781

Merged
tonyredondo merged 4 commits into
masterfrom
tony/dd-origin-header
Jul 8, 2020
Merged

Adds support for 'x-datadog-origin' http header#781
tonyredondo merged 4 commits into
masterfrom
tony/dd-origin-header

Conversation

@tonyredondo

@tonyredondo tonyredondo commented Jul 3, 2020

Copy link
Copy Markdown
Member
  • Enable Extractor to parse the header and store it in the span context.
  • Enable Injector to inject the span context origin property to propagate the value.
  • Sets the _dd.origin tag to a new span if the span context has the origin value and if is the root span of a trace.
  • New constant values for the http header and the span tag.
  • Unit tests for Extract, Inject and setting the tag in the root span.

These changes were required to correctly support Datadog Synthetics.

@tonyredondo
tonyredondo requested a review from a team July 3, 2020 10:25
@tonyredondo tonyredondo self-assigned this Jul 3, 2020
@tonyredondo
tonyredondo marked this pull request as ready for review July 3, 2020 10:30
Comment thread src/Datadog.Trace/SpanContext.cs Outdated
Comment thread src/Datadog.Trace/SpanContextPropagator.cs Outdated
Comment thread src/Datadog.Trace/TraceContext.cs Outdated
@tonyredondo
tonyredondo requested a review from kevingosse July 3, 2020 13:07

@kevingosse kevingosse left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/Datadog.Trace/SpanContext.cs
Comment thread src/Datadog.Trace/SpanContextPropagator.cs Outdated
Comment thread test/Datadog.Trace.Tests/TracerTests.cs Outdated

@zacharycmontoya zacharycmontoya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

Comment thread src/Datadog.Trace/SpanContext.cs Outdated
Comment thread src/Datadog.Trace/SpanContextPropagator.cs
@tonyredondo
tonyredondo requested a review from lucaspimentel July 8, 2020 08:47

@zacharycmontoya zacharycmontoya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-approving just to re-inforce that all of my concerns were answered. Thanks for following up on my feedback!

@lucaspimentel lucaspimentel left a comment

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.

looks good, thanks!

- Enable Extractor to parse the header and store it in the span context.
- Enable Injector to inject the span context origin property to propagate the value.
- Sets the '_dd.origin' tag to a new span if the span context has the origin value and if is the root span of a trace.
- New constant values for the http header and the span tag.
- Unit tests for Extract, Inject and setting the tag in the root span.
- Changing the SpanContext Origin property to internal.
- Moving the Origin set tag block to the DecorateRootSpan method.
- Removing the ToList() and the double enumeration from the SpanContextPropagator.
- Adds the Origin header logic to SpanContextPropagatorHelpers.
- Changed the unit tests for SpanContextPropagatorHelpers to consider the new origin header.
- Fixes the OriginHeader_InjectFromChildSpan test.
…ng a new internal ctor for the origin header.
@tonyredondo
tonyredondo force-pushed the tony/dd-origin-header branch from bbf2c82 to eb60087 Compare July 8, 2020 18:48
@tonyredondo
tonyredondo merged commit 5c059e1 into master Jul 8, 2020
@tonyredondo
tonyredondo deleted the tony/dd-origin-header branch July 8, 2020 19:06
@zacharycmontoya zacharycmontoya added this to the 1.18.2 milestone Jul 9, 2020
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.

4 participants