-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Move stackdriver trace exporter to new interface and pdata #486
Move stackdriver trace exporter to new interface and pdata #486
Conversation
@stevencl1013 I think I've found the root cause after debugging the test:
Note the first error message. It comes from cloudtrace.go#L221 (SDK exporter you have imported in this PR). So we fail to export, because the context has been cancelled. The question is what is that context and why has it been cancelled early? The answer is related to open-telemetry/opentelemetry-collector#1386 as you suspected.
Hopefully it's not too confusing? The workaround is trivial: don't forward the context passed into collector exporter to SDK exporter, and create a new context instead. // NOTE: SDK Trace exporter exports data asynchronously via bundler,
// so we can't use the parent (synchronous) context, which gets cancelled
// immediately after this function is executed.
ctx = context.Background() // create a new context to avoid cancellation
for _, span := range spans {
te.texporter.ExportSpan(ctx, span)
goodSpans++
} Alternatively, we may make the use of bundler configurable, i.e. support "synchronous mode" which would've made more sense here. |
Great work finding this issue. I think it would make more sense to put the fix into i.e. do not pass context into bundler; instead you can extract the spans from context first, and pass those in or do something similar. |
Co-authored-by: Nail Islamov <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #486 +/- ##
==========================================
+ Coverage 86.26% 86.30% +0.03%
==========================================
Files 195 195
Lines 10632 10579 -53
==========================================
- Hits 9172 9130 -42
+ Misses 1128 1123 -5
+ Partials 332 326 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@nilebox Thanks for finding the cause of the issue! I committed the change and it seems to be working now, but I'll also look into modifying the |
…etry-collector-contrib into stackdriver-pdata
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.
Looks good, just need a couple of final cleanups.
@stevencl1013 the build is failing, please ping me when it's ready for another round of reviews. |
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.
LGTM, thanks for patiently addressing issues and feedback :)
@bogdandrutu Just noticed that my approval is not "green", could you add me to approvers in the contrib repo as well? |
Description: Changes stackdriver trace exporter to use pdata and implement the new exporter interface rather than the old, and use the OT Go stackdriver exporter rather than the OC one. The metric exporter is just converting from pdata back to consumerdata and still using the OC exporter.
Testing: Modified the tests for stackdriver, data conversion, and factory to reflect changes.