Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 03:46
    scala-steward closed #288
  • 03:46
    scala-steward opened #292
  • Nov 21 09:45

    gvolpe on master

    update actions (compare)

  • Nov 20 22:39
    scala-steward opened #291
  • Nov 20 12:11
    scala-steward opened #290
  • Nov 18 07:36
    scala-steward opened #289
  • Nov 16 05:20
    scala-steward closed #281
  • Nov 16 05:20
    scala-steward opened #288
  • Nov 11 20:25

    mergify[bot] on master

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

  • Nov 11 20:25
    mergify[bot] closed #287
  • Nov 11 20:21
    scala-steward opened #287
  • Nov 10 12:27

    mergify[bot] on master

    Update sbt-tpolecat to 0.1.15 Merge pull request #286 from sc… (compare)

  • Nov 10 12:27
    mergify[bot] closed #286
  • Nov 10 12:22
    scala-steward opened #286
  • Nov 09 18:33

    mergify[bot] on master

    Update munit, munit-scalacheck … Merge pull request #285 from sc… (compare)

  • Nov 09 18:33
    mergify[bot] closed #285
  • Nov 09 18:33

    mergify[bot] on master

    Update fs2-core to 2.4.5 Merge pull request #284 from sc… (compare)

  • Nov 09 18:33
    mergify[bot] closed #284
  • Nov 09 18:30
    scala-steward opened #285
  • Nov 09 18:29
    scala-steward opened #284
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.
Gabriel Volpe
@gvolpe
There are some issues with sbt-ci-release, we need to wait: olafurpg/sbt-ci-release#118
Jakub Kozłowski
@kubukoz
sup, I have a question
all the methods take an A: ClassTag but none of them actually take an A
what's the purpose then?
Gabriel Volpe
@gvolpe
I guess that was to log the package from where you are calling the logging method instead of a generic one
Anyway, I no longer have the need to use this library (at least for now) so if you're user, please chime in and take the lead :)
I made this release because @alexbalonperin asked for it, he is now a maintainer :smiley:
Gabriel Volpe
@gvolpe
v1.5.3 is the version
Will Leyton López
@dabliuw22
Hello, looking at the user guide, I find that they refer to Trace[F, ?] Where F is the effect, but I have had problems with the keyword ?. Any recommendation to use ?, Since it sends me the message "Cannot resolve symbol ?"
Gabriel Volpe
@gvolpe
Hi @dabliuw22 , that's kind-projector syntax. Though, ? has been replaced for * now.
Will Leyton López
@dabliuw22
Thanks @gvolpe.