-
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
feat: add keys operation to getter #1576
feat: add keys operation to getter #1576
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
- Coverage 91.40% 91.18% -0.23%
==========================================
Files 165 164 -1
Lines 5013 5024 +11
Branches 1023 1026 +3
==========================================
- Hits 4582 4581 -1
- Misses 431 443 +12
|
* A setter is specified by the caller to define a specific method | ||
* to set key/value pairs on the carrier within a propagator. | ||
*/ | ||
export interface Setter<Carrier = any> { |
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.
should the interfaces lives in types
file or maybe the Noop ?
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 interface was originally in its own file, but I think it makes sense to keep it more tightly coupled to the TextMapPropagator since this getter is specifically for this type of propagator. If other propagator types are added in the future like binary they may have different interfaces.
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'm fine with keeping the interfaces together with class if they are not exported or keeping them in some general file like types.ts
. Otherwise I would rather keep them in separate file or in general types.ts
as it quickly gets messy later with any refactoring or when trying to find the desired interface.
Because of that:
If other propagator types are added in the future like binary they may have different interfaces.
Can you change names:
- Setter into TextMapSetter
- Getter into TextMapGetter
- defaultGetter into defaultTextMapGetter
and then mentioned types.ts
should become textMapTypes.ts
?
WDYT ?
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 TextMapPropagator is already just an interface. Won't it be weird to have a types
file, but then also have some types (the TextMapPropagator
interface) defined in a different file? I agree with the renaming though.
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.
you right it is interface already I was blind :/
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 did the rename as I think that is a good idea to prevent future incompatibilities
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
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
* feat: add keys operation to getter * chore: lint * chore: rename getter/setter to TextMapGetter/Setter * chore: lint * chore: use setter in fetch plugin * chore: lint * chore: remove logs
* feat: add keys operation to getter * chore: lint * chore: rename getter/setter to TextMapGetter/Setter * chore: lint * chore: use setter in fetch plugin * chore: lint * chore: remove logs
…est in node@18 (open-telemetry#1576) * chore(restify): upgrade restify to 9.1.0 * chore(restify): upgrade restify to 10.0.0 && re-enable node@18 test * chore(restify): upgrade restify to 11.1.0 * chore(restify): re-enable test in tav * chore(restify): update tav with corrent node.js version range check * chore(restify): fix missing newline * chore(restify): update tav to version 9.1.0 instead of 9.0.0 * chore: upgrade document and tav for restify * chore: pin restify version --------- Co-authored-by: Haddas Bronfman <[email protected]>
Fixes #1486
Changes getter and setter to be an interface rather than a function so more operations may be added later.