From 10af56275e28921eb4d89153c213bc0b5658b984 Mon Sep 17 00:00:00 2001 From: ZStriker19 Date: Tue, 24 Sep 2024 20:43:00 -0400 Subject: [PATCH] only sample if sampling decision not already made --- lib/datadog/tracing/trace_operation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/datadog/tracing/trace_operation.rb b/lib/datadog/tracing/trace_operation.rb index 42f68afb305..b7097bfede6 100644 --- a/lib/datadog/tracing/trace_operation.rb +++ b/lib/datadog/tracing/trace_operation.rb @@ -291,7 +291,7 @@ def to_digest span_id = @active_span && @active_span.id span_id ||= @parent_span_id unless finished? # sample the trace_operation with the tracer - tracer.sample_trace(self) + tracer.sample_trace(self) if @sampled.nil? TraceDigest.new( span_id: span_id,