-
Notifications
You must be signed in to change notification settings - Fork 38
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
Remove effect constraint from TextMapPropagator
#332
Conversation
core/common/src/main/scala/org/typelevel/otel4s/context/propagation/ContextPropagators.scala
Outdated
Show resolved
Hide resolved
68f5fb7
to
5691fa3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments, but nothing blocking. overall LGTM!
core/common/src/main/scala/org/typelevel/otel4s/context/propagation/TextMapPropagator.scala
Outdated
Show resolved
Hide resolved
core/common/src/main/scala/org/typelevel/otel4s/context/propagation/TextMapPropagator.scala
Outdated
Show resolved
Hide resolved
core/common/src/main/scala/org/typelevel/otel4s/context/propagation/ContextPropagators.scala
Outdated
Show resolved
Hide resolved
core/common/src/main/scala/org/typelevel/otel4s/context/propagation/TextMapPropagator.scala
Outdated
Show resolved
Hide resolved
...common/src/test/scala/org/typelevel/otel4s/context/propagation/ContextPropagatorsSuite.scala
Outdated
Show resolved
Hide resolved
core/common/src/main/scala/org/typelevel/otel4s/context/propagation/TextMapPropagator.scala
Outdated
Show resolved
Hide resolved
if we rename |
I ended up renaming |
core/common/src/main/scala/org/typelevel/otel4s/context/propagation/TextMapPropagator.scala
Outdated
Show resolved
Hide resolved
java/common/src/main/scala/org/typelevel/otel4s/java/TextMapPropagatorImpl.scala
Outdated
Show resolved
Hide resolved
java/common/src/main/scala/org/typelevel/otel4s/java/TextMapPropagatorImpl.scala
Outdated
Show resolved
Hide resolved
…opagatorImpl.scala Co-authored-by: Marissa | April <[email protected]>
is there anything else this needs before merging? |
Nope, I can merge it right away. |
Motivation
While working on #325, it turned out that the effectful injection into the mutable carrier was optional.
The majority of the typelevel ecosystem revolves around immutable data structures.
So, is there any actual use case for the effectful injection into the mutable carrier?
The changes
context.propagation
packagedef fields: List[String]
def inject[A: TextMapUpdater](...): F[Unit]
def injected[A: TextMapUpdater](...): A
toinject
F
constraintWhat does the spec say?
https://opentelemetry.io/docs/specs/otel/context/api-propagators/#inject
Note
Injects the value into a carrier. For example, into the headers of an HTTP request.
Required arguments:
The new implementation complies with this requirement.
https://opentelemetry.io/docs/specs/otel/context/api-propagators/#textmap-inject
Warning
Injects the value into a carrier. The required arguments are the same as defined by the base Inject operation.
Optional arguments:
Since we use
TextMapUpdater
rather thanTextMapSetter
, in some sense, we violate the requirement.