Skip to content
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

Fix sw-rabbitmq TypeError when there are no headers #182

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions skywalking/plugins/sw_rabbitmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ def _sw__on_deliver(this, method_frame, header_frame, body):
routing_key = method_frame.method.routing_key
carrier = Carrier()
for item in carrier:
if item.key in header_frame.properties.headers:
item.val = header_frame.properties.headers[item.key]
try:
if item.key in header_frame.properties.headers:
item.val = header_frame.properties.headers[item.key]
except TypeError:
pass

with context.new_entry_span(op='RabbitMQ/Topic/' + exchange + '/Queue/' + routing_key
+ '/Consumer' or '', carrier=carrier) as span:
Expand Down