I would like to propagate the request-foo
header value received in a service (foo) to another header header-bar
for service (bar). I would like to leverage sleuth/brave instrumentation for this without including it into the business logic
foo-service --------> HTTP ------> bar-service
(request-foo) (request-bar)
There is already support in Sleuth and Brave for propagation when the header names match. For example by setting in the foo-service
the following
spring.sleuth.propagation-keys=request-foo
This would propagate the request-foo
header value to bar-service
with the request-foo
header name.
Unfortunately, in my case, I have no control over the bar-service
and it expects the header value as request-bar
and also no control to rename request-foo
header name because the foo-service
receives it also from an upstream service.
I was thinking to provide an Injector
similar to the ExtraFieldInjector
but is not extendable the ExtraFieldPropagation
, so I would need to provide my own Propagation
implementation.
Wondering do I miss something? Is there an easier approach?
Thank you.