This PR changes to use ObservationThreadLocalAccessor.KEY
where possible.
Comment From: bclozel
@marcingrzejszczak Can we safely use io.micrometer.observation.contextpropagation.ObservationThreadLocalAccessor
from "micrometer-observation"? Your comment in this class seems to avoid a dependency on purpose.
Or is the key supposed to be maintained in "context-propagation"?
Comment From: marcingrzejszczak
Context Propagation is typically an optional dependency. If we make it a compile time dependency then we can use the ObservationThreadLocalAccessor
safely. Otherwise we might reference a class that implements an interface that is not on the classpath
Comment From: izeye
I'm not sure if I fully understand the current arrangement as the previous code comment was saying micrometer-core
, and @marcingrzejszczak seems to be saying context-propagation
, but actually the constant (ObservationThreadLocalAccessor.KEY
) is in micrometer-observation
: https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-observation/src/main/java/io/micrometer/observation/contextpropagation/ObservationThreadLocalAccessor.java#L37
Comment From: marcingrzejszczak
I made a mistake with the code comment :facepalm: