def _call_traced(self: MethodProxy, *args, **kwargs): span = zipkin.zipkin_client_span(self.service_name, self.method_name, transport_handler=transport_handler) start_span(span) self.worker_ctx.data.update(zipkin.create_http_headers_for_new_span()) try: reply = _call(self, *args, **kwargs) except: stop_span(span) raise return TracedRpcReply(reply.reply_event, span)
def worker_setup(self, worker_ctx): span = self.spans.get(worker_ctx.call_id) if span: worker_ctx.data[PARENT_SPAN_ID_HEADER] = span.zipkin_attrs.span_id start_span(span)
def worker_setup(self, worker_ctx): span = self.spans.get(worker_ctx.call_id) if span: logger.debug('starting span for {}.{}'.format(worker_ctx.service_name, worker_ctx.entrypoint.method_name)) worker_ctx.data[PARENT_SPAN_ID_HEADER] = span.zipkin_attrs_override.span_id start_span(span)