Lifts this F[A]
into a TraceT[F, A] and then transforms that
TraceT to an equivalent
TraceT[F, A] where
a best-effort will be made to execute the passed-in function on the finish of the underlying effectful program.
The function can't be guaranteed to run in the face of interrupts, etc. It depends on the nature of the effectful program
itself.
Lifts this F[A]
into a TraceT[F, A] and then transforms that
TraceT to an equivalent
TraceT[F, A] where
a best-effort will be made to execute the passed-in function on the finish of the underlying effectful program.
The function can't be guaranteed to run in the face of interrupts, etc. It depends on the nature of the effectful program
itself.
- a function which is passed an optional Throwable
- defined if the program failed and
returns a TraceT[F, Unit]
, a program run only for its effect.
- an instance of fs2.util.Catchable[F]
in implicit scope.
traceTForFA - a new TraceT[F, A]
with the error handling of the aforementioned f
function
parameter.
Creates a new child Span in the TraceT[F, A]
created by lifting this F[A]
, providing the capability
of annotating the span with notes based on the execution result of the F[A]
, using the
a custom Evaluator to determine success/failure of the F[A]
for the purposes of recording.
Creates a new child Span in the TraceT[F, A]
created by lifting this F[A]
, providing the capability
of annotating the span with notes based on the execution result of the F[A]
, using the
a custom Evaluator to determine success/failure of the F[A]
for the purposes of recording.
For example:
val task = Task.delay(some computation)
task.newAnnotatedSpan(
Span.Name("query-products-for-sale",
Note.string("sale-date", date.toString), Note.double("sale-max-price", 80.50)
) {
case Right(saleProducts) => Vector(Note.string("sale-products", saleProducts.mkString(",")))
}
- a descriptive name, emitted when the span is recorded.
- one or more Notes which annotate the span (often the input parameters to the F[A]
execution).
- an instance of an fs2.util.Catchable[F]
and fs2.util.Suspendable[F]
in implicit scope.
newTraceT - a new instance of TraceT
representing a child span.
Creates a new child Span in the TraceT[F, A]
created by lifting this F[A]
,
providing the capability of annotating the span with notes based on the execution result of the F[A]
,
using the default Evaluator to determine success/failure of the F[A]
for the purposes of span recording.
Creates a new child Span in the TraceT[F, A]
created by lifting this F[A]
,
providing the capability of annotating the span with notes based on the execution result of the F[A]
,
using the default Evaluator to determine success/failure of the F[A]
for the purposes of span recording.
For example:
val task = Task.delay(some computation)
task.newAnnotatedSpan(
Span.Name("query-products-for-sale",
Note.string("sale-date", date.toString), Note.double("sale-max-price", 80.50)
) {
case Right(saleProducts) => Vector(Note.string("sale-products", saleProducts.mkString(",")))
}
- a descriptive name, emitted when the span is recorded.
- one or more Notes which annotate the span (often the input parameters to the F[A]
execution).
- an instance of an fs2.util.Catchable[F]
and fs2.util.Suspendable[F]
in implicit scope.
newTraceT - a new instance of TraceT
representing a child span.
Creates a new child Span in the TraceT[F, A]
created by lifting this F[A]
, providing for custom
evaluation and rendering of the underlying F[A]
when recording the Span.
Creates a new child Span in the TraceT[F, A]
created by lifting this F[A]
, providing for custom
evaluation and rendering of the underlying F[A]
when recording the Span.
For example:
val task = Task.delay(some computation)
task.newSpan(
Span.Name("query-products-for-sale",
Evaluator.resultToFailure[Vector[Product]
Note.string("sale-date", date.toString), Note.double("sale-max-price", 80.50)
)
- a descriptive name, emitted when the span is recorded.
- an Evaluator which converts either a Throwable
or A
to an optional FailureDetail.
- one or more Notes which annotate the span (often the input parameters to the F[A]
execution).
- an instance of an fs2.util.Catchable[F]
and fs2.util.Suspendable[F]
in implicit scope.
newTraceT - a new instance of TraceT
representing a child span.
Creates a new child Span in the TraceT[F, A]
created by lifting this F[A]
, using the
default Evaluator to determine success/failure of the F[A]
for the purposes of span recording.
Creates a new child Span in the TraceT[F, A]
created by lifting this F[A]
, using the
default Evaluator to determine success/failure of the F[A]
for the purposes of span recording.
For example:
val task = Task.delay(some computation)
task.newSpan(
Span.Name("query-products-for-sale",
Note.string("sale-date", date.toString), Note.double("sale-max-price", 80.50)
)
- a descriptive name, emitted when the span is recorded.
- one or more Notes which annotate the span (often the input parameters to the F[A]
execution).
- an instance of an fs2.util.Catchable[F]
and fs2.util.Suspendable[F]
in implicit scope.
newTraceT - a new instance of TraceT
representing a child span.
Lifts this program F
which computes A
into a TraceT[F, A]
context.
Lifts this program F
which computes A
into a TraceT[F, A]
context.
traceTOfA - a TraceT[F, A]
Provides the hooks by which the result of a effectful program can be converted into a
FailureDetail
for use in determining whether the program has failed for the purposes of the trace and how to render that failure. If the traced program fails, theexceptionToFailure
function is used to determine if this failure should be recorded as such for the span and if the program itself is successful, theresultToFailure
function is used to determine if there is an application level failure embedded in the result and if so, how it should be rendered.The default evaluator for a span, if a custom one is not specified, is to treat a failures and successes at the effectful program-level as such for the span, converting the
Throwable
to a string with the stack trace.