File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ def should_sample(
234
234
)
235
235
else :
236
236
logger .debug (
237
- f"[Tracing] Ignoring sampled param for non-root span { name } "
237
+ f"[Tracing.Sampler ] Ignoring sampled param for non-root span { name } "
238
238
)
239
239
240
240
# Check if there is a traces_sampler
@@ -264,7 +264,7 @@ def should_sample(
264
264
# If the sample rate is invalid, drop the span
265
265
if not is_valid_sample_rate (sample_rate , source = self .__class__ .__name__ ):
266
266
logger .warning (
267
- f"[Tracing] Discarding { name } because of invalid sample rate."
267
+ f"[Tracing.Sampler ] Discarding { name } because of invalid sample rate."
268
268
)
269
269
return dropped_result (parent_span_context , attributes )
270
270
@@ -279,13 +279,23 @@ def should_sample(
279
279
sampled = sample_rand < Decimal .from_float (sample_rate )
280
280
281
281
if sampled :
282
+ if is_root_span :
283
+ logger .debug (
284
+ f"[Tracing.Sampler] Sampled #{ name } with sample_rate: { sample_rate } and sample_rand: { sample_rand } "
285
+ )
286
+
282
287
return sampled_result (
283
288
parent_span_context ,
284
289
attributes ,
285
290
sample_rate = sample_rate_to_propagate ,
286
291
sample_rand = None if sample_rand == parent_sample_rand else sample_rand ,
287
292
)
288
293
else :
294
+ if is_root_span :
295
+ logger .debug (
296
+ f"[Tracing.Sampler] Dropped #{ name } with sample_rate: { sample_rate } and sample_rand: { sample_rand } "
297
+ )
298
+
289
299
return dropped_result (
290
300
parent_span_context ,
291
301
attributes ,
You can’t perform that action at this time.
0 commit comments