yangxikun / opentelemetry-lua

opentelemetry lua sdk
Apache License 2.0
49 stars 17 forks source link

Add experimental traceresponse propagator #44

Open plantfansam opened 2 years ago

plantfansam commented 2 years ago

The editor's draft of tracecontext includes a traceresponse header, which can be used for load balancer deferred sampling:

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?

yangxikun commented 2 years ago

Sure.

plantfansam commented 2 years ago

Per #35, we don't want this yet.