Skip to content

sentry-core: make TraceContext publicly readable#534

Merged
Swatinem merged 2 commits into
getsentry:masterfrom
tommilligan:read-transaction-tracecontext
Jan 13, 2023
Merged

sentry-core: make TraceContext publicly readable#534
Swatinem merged 2 commits into
getsentry:masterfrom
tommilligan:read-transaction-tracecontext

Conversation

@tommilligan

Copy link
Copy Markdown
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

codecov-commenter commented Jan 12, 2023

Copy link
Copy Markdown

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     

@Swatinem Swatinem left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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.

3 participants