-
Notifications
You must be signed in to change notification settings - Fork 821
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
chore: remove tracer apis not part of spec #1764
chore: remove tracer apis not part of spec #1764
Conversation
This removes getCurrentSpan(), bind() and with() from Tracer because they are not required by spec and context operations are a concern of context not Tracer. At least in NoopTracer the implementation of them was incorrect because context was not used.
Codecov Report
@@ Coverage Diff @@
## master #1764 +/- ##
==========================================
+ Coverage 92.09% 92.13% +0.04%
==========================================
Files 166 166
Lines 5591 5571 -20
Branches 1198 1197 -1
==========================================
- Hits 5149 5133 -16
+ Misses 442 438 -4
|
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.
For those that don't know, the spec removed these methods from the tracer https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#tracer and the only method left in spec is startSpan
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, i understand now why we should maybe namespace the context helpers since those methods has been removed
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,
I think we should provide a short guide in readme "how to upgrade" as withSpan
function was very popular and was used widely so people might be confused how they should update code correctly. Would be nice to add this example in readme for some time being
context.with(setActiveSpan(context.active(), span) ...
@obecny Added a section in readme Most likely it would be in general good to add something like this for all breaking changes. |
bceec5e
to
752f76f
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.
The API_BACKWARDS_COMPATIBILITY_VERSION
should be bumped as this change is breaking.
Should we do this on each PR or once per release? By the way, we forgot to update this in 0.14.0 (incompatible at least because of #1734) |
Once per release should be fine I think
👀 seems you're right. I'm working on making this use the current version and semver semantics at the moment so hopefully this will be automatic in the future. |
Think this is mergeable when conflicts are fixed |
Co-authored-by: Mayur Kale <[email protected]> Co-authored-by: Daniel Dyla <[email protected]>
Co-authored-by: Mayur Kale <[email protected]> Co-authored-by: Daniel Dyla <[email protected]>
This removes
getCurrentSpan()
,bind()
andwith()
fromTracer
because they are not required by spec and context operations are a concern ofcontext
notTracer
.At least in
NoopTracer
the implementation of them was incorrect becausecontext
was not used.