-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add opencensus tracing bridge #1305
Conversation
70d3003
to
0c5bd47
Compare
Codecov Report
@@ Coverage Diff @@
## master #1305 +/- ##
======================================
Coverage 77.3% 77.3%
======================================
Files 122 123 +1
Lines 5978 6067 +89
======================================
+ Hits 4622 4694 +72
- Misses 1107 1120 +13
- Partials 249 253 +4
|
93d25a9
to
1a915b8
Compare
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. Only comments are not blocking.
I think the use of the error handler to address incompatibilities with the APIs is the correct way to proceed. Thanks for the contribution.
1a915b8
to
3f89477
Compare
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.
One nit, otherwise looks good.
3f89477
to
b6baa8e
Compare
@dashpole the upstream move of packages has caused conflicts here. Let me know if you would like help resolving these, I'm happy to push a fix if you don't have the time. |
8ebb078
to
863d936
Compare
Updated! |
Issue: #93
This adds an opencensus bridge for tracing. Tracing is particularly important to have a bridge for, as different libraries used in a single go binary may use either opencensus or opentelemetry. In that case, opentelemetry and opencensus spans would not properly share parent-child relationships. The same problem doesn't exist for metrics, as a single go binary can use both opencensus and opentelemetry libraries without a loss of functionality (assuming appropriate exporters are registered for each)
Using the bridge requires overriding the opencensus default tracer with the bridge.:
This will cause all calls to the OpenCensus global functions (such as
StartSpan
) to call the relevant OpenTelemetry function. OpenCensus spans recorded while using this bridge will not export to OpenCensus exporters anymore. Instead, they will export to the registered opentelemetry exporter(s).Note: This adds new go.mod/go.sum so "regular" users of opentelemetry don't have to pull in opencensus imports.
Note: This uses an unreleased commit for opencensus. I can see if I can get a release cut if that is a blocker for this PR.