Convert a span attribute dict to protobuf, including Links, Attributes,
    TimeEvents.

    Args:
        span_attr (dict): A dict that needs to be converted to protobuf.
        proto_type (str): The type of the Protobuf.

    Returns:
        An instance of the specified protobuf.

def _span_attrs_to_pb(span_attr, proto_type):
    """
    Convert a span attribute dict to protobuf, including Links, Attributes,
    TimeEvents.

    Args:
        span_attr (dict): A dict that needs to be converted to protobuf.
        proto_type (str): The type of the Protobuf.

    Returns:
        An instance of the specified protobuf.
    """
    attr_pb = getattr(trace_pb2.Span, proto_type)()
    ParseDict(span_attr, attr_pb)
    return attr_pb