File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
sentry_sdk/integrations/celery Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -333,11 +333,12 @@ def _set_messaging_destination_name(task, span):
333333 """Set "messaging.destination.name" tag for span"""
334334 with capture_internal_exceptions ():
335335 delivery_info = task .request .delivery_info
336- routing_key = delivery_info .get ("routing_key" )
337- if delivery_info .get ("exchange" ) == "" and routing_key is not None :
338- # Empty exchange indicates the default exchange, meaning the tasks
339- # are sent to the queue with the same name as the routing key.
340- span .set_data (SPANDATA .MESSAGING_DESTINATION_NAME , routing_key )
336+ if delivery_info :
337+ routing_key = delivery_info .get ("routing_key" )
338+ if delivery_info .get ("exchange" ) == "" and routing_key is not None :
339+ # Empty exchange indicates the default exchange, meaning the tasks
340+ # are sent to the queue with the same name as the routing key.
341+ span .set_data (SPANDATA .MESSAGING_DESTINATION_NAME , routing_key )
341342
342343
343344def _wrap_task_call (task , f ):
You can’t perform that action at this time.
0 commit comments