-
Notifications
You must be signed in to change notification settings - Fork 652
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
Changes from 8 commits
7f6e35a
9a38958
6abc868
6f25ec1
03ae720
648c198
5de7ffd
9a3b65b
7119e71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,18 @@ def inject( | |
""" | ||
for propagator in self._propagators: | ||
propagator.inject(set_in_carrier, carrier, context) | ||
|
||
@property | ||
def fields(self) -> typing.Set[str]: | ||
"""Returns a set with the fields set in `inject`. | ||
|
||
See | ||
`opentelemetry.trace.propagation.textmap.TextMapPropagator.fields` | ||
""" | ||
composite_fields = set() | ||
|
||
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 commentThe 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 commentThe 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 |
||
|
||
return composite_fields |
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