Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 12 06:36
    scala-steward synchronize #328
  • Apr 12 04:49

    mergify[bot] on master

    Update zio to 1.0.6 Merge pull request #352 from sc… (compare)

  • Apr 12 04:49
    mergify[bot] closed #352
  • Apr 12 04:46
    scala-steward opened #352
  • Apr 10 20:18
    scala-steward closed #345
  • Apr 10 20:18
    scala-steward commented #345
  • Apr 10 20:18
    scala-steward opened #351
  • Apr 07 06:54
    scala-steward synchronize #347
  • Apr 07 05:12

    mergify[bot] on master

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

  • Apr 07 05:12
    mergify[bot] closed #350
  • Apr 07 05:09
    scala-steward opened #350
  • Apr 04 21:32
    scala-steward closed #334
  • Apr 04 21:32
    scala-steward commented #334
  • Apr 04 21:32
    scala-steward opened #349
  • Mar 31 10:40
    scala-steward closed #317
  • Mar 31 10:40
    scala-steward commented #317
  • Mar 31 10:40
    scala-steward opened #348
  • Mar 30 23:34
    scala-steward synchronize #345
  • Mar 30 23:33
    scala-steward opened #347
  • Mar 30 17:13

    mergify[bot] on master

    Update fs2-core to 2.5.4 Merge pull request #346 from sc… (compare)

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.
gvolpe
@gvolpe:matrix.org
[m]
Test
trait SomeCode[F[_]] {
  def foo: F[Unit]
}
Gabriel Volpe
@gvolpe:matrix.org
[m]
test
Gabriel Volpe
@gvolpe:matrix.org
[m]
from desktop ☘️