You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it is not possible to set the remoteServiceName of a Span through an Observation.Context (SenderContext) using an ObservationFilter since the remoteServiceNameis set on the Span before the ObservationFilter is called.
(In PropagatingSenderTracingObservationHandleris set on the Span from the onStart method while ObservationFilter is called from onStop.)
Here's what happens:
SenderContext and the Observation is created, at this point the instrumentation should know the remoteServiceName.
The Observation is started and PropagatingSenderTracingObservationHandler's onStart method is called.
PropagatingSenderTracingObservationHandlersetsremoteServiceName on the Span.
The Observation is stopped and the ObservationFilter is called.
At this point even if the ObservationFilter modifies the remoteServiceName, it has no effect since it is called after remoteServiceName was set on the Span.
Why do you think this should be done via an ObservationFilter? It is too late to set that, in Brave and OTel you can't modify these values in any other time than start of the span. We can create an additional method to override in PropagatingSenderTracingObservationHandler that has access to the Span.Builder. That way it would be possible to override these values (OTOH they are already in the Observation Context so I don't know how that would help).
The way to do it as late as possible would be to call a SpanFilter and modify the remote service name and ip and port. At this point both Brave and OTel allow that.
Right now it is not possible to set the
remoteServiceName
of aSpan
through anObservation.Context
(SenderContext
) using anObservationFilter
since theremoteServiceName
is set on theSpan
before theObservationFilter
is called.(In
PropagatingSenderTracingObservationHandler
is set on theSpan
from theonStart
method whileObservationFilter
is called fromonStop
.)Here's what happens:
SenderContext
and theObservation
is created, at this point the instrumentation should know theremoteServiceName
.Observation
is started andPropagatingSenderTracingObservationHandler
'sonStart
method is called.PropagatingSenderTracingObservationHandler
setsremoteServiceName
on theSpan
.Observation
is stopped and theObservationFilter
is called.ObservationFilter
modifies theremoteServiceName
, it has no effect since it is called afterremoteServiceName
was set on theSpan
.This is true for
remoteServiceAddress
andremoteIpAndPort
too.Also see: spring-projects/spring-boot#39432
The text was updated successfully, but these errors were encountered: