File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,6 +213,7 @@ def _sentry_execute(
213213 "sentry.op" : OP .QUEUE_TASK_HUEY ,
214214 "sentry.origin" : HueyIntegration .origin ,
215215 "sentry.span.source" : SegmentSource .TASK ,
216+ SPANDATA .MESSAGING_DESTINATION_NAME : self .name ,
216217 "messaging.message.id" : task .id ,
217218 "messaging.message.system" : "huey" ,
218219 "messaging.message.retry.count" : (task .default_retries or 0 )
@@ -230,6 +231,7 @@ def _sentry_execute(
230231 )
231232 transaction .set_status (SPANSTATUS .OK )
232233 span_ctx = sentry_sdk .start_transaction (transaction )
234+ span_ctx .set_data (SPANDATA .MESSAGING_DESTINATION_NAME , self .name )
233235
234236 if not getattr (task , "_sentry_is_patched" , False ):
235237 task .execute = _wrap_task_execute (task .execute )
Original file line number Diff line number Diff line change @@ -102,6 +102,9 @@ def division(a, b):
102102 )
103103 assert execute_span ["is_segment" ]
104104 assert execute_span ["attributes" ]["sentry.op" ] == OP .QUEUE_TASK_HUEY
105+ assert (
106+ execute_span ["attributes" ][SPANDATA .MESSAGING_DESTINATION_NAME ] == huey .name
107+ )
105108 assert execute_span ["name" ] == "division"
106109 assert execute_span ["status" ] == (
107110 SpanStatus .ERROR if task_fails else SpanStatus .OK
@@ -121,6 +124,10 @@ def division(a, b):
121124 assert event ["type" ] == "transaction"
122125 assert event ["transaction" ] == "division"
123126 assert event ["transaction_info" ] == {"source" : "task" }
127+ assert (
128+ event ["contexts" ]["trace" ]["data" ][SPANDATA .MESSAGING_DESTINATION_NAME ]
129+ == huey .name
130+ )
124131
125132 if task_fails :
126133 assert event ["contexts" ]["trace" ]["status" ] == "internal_error"
You can’t perform that action at this time.
0 commit comments