Skip to content

Commit c2bec97

Browse files
defensively set code.function.name
1 parent 0e8d44c commit c2bec97

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • sentry_sdk/integrations

sentry_sdk/integrations/rq.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,14 @@ def sentry_patched_perform_job(
9090
"sentry.origin": RqIntegration.origin,
9191
"sentry.span.source": TransactionSource.TASK,
9292
SPANDATA.MESSAGING_MESSAGE_ID: job.id,
93-
SPANDATA.CODE_FUNCTION_NAME: job.func_name,
9493
},
9594
parent_span=None,
96-
):
95+
) as span:
96+
if span_name != "unknown RQ task":
97+
span.set_attribute(
98+
SPANDATA.CODE_FUNCTION_NAME, job.func_name
99+
)
100+
97101
rv = old_perform_job(self, job, *args, **kwargs)
98102
else:
99103
transaction = continue_trace(

0 commit comments

Comments
 (0)