-
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
Move SpanContext isValid to the API #1447
Move SpanContext isValid to the API #1447
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1447 +/- ##
=======================================
Coverage 93.99% 93.99%
=======================================
Files 153 153
Lines 4663 4666 +3
Branches 962 963 +1
=======================================
+ Hits 4383 4386 +3
Misses 280 280
|
01a7e21
to
9c34b01
Compare
4f31b28
to
2221074
Compare
The spec suggests adding a helper function. open-telemetry/opentelemetry-specification#771 (comment) @srjames90 can you implement Making changes to the ~30 callers is fine. |
Cool, sounds good. Sounds like the current changes are fine, and just have to rename the function. Thanks, will do it now. |
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.
I have to block because you have broken the spec compliance of the B3 propagator. Everything else looks good.
packages/opentelemetry-core/src/context/propagation/B3Propagator.ts
Outdated
Show resolved
Hide resolved
Looks like @srjames90 put the function at |
@srjames90 pls move the function to |
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
* refactor: make spanContext into class with isValid * refactor: use class instantiation for spanContext * refactor: moves test and fix tests * fix: add check for isValid * revert: the changes to spanContext * refactor: move spancontext-utils to api package * fix: lint and invalid psan id and invalid trace id * fix: make isValid more robust * refactor: rename isValid to isSpanContextValid * refactor: update regex and checks * fix: export isSpanContextValid from api.trace * fix: run npm run lint:fix * fix: run lint fix in api * refactor: prevent function overhead * fix: lint * fix: remove unused import Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
* refactor: make spanContext into class with isValid * refactor: use class instantiation for spanContext * refactor: moves test and fix tests * fix: add check for isValid * revert: the changes to spanContext * refactor: move spancontext-utils to api package * fix: lint and invalid psan id and invalid trace id * fix: make isValid more robust * refactor: rename isValid to isSpanContextValid * refactor: update regex and checks * fix: export isSpanContextValid from api.trace * fix: run npm run lint:fix * fix: run lint fix in api * refactor: prevent function overhead * fix: lint * fix: remove unused import Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Which problem is this PR solving?
Fixes #1414
Short description of the changes
Changes SpanContext interface to a class and adds an isValid method to it. This also updates every reference to SpanContext to instantiate the spanContext using new instead of an object literal matching the interface.
Started as draft in case this isn't what we had in mind since it ends up changing so many files. I had to go through so many files because the interfaces were being implemented with object literals.