def span_to_bytes(thrift_span):
transport = TMemoryBuffer()<EOL>protocol = TBinaryProtocol(transport)<EOL>thrift_span.write(protocol)<EOL>return bytes(transport.getvalue())<EOL>
Returns a TBinaryProtocol encoded Thrift span.

:param thrift_span: thrift object to encode.
:returns: thrift object in TBinaryProtocol format bytes.