-
Notifications
You must be signed in to change notification settings - Fork 651
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 fields property #1374
Add fields property #1374
Conversation
cba1c06
to
08d86fb
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.
This is looking pretty good! Just a couple of questions I'd like to have answered before I approve
|
||
for propagator in self._propagators: | ||
for field in propagator.fields: | ||
composite_fields.add(field) |
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.
is the behaviour for the composite propagator specified in the spec?
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 don't think it is, I tried to replicate the Go implementation with one particular difference. In this implementation a set
is returned instead of a list
. There is no defined order for these fields (these fields may be called in inject
in an arbitrary order and even if this order is constant it has no relation with the fields themselves), so an ordered sequence like a list makes no sense. Also, (if I understand correctly) the intention of this attribute is to allow the user to tell if a certain field is also used in inject
. That is an in
operation that has a better (O(1)) performance in a set
than in a list (O(N)).
19ee9fa
to
7d432b9
Compare
579af1a
to
92ccbf1
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.
Thanks for addressing my comments.
1ff26a1
to
c76a8f9
Compare
opentelemetry-api/CHANGELOG.md
Outdated
@@ -2,6 +2,8 @@ | |||
|
|||
## Unreleased | |||
|
|||
- Add `fields` to propagators ([#1374](https://github.com/open-telemetry/opentelemetry-python/pull/1374)) |
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 PR link should probably go on a new line
Fixes #1104
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist:
Tagging @carlosalberto as requested 👍