Skip to content

Automatic trace propagation stops working after ZIO upgrade to 2.1.20 #1029

@paul-danilin-moia

Description

@paul-danilin-moia

Hi all,
we are using

"dev.zio" %% "zio-opentelemetry" % "3.1.7"
"io.opentelemetry.javaagent" % "opentelemetry-javaagent" % "2.18.1"

and noticed that updating

"dev.zio" %% "zio" % <version>

from 2.1.19 to 2.1.20 breaks propagation of the tracing context. Roughly speaking this is what we encounter:

val tracingLayer = (OpenTelemetry.global ++ OpenTelemetry.contextJVM) >>> ZioOpenTelemetry.tracing(instrumentationScopeName = "some-name")
val tracing: Tracing = ??? // obtained through tracingLayer

// when handling an HTTP request via http4s
tracing.root("span-name") {
  tracing.getCurrentSpanContextUnsafe.debug("before") *>
  http4sRequest.decodeStrict[SomeType] { parsedRequest =>
    tracing.getCurrentSpanContextUnsafe.debug("after") *>
    ???
  }
}

The generated span context is witnessed in before but is lost in after (the one logged at after is always 000000).
The span is propagated correctly if we don't update the dependencies to 2.1.20 or update everything to the latest and add dependencyOverrides += "dev.zio" %% "zio" % "2.1.19"

I tried reproducing the issue independently but I haven't succeeded so far. And I understand it is only remotely helpful without a reproducer. Do you probably have an idea, what can be involved here?
Maybe someone else has a similar problem and would be more successful with a reproducer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions