mirror of
https://github.com/containerd/containerd.git
synced 2026-10-29 01:55:16 +08:00
runc and the OCI hooks it spawns are separate processes, so the trace context can not reach them over ttrpc. Inject it into their environment instead, riding on the request context via go-runc's WithExtraEnv, which does not race with concurrent requests the way setting it on the shim process would. The otelttrpc interceptor extracts that context, so chain it first explicitly instead of leaving it to plugin initialization order. Also flush the spans the tracing plugin buffered before the shim exits. Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>