Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.