Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:48

    mergify[bot] on master

    Update scalafmt-core to 2.3.0 Merge pull request #155 from sc… (compare)

  • 10:48
    mergify[bot] closed #155
  • 10:47

    mergify[bot] on master

    Update sbt-microsites to 1.0.1 Merge pull request #154 from sc… (compare)

  • 10:47
    mergify[bot] closed #154
  • 10:44
    scala-steward opened #155
  • 10:44
    scala-steward opened #154
  • Dec 03 02:24

    mergify[bot] on master

    Update sbt-microsites to 1.0.0 Merge pull request #153 from sc… (compare)

  • Dec 03 02:24
    mergify[bot] closed #153
  • Dec 03 02:21
    scala-steward opened #153
  • Dec 02 08:10
    scala-steward synchronize #136
  • Nov 30 22:31

    mergify[bot] on master

    Update http4s-blaze-client, ...… Merge pull request #151 from sc… (compare)

  • Nov 30 22:31
    mergify[bot] closed #151
  • Nov 30 22:30
    scala-steward opened #152
  • Nov 30 22:28
    scala-steward opened #151
  • Nov 29 04:50

    mergify[bot] on master

    Update zio-interop-cats to 2.0.… Merge pull request #150 from sc… (compare)

  • Nov 29 04:50
    mergify[bot] closed #150
  • Nov 29 04:46
    scala-steward opened #150
  • Nov 28 03:38

    mergify[bot] on master

    Update sbt-tpolecat to 0.1.10 Merge pull request #149 from sc… (compare)

  • Nov 28 03:38
    mergify[bot] closed #149
  • Nov 28 03:34
    scala-steward opened #149
Paulo "JCranky" Siqueira
@jcranky
Hey, quick question. Should it be able to do request.attemptAs (from org.http4s.implicits), with a TracedRequest?
Paulo "JCranky" Siqueira
@jcranky
Another question: is this library taking care of extracting the current span context, when it exists, when a request is received?

I guess that is the intention of

  def getTraceId(request: Request[F])(implicit F: Applicative[F]): F[Option[TraceId]] =
    F.pure(request.headers.get(headerName.ci).map(h => TraceId(h.value)))

?

Paulo "JCranky" Siqueira
@jcranky
Maybe a more fundamental question, is this library supposed to be used with OpenTracing ?
Gabriel Volpe
@gvolpe
Hey Paulo, I'm not sure about the first question so I'd need to check on my laptop
2nd question, yes, it should read the header containing the trace ID if exists, otherwise it'll create a new one
3rd question, no, it was designed as a simpler version of Open Tracing. I'm pretty sure I wrote about it in the microsite (I think in the motivations section)
Paulo "JCranky" Siqueira
@jcranky
I see, thanks. So I guess it makes no sense trying to integrate it with OT ?
Gabriel Volpe
@gvolpe
I don't think so. If that's what you're looking for better look into https://github.com/tpolecat/natchez or https://github.com/tabdulradi/puretracing
Paulo "JCranky" Siqueira
@jcranky
thanks :D
Gabriel Volpe
@gvolpe
:+1:
lgirard
@laurentgir

Hi All,
I'm giving http4s-tracer a try for a project that I have.
I'd like to know how I can create a Tracer class that needs to override a method whose return type is a monad transformers such as EitherT or OptionT.
For instance, let's say I have an Interpreter with the following method:

def find(reference: String): EitherT[F, Error, Unit]

What will be the signature of this method in my TracerInterpreter?

def find(reference: String): Trace[F, EitherT[F, Error, Unit]]

I'm struggling finding the right signature and the right implementation for it.

Gabriel Volpe
@gvolpe
I recommend to not use monad transformers in your public API @laurentgir
It's fine to operate in terms of them but your API would be better as
def find(reference: String): F[Either[Error, Unit]]
So your tracer method signature would be trivial
def find(reference: String): Trace[F, Either[Error, Unit]]
lgirard
@laurentgir
Thanks for the quick answer, even if that's the answer I feared because I use MT all over the place :fearful:
Not using MT in public APIs is a recommended best practice in general ? Or is it just not recommended for using http4s-tracer?
Gabriel Volpe
@gvolpe
It is a best practice in general.
Monad Transformers should only be used on the implementation. Leave the API clean :)
lgirard
@laurentgir
I'll clean it then :wink:
lgirard
@laurentgir
I have made some adapters to work with Tsec, is that something that you'll be interested in ? If so I could create a PR for that.
In essence it allows tracing of Tsec's SecuredRequest.
Gabriel Volpe
@gvolpe
Yeah that'd be really cool @laurentgir , go for it! We'd need to include it as a separate module though, otherwise people not using tsec will have that unwanted dependency.
lgirard
@laurentgir
Allright, I'll try to do that this week then.