When a service initially makes the decision to not sample a particular request, and also makes an outbound call to another downstream service, there may be some event during the processing of that request which causes the downstream service to decide to sample after all. In this case, the downstream service may return its updated sampling decision to the caller via the traceresponse header. Based on this, the caller may change its sampling decision and in turn also return its updated sampling decision to its caller, and so on. In this way, as much of a trace as possible may be recovered for troubleshooting purposes even if the original sampling decision was negative.
This requires a propagator that can extract context from a traceresponse header and attach a traceresponse header to ngx.req. @yangxikun would you be interested in keeping this code in this repository?
The editor's draft of tracecontext includes a
traceresponse
header, which can be used for load balancer deferred sampling:This requires a propagator that can extract context from a
traceresponse
header and attach atraceresponse
header tongx.req
. @yangxikun would you be interested in keeping this code in this repository?