def test_tcollector_submit(trace_server): tchannel = TChannel(name='test', known_peers=[trace_server.hostport]) trace = Trace(endpoint=Endpoint("1.0.0.1", 1111, "tcollector")) anns = [client_send()] results = yield TChannelZipkinTracer(tchannel).record([(trace, anns)]) assert results[0].ok
def before_send_request(self, request): if not request.tracing.traceflags: return if not request.tracing.parent_span_id and not self._lucky( request.tracing.trace_id): # disable trace request.tracing.traceflags = False return ann = annotation.client_send() request.tracing.annotations.append(ann)
def before_send_request(self, request): if not request.tracing.traceflags: return if not request.tracing.parent_span_id and not self._lucky( request.tracing.trace_id ): # disable trace request.tracing.traceflags = False return ann = annotation.client_send() request.tracing.annotations.append(ann)
def test_span_host_field(): tchannel = TChannel('test') tchannel.listen() tracer = TChannelZipkinTracer(tchannel) host_span = tracer.parse_host_port() thrift_obj = thrift_formatter( trace=Trace(name='test', endpoint=Endpoint('0.0.0.1', 90, 'test1')), annotations=[annotation.client_send()], isbased64=False, span_host=host_span, ) assert thrift_obj.spanHost.ipv4 == ipv4_to_int(host_span.ipv4) assert thrift_obj.spanHost.port == host_span.port assert thrift_obj.spanHost.serviceName == host_span.service_name
def before_send_request(self, request): if not request.tracing.traceflags: return ann = annotation.client_send() request.tracing.annotations.append(ann)