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 a method to get transaction for given span: GetTransaction() #558

Merged
merged 7 commits into from Jan 31, 2023

Conversation

tonyo
Copy link
Member

@tonyo tonyo commented Jan 30, 2023

Add a function to get the transaction span for the given span: Span.GetTransaction()
This is needed for a proper fix for #553.

Things left to agree on: Function name
In Python, for example, there's a containing_transaction method on Spans and Transactions.

@tonyo tonyo self-assigned this Jan 30, 2023
@codecov
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

Base: 75.47% // Head: 75.48% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (76ebf1b) compared to base (d362c36).
Patch coverage: 71.42% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #558      +/-   ##
==========================================
+ Coverage   75.47%   75.48%   +0.01%     
==========================================
  Files          37       37              
  Lines        3751     3765      +14     
==========================================
+ Hits         2831     2842      +11     
  Misses        808      808              
- Partials      112      115       +3     
Impacted Files Coverage Δ
tracing.go 87.47% <71.42%> (-0.52%) ⬇️
transport.go 78.37% <0.00%> (-0.85%) ⬇️
span_recorder.go 89.65% <0.00%> (+13.79%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@cleptric cleptric left a comment

Choose a reason for hiding this comment

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

I think this is mostly OK for the time being.
No hard feelings about the name, it's Span::getTransaction in PHP as well.

Slightly OT, but I think this is a good example of why we should add proper abstractions for Transactions/Spans.
https://github.com/getsentry/sentry-php/blob/bfa3193944fe385af7d6b6b063962fc45956a817/src/Tracing/Span.php#L390-L406

I kinda like the way all parent properties are explicitly set on a child span.

tracing.go Outdated Show resolved Hide resolved
tonyo and others added 4 commits January 31, 2023 12:21
@tonyo tonyo marked this pull request as ready for review January 31, 2023 11:45
@tonyo tonyo requested a review from cleptric January 31, 2023 11:45
@tonyo tonyo merged commit 4e5ede9 into master Jan 31, 2023
@tonyo tonyo deleted the tonyo/feat-add-gettransaction branch January 31, 2023 12:11
@tonyo tonyo changed the title feat(tracing): Add a method to get transaction for given span feat(tracing): Add a method to get transaction for given span: GetTransaction() Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants