by

Where communities thrive


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

    mergify[bot] on master

    Update sbt to 1.3.11 Merge pull request #232 from sc… (compare)

  • 00:44
    mergify[bot] closed #232
  • 00:41
    scala-steward opened #232
  • May 27 07:59
    gvolpe commented #231
  • May 26 13:13
    alexbalonperin review_requested #231
  • May 26 13:13
    alexbalonperin opened #231
  • May 26 12:59

    gvolpe on master

    update zio to 1.0.0-RC20 Merge pull request #230 from al… (compare)

  • May 26 12:59
    gvolpe closed #230
  • May 26 12:53
    alexbalonperin closed #228
  • May 26 12:53
    alexbalonperin commented #228
  • May 26 12:49
    alexbalonperin edited #230
  • May 26 12:48
    alexbalonperin review_requested #230
  • May 26 12:48
    alexbalonperin opened #230
  • May 26 03:26

    mergify[bot] on master

    Update scalafmt-core to 2.5.3 Merge pull request #229 from sc… (compare)

  • May 26 03:26
    mergify[bot] closed #229
  • May 26 03:22
    scala-steward opened #229
  • May 25 22:42
    scala-steward opened #228
  • May 21 19:19

    gvolpe on ci-build-tweak

    (compare)

  • May 21 19:19

    gvolpe on master

    Tweaking CI build setup-java flaky test, apparently and 1 more (compare)

  • May 21 19:19
    gvolpe closed #227
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