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

feat(sentry-core): add support for w3c traceparent #687

Merged

Conversation

saiintbrisson
Copy link
Contributor

@saiintbrisson saiintbrisson commented Sep 26, 2024

This change does three things:

  1. Add a function to allow creating a TransactionContext with a custom Trace ID without a parent span ID.
    My company is testing traces on Sentry in parallel to our current trace solution, for ease of use, we'd like to keep using the same trace ID on both platforms for now. Currently, my approach is to create a sentry-trace header with a zeroed span ID, but the UI has this bright red alert telling me that the parent span ID is invalid, and this is bugging me. I doubt I'm the only one who has faced this issue before.
  2. Implements support for the traceparent as stated in Tracing: W3C Trace Context Support team-sdks#41. sentry-trace still takes precedence. It does not emit the header, though. Should it? It only allows for parsing for now.
  3. Creates a builder allowing to customize the creation of a transaction.

@saiintbrisson saiintbrisson marked this pull request as draft September 27, 2024 01:48
@saiintbrisson
Copy link
Contributor Author

I need to figure some stuff out in #686 before doing this one.

@szokeasaurusrex szokeasaurusrex self-requested a review September 30, 2024 08:31
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 4 lines in your changes missing coverage. Please review.

Project coverage is 73.26%. Comparing base (e3b0fba) to head (4ca67ff).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #687      +/-   ##
==========================================
+ Coverage   73.25%   73.26%   +0.01%     
==========================================
  Files          66       66              
  Lines        7754     7781      +27     
==========================================
+ Hits         5680     5701      +21     
- Misses       2074     2080       +6     

@saiintbrisson saiintbrisson force-pushed the chore/support-w3c-traceparent branch from 33ebddb to 25dbadd Compare November 28, 2024 16:26
@saiintbrisson saiintbrisson marked this pull request as ready for review November 28, 2024 16:28
@saiintbrisson
Copy link
Contributor Author

@Swatinem this one is also ready to be reviewed.

@Swatinem Swatinem merged commit 05fc7de into getsentry:master Nov 29, 2024
14 checks passed
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