Tracer.Span


interface Tracer.Span : 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 functions

Tracer.Span

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

Unit

Closes and ends this span.

Public functions

beginChildSpan

@MustBeClosed
fun beginChildSpan(name: String): Tracer.Span

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
name: String

A name describing the inner action performed.

Returns
Tracer.Span

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

close

fun close(): Unit

Closes and ends this span.

Callers must not interact any further with this span.