/** * {@inheritDoc} */ @Override public ServerSpan getCurrentServerSpan() { return serverSpanState.getCurrentServerSpan(); }
/** * This should be called in the thread in which the request was received before executing code in new threads. * <p> * It returns the current server span which you can keep and bind to a new thread using * {@link ServerSpanThreadBinder#setCurrentSpan(ServerSpan)}. * * @see ServerSpanThreadBinder#setCurrentSpan(ServerSpan) * @return Returned Span can be bound to different executing threads. */ @Nullable public ServerSpan getCurrentServerSpan() { return state.getCurrentServerSpan(); }
/** * {@inheritDoc} */ @Override Span getSpan() { return state.getCurrentServerSpan().getSpan(); }
/** * This should be called in the thread in which the request was received before executing code in new threads. * <p> * It returns the current server span which you can keep and bind to a new thread using * {@link ServerSpanThreadBinder#setCurrentSpan(ServerSpan)}. * * @see ServerSpanThreadBinder#setCurrentSpan(ServerSpan) * @return Returned Span can be bound to different executing threads. */ @Nullable public ServerSpan getCurrentServerSpan() { return state.getCurrentServerSpan(); }
/** * {@inheritDoc} */ @Override Span getSpan() { return state.getCurrentServerSpan().getSpan(); }
/** * {@inheritDoc} */ @Override public Span span() { return state().getCurrentServerSpan().getSpan(); }
/** * {@inheritDoc} */ @Override public Span span() { return state().getCurrentServerSpan().getSpan(); }
/** * {@inheritDoc} */ @Override public void setServerSend() { final Span currentSpan = state.getCurrentServerSpan().getSpan(); if (currentSpan != null) { submitAnnotation(zipkinCoreConstants.SERVER_SEND); final long threadDuration = state.getServerSpanThreadDuration(); if (threadDuration > 0) { submitBinaryAnnotation(BraveAnnotations.THREAD_DURATION, String.valueOf(threadDuration)); } collector.collect(currentSpan); state.setCurrentServerSpan(null); } }