-
Notifications
You must be signed in to change notification settings - Fork 624
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
Bugfix/set default headers for properties in pika #740
Bugfix/set default headers for properties in pika #740
Conversation
ctx = propagate.extract(properties.headers, getter=_pika_getter) | ||
if not ctx: | ||
ctx = context.get_current() | ||
span = _get_span( | ||
tracer, | ||
channel, | ||
properties, | ||
span_kind=SpanKind.CLIENT, |
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.
shoudl this be producer/consumer instead of client/server?
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 guess you're right as pika does use callbacks. Updated.
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.
It is more about the communication being a single round-trip like HTTP vs async message queue one like RabbitMQ. I'm guessing pika enables the later type of communication, right?
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.
Yeah, You create a single connection and declare one or many channels, over which you declare one or many callbacks. So it is more of a producer/consumer than client/server.
Description
The pika instrumentation injects the context into the
properties.headers
of the connection. If the properties are not provided, it generates a newBasicProperties
object, which by default sets headers toNone
instead of an empty dict - which results in a failure to inject the context into the headers.The fix was to set the
headers={}
by default when creating theBasicProperties
object.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
A pika client that creates a pika connection and executes
basic_publish
without properties.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.