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

Add Traceparent to Outgoing Requests #172

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

dvernon-splunk
Copy link
Contributor

@dvernon-splunk dvernon-splunk commented Sep 28, 2023

Adds the traceparent to the header of outgoing HTTP requests.

Unfortunately, the request object is get-only where we were creating spans, requiring us to swizzle the task functions in URLSessionTask. This solution was adapted, and heavily modified, from opentelemetry-swift: https://github.com/open-telemetry/opentelemetry-swift/blob/8d6fa745c186e3b7556f330b5236da25fa7c9d62/Sources/Instrumentation/URLSession/URLSessionInstrumentation.swift

The proposed solution swizzles urlsession tasks that take in (or requests) a request object, and passes through a modified request object with the added traceparent header.

Also includes a new variable in SplunkRumOptions, allowing users to enable. It is false by default.

@dvernon-splunk dvernon-splunk requested a review from a team as a code owner September 28, 2023 22:45
@dvernon-splunk
Copy link
Contributor Author

Found an issue while debugging the failing unit test: Do not review yet.

@dvernon-splunk
Copy link
Contributor Author

The unit tests are still failing, but I wanted to get this proposed solution in before I leave for vacation. The data task unit test succeeds if you run it by itself. If this direction is something we're good with, I will fix the unit tests (and bugs, and lint errors) when I return.

@dvernon-splunk dvernon-splunk requested a review from a team as a code owner October 23, 2023 20:19
Copy link

github-actions bot commented Nov 20, 2023


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (seemk)[https://github.com/seemk]
@dvernon-splunk
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants