What information can be handled by a custom propagator in the OtelAgent? #13341
-
I am considering customizing the OtelAgent, and therefore, I was organizing the information that can be handled in DemoPropagator.java. I referred to this link and was able to obtain header information from the carrier, but I found it difficult to work with the request path. Is this not possible? Also, handling the request body is not possible, right? java
For reference: DemoPropagator.java example |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
needing to use request path and body in the propagator is unusual. Please elaborate on what you are trying to achieve. |
Beta Was this translation helpful? Give feedback.
I would advice you against attempting this unless you really understand what you are doing as otherwise you'll end up just wasting a bunch of time. There isn't anything in the propagator that would prevent you from using something from the request path instead of a header. The actual access to the carrier is implemented in
TextMapGetter
so if you wish to use something else besides headers you'd need to replace theTextMapGetter
implementation which mean you'd need to replace the instrumentations that the agent uses with your own instrumentations. So if you wish to read trace id from incoming request path you'd firstly need an instrumentation that exposes that information. Inside yourText…