-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: //dd:span
on func main()
does not work
#316
Conversation
Since the tracer was started at the start of the `main` function, a `//dd:span` annotation there may not have been honored, depending on the order in which aspects were woven into the file. This PR mvoes the tracer initialization to a `func init()` function, so that it happens strictly before the `main` function starts executing, making it possible to `//dd:span` the `main` function reliably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts for later: would it be better to divide this aspect into 2: one for starting the tracer and one for the profiler ? Especially since we can add multiple init functions in the same file
…he end of their respective init blocks
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #316 +/- ##
==========================================
+ Coverage 57.93% 61.04% +3.11%
==========================================
Files 151 149 -2
Lines 10973 9419 -1554
==========================================
- Hits 6357 5750 -607
+ Misses 4149 3199 -950
- Partials 467 470 +3
|
Since the tracer was started at the start of the
main
function, a//dd:span
annotation there may not have been honored, depending on the order in which aspects were woven into the file.This PR mvoes the tracer initialization to a
func init()
function, so that it happens strictly before themain
function starts executing, making it possible to//dd:span
themain
function reliably.