File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,14 @@ def _prepopulate_attributes(job, queue):
193193 if getattr (queue , prop , None ) is not None :
194194 attributes [attr ] = getattr (queue , prop )
195195
196- for key in ("args" , "kwargs" , "func" ):
196+ for key in ("args" , "kwargs" ):
197197 if getattr (job , key , None ):
198198 attributes [f"rq.job.{ key } " ] = _serialize_span_attribute (getattr (job , key ))
199199
200+ func = job .func
201+ if callable (func ):
202+ func = func .__name__
203+
204+ attributes ["rq.job.func" ] = _serialize_span_attribute (func )
205+
200206 return attributes
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ def test_traces_sampler_gets_correct_values_in_sampling_context(sentry_init):
234234 assert sampling_context ["messaging.system" ] == "rq"
235235 assert sampling_context ["rq.job.args" ] == ["Bodhi" ]
236236 assert sampling_context ["rq.job.kwargs" ] == '{"trick": "roll over"}'
237- assert "do_trick" in sampling_context ["rq.job.func" ]
237+ assert sampling_context ["rq.job.func" ] == "do_trick"
238238 assert sampling_context ["messaging.message.id" ]
239239 assert sampling_context ["messaging.destination.name" ] == "default"
240240
You can’t perform that action at this time.
0 commit comments