From d47b97170ed50a2b6c41fce57531b9e8bfc8a59b Mon Sep 17 00:00:00 2001 From: Michael Pilquist Date: Thu, 24 Nov 2022 08:22:07 -0500 Subject: [PATCH] Add ability to create a Trace[IO] from an EntryPoint[IO] --- modules/core/shared/src/main/scala/Trace.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/core/shared/src/main/scala/Trace.scala b/modules/core/shared/src/main/scala/Trace.scala index e0777248..a8309077 100644 --- a/modules/core/shared/src/main/scala/Trace.scala +++ b/modules/core/shared/src/main/scala/Trace.scala @@ -101,6 +101,10 @@ object Trace { } } + /** A `Trace` instance that uses `IOLocal` internally. Span creation delegates to the supplied entry point. */ + def ioTraceForEntryPoint(ep: EntryPoint[IO]): IO[Trace[IO]] = + ioTrace(Span.makeRoots(ep)) + object Implicits { /** A no-op `Trace` implementation is freely available for any applicative effect. This lets us add