Commit 830e59d
committed
otel: add VM→host span relay for full container lifecycle tracing
Add a Traces.Stream ttrpc service that relays OTel spans from inside
the VM back to the host, mirroring the existing Events.Stream pattern.
VM-side:
- Channel-backed SpanExporter buffers spans (cap 1024, silent drop)
- TracerProvider with 100ms batch interval drains into the channel
- Traces ttrpc service streams spans to the host on demand
- Spans added to: task.Create/Start, runc.NewContainer, crun.create/
start, ctrnetworking.Connect, mountutil.All
Host-side (shim):
- After VM boot, subscribes to Traces.Stream
- Converts proto spans to ReadOnlySpan via tracetest.SpanStub.Snapshot
- Corrects VM-vs-host clock skew using offset from first span
- Re-exports via OTLP HTTP with service.name=nerdbox-vm
- Spans added to: shim.BundleLoad, shim.VMBoot, shim.BundleTransfer,
shim.IOSetup, shim.TaskCreate, shim.Start
Signed-off-by: David Scott <dave@recoil.org>1 parent fe04dc1 commit 830e59d
File tree
17 files changed
+1853
-18
lines changed- api
- proto/nerdbox/services/traces/v1
- services/traces/v1
- cmd/vminitd
- docs
- integration
- internal
- shim/task
- vminit
- ctrnetworking
- process
- runc
- task
- tracing
- plugins/vminit/tracing
17 files changed
+1853
-18
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments