Tracing

object Tracing
Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def addEvent(name: String): URIO[Tracing, Span]

Adds an event to the current span

Adds an event to the current span

def addEventWithAttributes(name: String, attributes: Attributes): URIO[Tracing, Span]

Adds an event with attributes to the current span.

Adds an event with attributes to the current span.

def getCurrentBaggage: URIO[Tracing, Baggage]

Gets the baggage from current context

Gets the baggage from current context

def getCurrentContext: URIO[Tracing, Context]
def getCurrentSpan: URIO[Tracing, Span]
def getCurrentSpanContext: URIO[Tracing, SpanContext]

Gets the current SpanContext

Gets the current SpanContext

def inSpan[R, E, A](span: Span, spanName: String, spanKind: SpanKind, toErrorStatus: PartialFunction[E, StatusCode])(effect: ZIO[R, E, A]): ZIO[R & Tracing, E, A]

Create a child of 'span' with name 'spanName' as the current span. Ends the span when the effect finishes.

Create a child of 'span' with name 'spanName' as the current span. Ends the span when the effect finishes.

def inject[C](propagator: TextMapPropagator, carrier: C, setter: TextMapSetter[C]): URIO[Tracing, Unit]

Injects the current span into carrier C

Injects the current span into carrier C

def live: URLayer[Tracer, Tracing]
def root[R, E, A](spanName: String, spanKind: SpanKind, toErrorStatus: PartialFunction[E, StatusCode])(effect: ZIO[R, E, A]): ZIO[R & Tracing, E, A]

Sets the current span to be the new root span with name 'spanName' Ends the span when the effect finishes.

Sets the current span to be the new root span with name 'spanName' Ends the span when the effect finishes.

def scoped(tracer: Tracer): URIO[Scope, Tracing]
def scopedEffect[A](effect: => A): ZIO[Tracing, Throwable, A]

Introduces a thread-local scope during the execution allowing for non-zio context propagation.

Introduces a thread-local scope during the execution allowing for non-zio context propagation.

Closes the scope when the effect finishes.

def scopedEffectFromFuture[A](make: ExecutionContext => Future[A]): ZIO[Tracing, Throwable, A]

Introduces a thread-local scope from the currently active zio span allowing for non-zio context propagation. This scope will only be active during Future creation, so another mechanism must be used to ensure that the scope is passed into the Future callbacks.

Introduces a thread-local scope from the currently active zio span allowing for non-zio context propagation. This scope will only be active during Future creation, so another mechanism must be used to ensure that the scope is passed into the Future callbacks.

The java auto instrumentation package provides such a mechanism out of the box, so one is not provided as a part of this method.

CLoses the scope when the effect finishes

def scopedEffectTotal[A](effect: => A): ZIO[Tracing, Nothing, A]

Introduces a thread-local scope during the execution allowing for non-zio context propagation.

Introduces a thread-local scope during the execution allowing for non-zio context propagation.

Closes the scope when the effect finishes.

def setAttribute(name: String, value: Boolean): URIO[Tracing, Span]

Sets an attribute of the current span.

Sets an attribute of the current span.

def setAttribute(name: String, value: Double): URIO[Tracing, Span]

Sets an attribute of the current span.

Sets an attribute of the current span.

def setAttribute(name: String, value: Long): URIO[Tracing, Span]

Sets an attribute of the current span.

Sets an attribute of the current span.

def setAttribute(name: String, value: String): URIO[Tracing, Span]

Sets an attribute of the current span.

Sets an attribute of the current span.

def setAttribute[T](key: AttributeKey[T], value: T): URIO[Tracing, Span]
def setAttribute(name: String, values: Seq[String]): URIO[Tracing, Span]
def setAttribute(name: String, values: Seq[Boolean])(implicit i1: DummyImplicit): URIO[Tracing, Span]
def setAttribute(name: String, values: Seq[Long])(implicit i1: DummyImplicit, i2: DummyImplicit): URIO[Tracing, Span]
def setAttribute(name: String, values: Seq[Double])(implicit i1: DummyImplicit, i2: DummyImplicit, i3: DummyImplicit): URIO[Tracing, Span]
def setBaggage(name: String, value: String): URIO[Tracing, Context]

Sets a baggage entry in the current context

Sets a baggage entry in the current context

def span[R, E, A](spanName: String, spanKind: SpanKind, toErrorStatus: PartialFunction[E, StatusCode])(effect: ZIO[R, E, A]): ZIO[R & Tracing, E, A]

Sets the current span to be the child of the current span with name 'spanName' Ends the span when the effect finishes.

Sets the current span to be the child of the current span with name 'spanName' Ends the span when the effect finishes.

def spanFrom[C, R, E, A](propagator: TextMapPropagator, carrier: C, getter: TextMapGetter[C], spanName: String, spanKind: SpanKind, toErrorStatus: PartialFunction[E, StatusCode])(effect: ZIO[R, E, A]): ZIO[R & Tracing, E, A]

Extracts the span from carrier C and set its child span with name 'spanName' as the current span. Ends the span when the effect finishes.

Extracts the span from carrier C and set its child span with name 'spanName' as the current span. Ends the span when the effect finishes.

def spanFromUnsafe[C](propagator: TextMapPropagator, carrier: C, getter: TextMapGetter[C], spanName: String, spanKind: SpanKind): URIO[Tracing, (Span, URIO[Tracing, Any])]

Extracts the span from carrier C and unsafely set its child span with name 'spanName' as the current span. You need to make sure to call the finalize effect to end the span. Primarily useful for interop.

Extracts the span from carrier C and unsafely set its child span with name 'spanName' as the current span. You need to make sure to call the finalize effect to end the span. Primarily useful for interop.

def spanUnsafe(spanName: String, spanKind: SpanKind): URIO[Tracing, (Span, ZIO[Tracing, Nothing, Any])]

Unsafely sets the current span to be the child of the current span with name 'spanName' You need to manually call the finalizer to end the span. Useful for interop.

Unsafely sets the current span to be the child of the current span with name 'spanName' You need to manually call the finalizer to end the span. Useful for interop.