Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to natchez 0.3.x #101

Merged
merged 5 commits into from
Aug 17, 2023
Merged

Conversation

massimosiani
Copy link
Contributor

Hi!
I'm trying to bump natchez to the latest version.
I'm unsure whether there are binary incompatibilities here.
Also, I'm not an expert in Datadog tracing, so I'd need a double check on that part.

@voidcontext voidcontext added this to the Milestone: 8.x milestone Apr 26, 2023
@barryoneill
Copy link

Hi - it would be great to see this make it through, it's starting to age out. :)

@barryoneill
Copy link

@voidcontext is there any chance of publishing this, even as a milestone release? Otherwise I'm going to have to fork this and publish internally which makes me feel bad :)

@voidcontext
Copy link
Contributor

@barryoneill @massimosiani 8.0.0-M1 has been tagged and released, it should be synced to maven central shortly.

@barryoneill
Copy link

@voidcontext very much appreciated, thank you!

@voidcontext
Copy link
Contributor

HI @massimosiani , first of all thank you for keeping this PR up to date!

We allocated some time in the coming weeks, to get this PR reviewed and merged. Meanwhile it seems there are some merge conflicts, if you could have a look at those that'd be cool.

@massimosiani
Copy link
Contributor Author

Done! Thanks for your efforts on the project!

Copy link
Contributor

@voidcontext voidcontext left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @massimosiani, we started the review, there are some initial comments. We are planning to continue later this week.

@@ -63,7 +63,7 @@ lazy val metricsCommon = projectMatrix
.settings(common :+ (name := "natchez-extras-metrics"))

val log4catsVersion = "2.2.0"
val natchezVersion = "0.1.6"
val natchezVersion = "0.3.3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

natchez 0.3.3 is compiled with Scala 3.3.0 which means we need to bump our version as well (see compilation errors in github actions)

@@ -16,7 +18,7 @@ class IOLocalTrace(private val local: IOLocal[Span[IO]]) extends Trace[IO] {
private def scope[G](t: Span[IO])(f: IO[G]): IO[G] =
MonadCancel[IO, Throwable].bracket(local.getAndSet(t))(_ => f)(local.set)

override def span[A](name: String)(k: IO[A]): IO[A] =
override def span[A](name: String, options: Span.Options)(k: IO[A]): IO[A] =
local.get.flatMap {
_.span(name).use { span =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options should be passed here.

Copy link
Contributor

@voidcontext voidcontext left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@massimosiani We added a few more comments, other than those we realised the use of Span.Options is missing in some cases, but that's not blocking this PR, we can make use of those in follow up changes.

Once those issues, raised in comments are fixed, we're happy to approve this PR, thanks for your contribution!

@@ -52,7 +61,7 @@ object Slf4jSpan {
Sync[F]
.fromEither(
k.toHeaders
.find(_._1.toLowerCase == "x-trace-token")
.find(_._1.toString.toLowerCase == "x-trace-token")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be simplified to

          .find(_._1 == ci"x-trace-token")

@@ -46,6 +47,11 @@ object TestEntryPoint {
def spanId: F[Option[String]] = F.pure(None)
def traceUri: F[Option[URI]] = F.pure(None)
def kernel: F[Kernel] = F.pure(kern)
override def log(fields: (String, TraceValue)*): F[Unit] = put(fields: _*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to add the override keyword as this is something we might want to do in the future, but we need to be consistent, so either add it everywhere in this file, or we don't add it at all.

@voidcontext voidcontext merged commit bf11bb1 into ovotech:master Aug 17, 2023
2 checks passed
@massimosiani massimosiani deleted the natchez-0.3.x branch August 22, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants