Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 10 04:33
    stale[bot] closed #459
  • Aug 10 04:33
    stale[bot] closed #458
  • Aug 10 04:33
    stale[bot] closed #457
  • Jul 31 03:00
    stale[bot] closed #456
  • Jul 31 02:59
    stale[bot] labeled #457
  • Jul 31 02:59
    stale[bot] labeled #458
  • Jul 31 02:59
    stale[bot] labeled #459
  • Jul 31 02:59
    stale[bot] commented #457
  • Jul 31 02:59
    stale[bot] commented #458
  • Jul 31 02:59
    stale[bot] commented #459
  • Jul 13 19:25
    stale[bot] labeled #456
  • Jul 13 19:24
    stale[bot] commented #456
  • Jul 07 05:44
    stale[bot] closed #454
  • Jun 23 01:04
    stale[bot] labeled #454
  • Jun 23 01:04
    stale[bot] commented #454
  • Jun 19 20:00
    stale[bot] closed #452
  • Jun 12 11:06
    stale[bot] labeled #452
  • Jun 12 11:06
    stale[bot] commented #452
  • Jun 10 18:31
    stale[bot] closed #450
  • Jun 10 18:31
    stale[bot] closed #449
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.