com.github.kristofa.brave.ServerSpanState Maven / Gradle / Ivy
The newest version!
package com.github.kristofa.brave;
import com.github.kristofa.brave.internal.Nullable;
/**
* Maintains state for a single server span.
*
* Server spans can be at the following locations in the span tree.
*
* - The root-span of a trace originated by Brave
* - A child of a span propagated to Brave
*
*
* @author kristof
*/
public interface ServerSpanState extends CommonSpanState {
/**
* Gets the Span for the server request we are currently part of.
*
* Should be thread-aware to support multiple parallel requests.
*
* @return Server request span for current thread. This will return the span we are part of. In case we should not trace
* current request null
will be returned.
*/
@Nullable
ServerSpan getCurrentServerSpan();
/**
* Set span for current request.
*
* @param span Span for current request.
*/
void setCurrentServerSpan(final ServerSpan span);
}