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

sentry-core: make TraceContext publicly readable #534

Merged
merged 2 commits into from Jan 13, 2023

Conversation

tommilligan
Copy link
Contributor

Raised in review of #533 (comment)

This PR exposes the TraceContext stored on a Transaction or Span.

All data on the TraceContext is publicly readable in other SDKs, such as Python or Javascript.

@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2023

Codecov Report

Merging #534 (e65304d) into master (abc2b34) will decrease coverage by 0.13%.
The diff coverage is 0.00%.

❗ Current head e65304d differs from pull request most recent head a15b835. Consider uploading reports for the commit a15b835 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #534      +/-   ##
==========================================
- Coverage   69.66%   69.53%   -0.14%     
==========================================
  Files          66       66              
  Lines        6564     6577      +13     
==========================================
  Hits         4573     4573              
- Misses       1991     2004      +13     

Copy link
Member

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

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

its a bit unfortunate this is behind a lock so you need to clone :-(

but oh well

@Swatinem Swatinem enabled auto-merge (squash) January 13, 2023 14:09
@Swatinem Swatinem merged commit 104cfae into getsentry:master Jan 13, 2023
@tommilligan
Copy link
Contributor Author

its a bit unfortunate this is behind a lock so you need to clone :-(

but oh well

Agreed. I think in future there would be scope for handling this better with something like parking_lot's MutexGuard::map, if you're open to changing the implementation of Mutex: https://docs.rs/lock_api/latest/lock_api/struct.MutexGuard.html#method.map

But I think for this case, a one-off clone is not too bad.

@Swatinem
Copy link
Member

I would be hesitant to give out more lock guards, with the recent deadlock I tracked down and fixed quite painfully: #536

We should rather remove the need for locking in the first place somehow, though I have no good ideas at the moment.

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.

None yet

3 participants