trait Tracing extends AnyRef
- Self Type
- Tracing
- Alphabetic
- By Inheritance
- Tracing
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
addEvent(name: String)(implicit trace: Trace): UIO[Span]
Adds an event to the current span.
-
abstract
def
addEventWithAttributes(name: String, attributes: Attributes)(implicit trace: Trace): UIO[Span]
Adds an event with attributes to the current span.
Adds an event with attributes to the current span.
- attributes
event attributes
-
abstract
def
extractSpan[C, R, E, A](propagator: TraceContextPropagator, carrier: IncomingContextCarrier[C], spanName: String, spanKind: SpanKind = SpanKind.INTERNAL, attributes: Attributes = Attributes.empty(), errorMapper: ErrorMapper[E] = ErrorMapper.default[E], links: Seq[SpanContext] = Seq.empty)(zio: ⇒ ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]
Extracts the span from carrier
Cand set its child span with name 'spanName' as the current span.Extracts the span from carrier
Cand set its child span with name 'spanName' as the current span.Ends the span when the effect finishes.
- C
carrier
- propagator
implementation of zio.telemetry.opentelemetry.tracing.propagation.TraceContextPropagator
- carrier
mutable data from which the parent span is extracted
- spanName
name of the child span
- spanKind
kind of the child span
- errorMapper
error mapper
- links
spanContexts of the linked Spans.
- zio
body of the child span
-
abstract
def
extractSpanUnsafe[C](propagator: TraceContextPropagator, carrier: IncomingContextCarrier[C], spanName: String, spanKind: SpanKind = SpanKind.INTERNAL, attributes: Attributes = Attributes.empty(), links: Seq[SpanContext] = Seq.empty)(implicit trace: Trace): UIO[(Span, UIO[Any])]
Extracts the span from carrier
Cand unsafely set its child span with name 'spanName' as the current span.Extracts the span from carrier
Cand 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.
- C
carrier
- propagator
implementation of zio.telemetry.opentelemetry.tracing.propagation.TraceContextPropagator
- carrier
mutable data from which the parent span is extracted
- spanName
name of the child span
- spanKind
kind of the child span
-
abstract
def
getCurrentContext(implicit trace: Trace): UIO[Context]
Gets the current Context
-
abstract
def
getCurrentSpan(implicit trace: Trace): UIO[Span]
Gets the current Span.
-
abstract
def
getCurrentSpanContext(implicit trace: Trace): UIO[SpanContext]
Gets the current SpanContext.
-
abstract
def
inSpan[R, E, A](span: Span, spanName: String, spanKind: SpanKind = SpanKind.INTERNAL, attributes: Attributes = Attributes.empty(), errorMapper: ErrorMapper[E] = ErrorMapper.default[E], links: Seq[SpanContext] = Seq.empty)(zio: ⇒ ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]
Mark this effect as the child of an externally provided span.
Mark this effect as the child of an externally provided span. Ends the span when the effect finishes. zio-opentelemetry will mark the span as being the child of the external one.
This is designed for use-cases where you are incrementally introducing zio & zio-telemetry in a project that already makes use of instrumentation, and you need to interoperate with futures-based code.
The caller is solely responsible for managing the external span, including calling Span.end
It also could be useful in combination with
extractSpanUnsafeorspanUnsafe:for { (span, finalize) <- tracing.spanUnsafe("unsafe-span") // run some logic that would be wrapped in the span // modify the span _ <- zio @@ tracing.inSpan(span, "child-of-unsafe-span") } yield ()
- span
externally provided span
- spanName
name of the child span
- spanKind
kind of the child span
- errorMapper
error mapper
- links
spanContexts of the linked Spans.
- zio
body of the child span
-
abstract
def
inject[C](propagator: TraceContextPropagator, carrier: OutgoingContextCarrier[C])(implicit trace: Trace): UIO[Unit]
Injects the current span into carrier
C.Injects the current span into carrier
C.- C
carrier
- propagator
implementation of zio.telemetry.opentelemetry.tracing.propagation.TraceContextPropagator
- carrier
mutable data from which the parent span is extracted
-
abstract
def
root[R, E, A](spanName: String, spanKind: SpanKind = SpanKind.INTERNAL, attributes: Attributes = Attributes.empty(), errorMapper: ErrorMapper[E] = ErrorMapper.default[E], links: Seq[SpanContext] = Seq.empty)(zio: ⇒ ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]
Sets the current span to be the new root span with name 'spanName'.
Sets the current span to be the new root span with name 'spanName'.
Ends the span when the effect finishes.
- spanName
name of the new root span
- spanKind
name of the new root span
- errorMapper
error mapper
- links
spanContexts of the linked Spans.
- zio
body of the new root span
-
abstract
def
scopedEffect[A](effect: ⇒ A)(implicit trace: Trace): Task[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.
- effect
piece of code to execute in the current context
-
abstract
def
scopedEffectFromFuture[A](make: (ExecutionContext) ⇒ Future[A])(implicit trace: Trace): Task[A]
Introduces a thread-local scope from the currently active zio span allowing for non-zio context propagation.
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.
- make
function for providing a scala.concurrent.Future by a given scala.concurrent.ExecutionContext to execute in the current context
-
abstract
def
scopedEffectTotal[A](effect: ⇒ A)(implicit trace: Trace): UIO[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.
- effect
piece of code to execute in the current context
-
abstract
def
setAttribute(name: String, values: Seq[Double])(implicit i1: DummyImplicit, i2: DummyImplicit, i3: DummyImplicit, trace: Trace): UIO[Span]
Sets an attribute of the current span.
Sets an attribute of the current span.
- i1
dummy implicit value to disambiguate the method calls
- i2
dummy implicit value to disambiguate the method calls
- i3
dummy implicit value to disambiguate the method calls
-
abstract
def
setAttribute(name: String, values: Seq[Long])(implicit i1: DummyImplicit, i2: DummyImplicit, trace: Trace): UIO[Span]
Sets an attribute of the current span.
Sets an attribute of the current span.
- i1
dummy implicit value to disambiguate the method calls
- i2
dummy implicit value to disambiguate the method calls
-
abstract
def
setAttribute(name: String, values: Seq[Boolean])(implicit i1: DummyImplicit, trace: Trace): UIO[Span]
Sets an attribute of the current span.
Sets an attribute of the current span.
- i1
dummy implicit value to disambiguate the method calls
-
abstract
def
setAttribute(name: String, values: Seq[String])(implicit trace: Trace): UIO[Span]
Sets an attribute of the current span.
-
abstract
def
setAttribute[T](key: AttributeKey[T], value: T)(implicit trace: Trace): UIO[Span]
Sets an attribute of the current span.
-
abstract
def
setAttribute(name: String, value: String)(implicit trace: Trace): UIO[Span]
Sets an attribute of the current span.
-
abstract
def
setAttribute(name: String, value: Long)(implicit trace: Trace): UIO[Span]
Sets an attribute of the current span.
-
abstract
def
setAttribute(name: String, value: Double)(implicit trace: Trace): UIO[Span]
Sets an attribute of the current span.
-
abstract
def
setAttribute(name: String, value: Boolean)(implicit trace: Trace): UIO[Span]
Sets an attribute of the current span.
-
abstract
def
span[R, E, A](spanName: String, spanKind: SpanKind = SpanKind.INTERNAL, attributes: Attributes = Attributes.empty(), errorMapper: ErrorMapper[E] = ErrorMapper.default[E], links: Seq[SpanContext] = Seq.empty)(zio: ⇒ ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]
Sets the current span to be the child of the current span with name 'spanName'.
Sets the current span to be the child of the current span with name 'spanName'.
Ends the span when the effect finishes.
- spanName
name of the child span
- spanKind
kind of the child span
- errorMapper
error mapper
- links
spanContexts of the linked Spans.
- zio
body of the child span
-
abstract
def
spanScoped(spanName: String, spanKind: SpanKind = SpanKind.INTERNAL, attributes: Attributes = Attributes.empty(), errorMapper: ErrorMapper[Any] = ErrorMapper.default[Any], links: Seq[SpanContext] = Seq.empty)(implicit trace: Trace): ZIO[Scope, Nothing, Unit]
Sets the current span to be the child of the current span with name 'spanName'.
Sets the current span to be the child of the current span with name 'spanName'.
Ends the span when the scope closes.
- spanName
name of the child span
- spanKind
kind of the child span
- errorMapper
error mapper
- links
spanContexts of the linked Spans.
-
abstract
def
spanUnsafe(spanName: String, spanKind: SpanKind = SpanKind.INTERNAL, attributes: Attributes = Attributes.empty(), links: Seq[SpanContext] = Seq.empty)(implicit trace: Trace): UIO[(Span, UIO[Any])]
Unsafely sets the current span to be the child of the current span with name 'spanName'.
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.
Primarily useful for interop.
- spanName
name of the child span
- spanKind
kind of the child span
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- object aspects