Skip to content

Commit 2c0adf4

Browse files
authored
feat(podman): export driver traces over OTLP (#2782)
Mirror the VM driver tracing setup for Podman. Export standalone driver spans through OTLP/gRPC as the distinct openshell-driver-podman service, propagate W3C context across ComputeDriver RPCs, record bounded RPC names and failures, and flush buffered spans during graceful shutdown. Podman still runs in-process when selected as a built-in gateway driver. Add a temporary tracing shim that partitions gateway and Podman spans by target into separate tracer providers while preserving their shared trace and parentage. The shim also emits the same ComputeDriver server boundary that the tonic layer emits out of process, keeping the observable trace shape stable when Podman is eventually extracted. Trace container create preparation, image and storage setup, lifecycle operations, and cleanup. Document the service boundary and cover it with isolated and repeated tracing tests. Signed-off-by: Kris Hicks <khicks@nvidia.com>
1 parent 0c6a344 commit 2c0adf4

17 files changed

Lines changed: 1771 additions & 275 deletions

File tree

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/openshell-driver-podman/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ path = "src/main.rs"
1616

1717
[dependencies]
1818
openshell-core = { path = "../openshell-core", default-features = false, features = ["driver-extraction"] }
19+
openshell-otel = { path = "../openshell-otel" }
1920

2021
tokio = { workspace = true }
2122
tonic = { workspace = true, features = ["transport"] }
@@ -32,11 +33,18 @@ nix = { workspace = true }
3233
rustix = { workspace = true }
3334
tracing = { workspace = true }
3435
tracing-subscriber = { workspace = true }
36+
tracing-opentelemetry = { workspace = true }
37+
opentelemetry = { workspace = true }
38+
opentelemetry_sdk = { workspace = true }
39+
tower-http = { workspace = true }
40+
http = { workspace = true }
3541
thiserror = { workspace = true }
3642
miette = { workspace = true }
3743
url = { workspace = true }
3844

3945
[dev-dependencies]
46+
opentelemetry-proto = { version = "0.32", default-features = false, features = ["gen-tonic", "trace"] }
47+
opentelemetry_sdk = { workspace = true, features = ["testing"] }
4048
prost-types = { workspace = true }
4149
temp-env = "0.3"
4250
tokio = { workspace = true, features = ["test-util"] }

crates/openshell-driver-podman/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ driver runs in-process within the gateway server and delegates all sandbox
77
isolation enforcement to the `openshell-sandbox` supervisor binary, which is
88
sideloaded into each container via an OCI image volume mount.
99

10+
When the gateway configures `[openshell.gateway.otlp]`, Podman compute-driver
11+
spans export to the same OTLP/gRPC collector with the service name
12+
`openshell-driver-podman`. The driver preserves the gateway trace context and
13+
uses the same compute-driver RPC span names in its in-process and standalone
14+
forms.
15+
1016
Before creating the container, the driver inspects the final sandbox image and
1117
captures its immutable image ID and raw OCI `Config.User`. Container creation
1218
uses that image ID with pulling disabled, preventing a mutable tag from changing

0 commit comments

Comments
 (0)