RUMM-1579 Inject sampling headers to instrumented requests #575
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What and why?
🐞 This PR aligns our trace propagation logic with "How are RUM resources linked to traces?" doc by adding two more headers to instrumented requests:
As reported in #572, lack of these headers may lead to not connecting mobile and backend trace in distributed tracing. The issue is hard to reproduce in our own infra, as we seem to overwrite sampling rules. In this fix I'm basing on docs, customer observation and my research on other DD SDKs implementation (including
browser-sdk
that respects those headers).This PR targets the
1.7.0-beta4
branch made for next release. Once merged, I will raise another PR to updatemaster
with this fix from1.7.0-beta4
.How?
I added these 2 headers to
HTTPHeadersWriter
which is used internally for headers injection. I did necessary update to unit tests and integration tests (both for SwiftURLSession
and Obj-cNSURLSession
auto-instrumentation in RUM and Tracing).Review checklist