Replies: 3 comments 3 replies
-
I think the approach itself is ok for special case. Passing the whole request body to propagator might be problematic/difficult in some cases:
Therefore I assume such a propagator is hard to add on default. It would be needed to decided based on e.g. request headers that inject into body should be done to decide on buffering the whole body to inject and finally send. Update: |
Beta Was this translation helpful? Give feedback.
-
@Flarna thanks for your comments. In my special case, the client is browser and so let's say we assume the body is smaller and uncompressed. Also, let's say the downsides you listed for the server side are also acceptable. What do your thoughts on how we can make this configurable so that the xhr instrumentation is able to pass the entire request (headers+body) to the propagator? |
Beta Was this translation helpful? Give feedback.
-
what if you try to patch the xhr / fetch and simply do any extraction you need from the 3rd party service (from body etc.) and inject this into headers. So this way you dont need to modify antyhing from otel. You would simply write a new plugin for you specific case. this plugin can be added either on top of xhr or fetch, or simply disable the otel xhr and fetch and do the handling you need. I also think that trying to modify the body would be a big NO, because there can be very specific data and the risk of leaking this data anywhere else is also worth to notice. So I would personally not touch the body at all. Otel should not cause any harm, and even if you think your code will not do it, there is always some potential in breaking something if you start manipulating the area which is not meant for that. |
Beta Was this translation helpful? Give feedback.
-
we have a situation where one of the services (it's a 3rd party) is unable to participate in a trace and pass on the trace context. We want to leverage the fact that this 3rd party service passes on the http request content as is to the next service, and insert the tracecontext into the request.
The API propagator spec states that the carrier of a propagator can be an outgoing message or HTTP request, without specifying HTTP headers explicitly. yet, all the http instrumentations (fetch, xhr, node http) call the propagator.inject only to insert the context into HTTP headers.
I have a prototype to demonstrate what I am looking for - please see scheler#5
I am wondering what the community's thoughts are on this. If this is something that's generally helpful, then one way to address this is to modify the instrumentations so that they pass the entire http request (headers+body) to the propagator and leave to it to decide where to inject the context.
Beta Was this translation helpful? Give feedback.
All reactions