diff --git a/lib/datadog/opentelemetry/sdk/propagator.rb b/lib/datadog/opentelemetry/sdk/propagator.rb index 9b913551a6d..aa2f6577c5f 100644 --- a/lib/datadog/opentelemetry/sdk/propagator.rb +++ b/lib/datadog/opentelemetry/sdk/propagator.rb @@ -43,7 +43,7 @@ def extract( # Converts the {Numeric} Datadog id object to OpenTelemetry's byte array format. trace_id = [format('%032x', digest.trace_id)].pack('H32') - span_id = [format('%016x', digest.trace_id)].pack('H16') + span_id = [format('%016x', digest.span_id)].pack('H16') if digest.trace_state || digest.trace_flags trace_flags = ::OpenTelemetry::Trace::TraceFlags.from_byte(digest.trace_flags)