-
Notifications
You must be signed in to change notification settings - Fork 190
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
StartSpanOptions ignored options parameter #326
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
@ChristophPech can you please explain what problem this is addressing? Preferably by adding a test case which fails without / passes with the change. We already do this in Transaction.StartSpanOptions, which is eventually called by apm.StartSpan: Lines 68 to 73 in 797c31c
|
I am using go-pg and wrote a callback to trace postgres calls. I have to set the StartTime retroactively because there is only a "finished" callback so I used apm.StartSpanOptions(...) Yes, in hindsight I could have uses Transaction.StartSpanOptions(), but the function apm.StartSpanOptions() completely ignores the opts parameter, which is a problem. |
Understood.
Sorry, I misread the issue initially, and I was looking at apm.StartSpan and not apm.StartSpanOptions. I understand now. There's a couple of issues with the patch - I'll respond with review comments. |
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.
If you are able to add a small test that would be great, otherwise I can do it next week.
- test case added
Codecov Report
@@ Coverage Diff @@
## master #326 +/- ##
=========================================
- Coverage 84.78% 81.1% -3.68%
=========================================
Files 98 98
Lines 5979 5891 -88
=========================================
- Hits 5069 4778 -291
Misses 841 841
- Partials 69 272 +203
Continue to review full report at Codecov.
|
Like WithTransaction, but permits a TransactionOptions.
- change test to check contents of resulting events, extend test cases - ignore parent span in ctx if Parent is specified
Move logic for obtaining parent span trace context and dropping if it's ended to Transaction.StartSpanOptions.
@ChristophPech did you have a chance to test this out yet? Let me know if you'd like me to take it over. There's no rush though, I'm happy to wait if you're keen to finish it off. |
Startspanoptions options
+axw Yes, I am running your changes now on my staging server for several days and it works as expexted. I used go mod to test it and have now merged it. |
Thank you very much @ChristophPech! You're the first contributor outside of @elastic 🥇 |
No description provided.