I hacked together opentelemetry distributed tracing support for ebpf_exporter: https://github.com/cloudflare/ebpf_exporter/pull/297

So far I managed to add some block i/o tracing via tracepoints, but it's unclear how to tie this together to userspace traces, since there's no way for userspace to pass the trace id.

Are there any other kernel areas that people are interested in having integrated with distributed tracing? Sockets? Scheduling? Something else?

#ebpf_exporter #ebpf #kernel #opentelemetry #otel #otlp

Add support for opentelemetry tracing by bobrik · Pull Request #297 · cloudflare/ebpf_exporter

Example trace: To produce it: Run jaeger: docker run --rm -it --net host jaegertracing/all-in-one:1.50 Run ebpf_exporter: make && make -C examples && sudo ./ebpf_exporter --config.dir=example...

GitHub

I suppose one way of supplying a trace id is using a usdt or a uprobe:

1. Userspace calls a stub function to set trace id. The function call is intercepted by ebpf_exporter and the supplied trade id is assigned to a thread.
2. Whenever an event happens, trace id is looked up by a thread id.

This requires some manageable indirection plumbing if an event we're interested in happens asynchronously in the kernel (think skb getting sent in softirq).