-
Notifications
You must be signed in to change notification settings - Fork 637
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 trace bridge/shim #3210
Add OpenCensus trace bridge/shim #3210
Conversation
eeddf41
to
1097e70
Compare
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/__init__.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_patch.py
Outdated
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_patch.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_patch.py
Outdated
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_patch.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_tracer.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_tracer.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_tracer.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_tracer.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_patch.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_patch.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_tracer.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_patch.py
Show resolved
Hide resolved
Thanks for reviews everyone. I just realized we probably need to bridge the Context APIs as well for instrumentations which extract a Context with propagators e.g. opencensus-ext-flask. I'll work on this in a separate PR and track it in the issue. |
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_span.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_span.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_span.py
Show resolved
Hide resolved
shim/opentelemetry-opencensus-shim/src/opentelemetry/shim/opencensus/_shim_span.py
Show resolved
Hide resolved
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.
Mostly looking at this for OC compatibility compliance.
Tests cover everything I'd expect to see. Also to confirm, this does NOT include the bridge for propagation right?
Correct. I updated #3203 to track it. |
@jeremydvoss PTAL. |
Description
Implements the OpenCensus tracing shim/bridge. See issue for more details. For now, users must import and call
install_shim()
for the shim to take effect.Part of #3203
Caveats
Tracer.start_span()
only accepts span name, while OTel only allows setting those properties instart_span()
; there is no way to set them after the fact with a pure API bridge.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Added many tests for mapping logic and interaction with OpenTelemetry. There are test for the "OpenTelemetry sandwich" problem, where OpenCensus and OpenTelemetry instrumentation should interoperate.
Does This PR Require a Contrib Repo Change?
Answer the following question based on these examples of changes that would require a Contrib Repo Change:
The OTel specification has changed which prompted this PR to update the method interfaces of
opentelemetry-api/
oropentelemetry-sdk/
The method interfaces of
test/util
have changedScripts in
scripts/
that were copied over to the Contrib repo have changedConfiguration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in
pyproject.toml
isort.cfg
.flake8
When a new
.github/CODEOWNER
is addedMajor changes to project information, such as in:
README.md
CONTRIBUTING.md
Yes. - Link to PR:
No.
Checklist: