Skip to content

Commit

Permalink
only sample if sampling decision not already made
Browse files Browse the repository at this point in the history
  • Loading branch information
ZStriker19 committed Sep 25, 2024
1 parent 09b7afd commit 10af562
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/datadog/tracing/trace_operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 10af562

Please sign in to comment.