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(tracing): Add method for accessing span data #548

Merged
merged 5 commits into from
Feb 8, 2023

Conversation

loewenheim
Copy link
Contributor

This adds a data method to performance::Span that gives exclusive access to the underlying protocol::Span's data field (a map from String to protocol::Value). Since the inner span is behind a Mutex, the data method returns a Data smart pointer that holds the lock.

@loewenheim loewenheim self-assigned this Feb 6, 2023
@codecov
Copy link

codecov bot commented Feb 6, 2023

Codecov Report

Merging #548 (a12490b) into master (37be013) will decrease coverage by 0.10%.
The diff coverage is 0.00%.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #548      +/-   ##
==========================================
- Coverage   70.68%   70.59%   -0.10%     
==========================================
  Files          66       66              
  Lines        6649     6658       +9     
==========================================
  Hits         4700     4700              
- Misses       1949     1958       +9     

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.

I’m not entirely sure if we call out locking explicitly in other parts of the SDK, but it might be good to at least mention it, as otherwise this is a footgun that could lead to deadlocks.

@loewenheim
Copy link
Contributor Author

Yeah, I was wondering about this as well. I'll add a note.

@Swatinem
Copy link
Member

Swatinem commented Feb 6, 2023

Another idea would be to take a FnOnce, but that is also not quite ergonomic.

@loewenheim loewenheim enabled auto-merge (squash) February 8, 2023 09:39
@loewenheim loewenheim merged commit 499a435 into master Feb 8, 2023
@loewenheim loewenheim deleted the feat/expose-span-data branch February 8, 2023 09:47
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