Encoding the baggage items of a span context using DefaultMetadataEncoder.encode() can lead to an error if the baggage items are too huge to fit in the default buffer capacity (which seems to be 256).
The problem is that Tracing.mapToByteBuf uses keyLength instead of valueLength for writing value to byteBuf:
  
  
    
        
          |  | ByteBufUtil.reserveAndWriteUtf8(byteBuf, value, keyLength); |