cni
cni copied to clipboard
libcni should support distributed tracing
Broadly, it needs to pass a span identifier across from the caller to the plugin.
Probably something to do with OpenTracing. Details left as an exercise.
At the top level of libcni we would do something like:
span, ctx := opentracing.StartSpanFromContext(ctx, "ADD")
(so all the entry points need to add a context parameter)
Then when executing a plugin we would extract the SpanContext
via span.Context()
, then serialise via ForeachBaggageItem()
to something like an environment variable, then unpack that on the other side of the plugin execution and create a new span there.
Note that there is no tracing in Kubernetes at the moment (https://github.com/kubernetes/kubernetes/issues/26507). Still, it might be useful if CNI itself is a performance concern, or for other orchestrators.
(The upshot of that Kubernetes issue, that everything is async, is less relevant inside kubelet)
Does the community plan to develope this feature? Thanks!
I've found these, some related topics are under discussion.
https://github.com/kubernetes/enhancements/pull/650 https://github.com/containerd/containerd/issues/3057 https://github.com/kubernetes/kubernetes/issues/26507
/cc