Cloud-Native-App-Spring-Boot icon indicating copy to clipboard operation
Cloud-Native-App-Spring-Boot copied to clipboard

when request from react client, the tracing is not visible in zipkin

Open ubaid4j opened this issue 4 years ago • 1 comments

ubaid4j avatar Jun 26 '21 18:06 ubaid4j

When our Web Client creates a GET request, first it does an option request. In my understanding, due to option request, the subsequent GET request span becomes noop which means no recording will be done for this span and we get no tracing in UI.

Please see code here: brave.http.HttpHandler#handleFinish

  void handleFinish(HttpResponse response, Span span) {
    if (response == null) throw new NullPointerException("response == null");
    if (span == null) throw new NullPointerException("span == null");
    if (span.isNoop()) return;

    if (response.error() != null) {
      span.error(response.error()); // Ensures MutableSpan.error() for SpanHandler
    }

    try {
      parseResponse(response, span);
    } catch (Throwable t) {
      propagateIfFatal(t);
      Platform.get().log("error parsing response {0}", response, t);
    } finally {
      long finishTimestamp = response.finishTimestamp();
      if (finishTimestamp == 0L) {
        span.finish();
      } else {
        span.finish(finishTimestamp);
      }
    }
  }

Need to do R&D on the following points:

  • [ ] why our request span becomes noop?

ubaid4j avatar Apr 30 '22 22:04 ubaid4j