Tracer.Span


public interface Tracer.Span extends Closeable


Span is a helper object denoting an ongoing time span and providing a way for the caller to close and end the span to record the end of the action being traced.

The Span interface implements Closeable to encourage its use in a try-resource block and ensure that the close method is always properly called.

Summary

Public methods

abstract @NonNull Tracer.Span

Starts a new time span nested in a parent span, to track progression of some inner action.

abstract void

Closes and ends this span.

Public methods

beginChildSpan

@MustBeClosed
abstract @NonNull Tracer.Span beginChildSpan(@NonNull String name)

Starts a new time span nested in a parent span, to track progression of some inner action.

The implementation must return a Span object which the caller must use later to close and end the span.

Multiple child spans can be created for the same parent span. It is expected that the child spans do not overlap.

Parameters
@NonNull String name

A name describing the inner action performed.

Returns
@NonNull Tracer.Span

A new span object that the caller must invoke later to close the span.

close

abstract void close()

Closes and ends this span.

Callers must not interact any further with this span.