def generate_span_requests(self, span_datas): """Span request generator. :type span_datas: list of :class:`~opencensus.trace.span_data.SpanData` :param span_datas: SpanData tuples to convert to protobuf spans and send to opensensusd agent :rtype: list of `~gen.opencensus.agent.trace.v1.trace_service_pb2.ExportTraceServiceRequest` :returns: List of span export requests. """ pb_spans = [utils.translate_to_trace_proto( span_data) for span_data in span_datas] # TODO: send node once per channel yield trace_service_pb2.ExportTraceServiceRequest( node=self.node, spans=pb_spans)
def generate_span_requests(self, spans): collector_spans = translate_to_collector(spans) service_request = trace_service_pb2.ExportTraceServiceRequest( node=self.node, spans=collector_spans) yield service_request