httpRoutes <- traceEntryPoint.root("init").use { span => wireAll[Kleisli[F, Span[F], *]].mapK(Kleisli.applyK(span)) }
- roughly
F[Fiber[F, Unit]]
, it's easy to make a mistake. See if you can use .background
instead of .start
wherever it is.
It's me again. I am trying to wrap Client[F]. (I have Trace[F] instance there)
def apply[F[_]: Trace: Sync](client: Client[F]): Client[F] = {
Client[F] { request =>
val spanName: String = ???
for {
b <- Trace[F].span(spanName) { //should be F[]
}
//only have Resource[F, Response[F]] type for
//client.run(modifiedRequest))
} yield ???
}
}
Can't get how to transform Resource
to wrap it with Trace[F].span
Trace[F].span(“stream”)(s.compile.drain)
Stream.eval(Kleisli.ask).flatMap(span => Stream.resource(span.subspan("name"))) >> innerStream