Skip to content

Support x-datadog-origin header (Synthetics support)#615

Merged
SammyK merged 1 commit into
masterfrom
sammyk/synthetics-origin-support
Oct 16, 2019
Merged

Support x-datadog-origin header (Synthetics support)#615
SammyK merged 1 commit into
masterfrom
sammyk/synthetics-origin-support

Conversation

@SammyK

@SammyK SammyK commented Oct 15, 2019

Copy link
Copy Markdown
Contributor

Description

TL;DR This will enable Synthetics support with the PHP tracer.

This PR will check for a distributed trace origin via the x-datadog-origin HTTP header. If it exists, the top-level span metadata is appended with _dd.origin which is set to the value of the x-datadog-origin HTTP header. The value is also propagated to other traces via the same HTTP header.

Readiness checklist

  • (only for Members) Changelog has been added to the appropriate release draft. Create one if necessary.
  • Tests added for this feature/bug.

Reviewer checklist

  • Appropriate labels assigned.
  • Milestone is set.
  • Changelog has been added to the appropriate release draft. For community contributors the reviewer is in charge of this task.

@SammyK SammyK added 🏆 enhancement A new feature or improvement 🍏 core Changes to the core tracing functionality labels Oct 15, 2019
@SammyK SammyK added this to the 0.33.0 milestone Oct 15, 2019
This will also enable Synthetics support
@SammyK
SammyK force-pushed the sammyk/synthetics-origin-support branch from 99850dd to ceede17 Compare October 15, 2019 15:07
@SammyK
SammyK marked this pull request as ready for review October 15, 2019 15:08

$spanContext = new SpanContext($traceId, $spanId, null, $baggageItems, true);
$this->extractPrioritySampling($spanContext, $carrier);
$this->extractOrigin($spanContext, $carrier);

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.

extracting the origin is only valid if we were able to successfully extract a trace id.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for clarifying! This line only gets run in this case as on line 67-69 there is a null-check on the trace ID. :)

@labbati labbati 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 to me. Great Sammy

@SammyK
SammyK merged commit dcc0a74 into master Oct 16, 2019
@SammyK
SammyK deleted the sammyk/synthetics-origin-support branch October 16, 2019 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍏 core Changes to the core tracing functionality 🏆 enhancement A new feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants