Skip to content

feat(podman): export driver traces over OTLP - #2782

Open
krishicks wants to merge 1 commit into
mainfrom
hicks/push-tvvqnrvruvko
Open

feat(podman): export driver traces over OTLP#2782
krishicks wants to merge 1 commit into
mainfrom
hicks/push-tvvqnrvruvko

Conversation

@krishicks

@krishicks krishicks commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

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.

image

Related Issue

#1055
#2507

Changes

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

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>

@pimlock pimlock left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments after exploring this with an agent.

Comment on lines +29 to +31
.on_response(())
.on_body_chunk(())
.on_eos(())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also handle on_response/on_eos to record a status_code, otherwise it's going to be empty.

Could be achieved by adding a RecordGrpcStatus and updating to:

TraceLayer::new_for_grpc()
    .on_response(RecordGrpcStatus)
    .on_eos(RecordGrpcStatus)
    .on_failure(RecordGrpcFailure)

Comment on lines -709 to -712
// 1a. Pull the supervisor image if needed. The supervisor binary
// is shipped in a standalone OCI image and mounted into sandbox
// containers via Podman's type=image mount. Refresh mutable tags
// like latest/dev, but avoid registry checks for pinned images.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the different phases of creating a sandbox have numbered comments, but now the 1 is missing

.instrument(tracing::info_span!(
"podman.start",
otel.name = "podman.start",
otel.status_code = tracing::field::Empty,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming this to podman.start_container, there is another podman.start here and it's consistent with prepare_container above.


/// Create a sandbox container.
#[tracing::instrument(
name = "podman.create",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about naming here, should we go with the full podman.create_sandbox? Is there a reason to keep them short?

I'm also wondering about the prefix, since we are already emitting these in the context of the podman driver.

Comment on lines +46 to +50
if let Poll::Ready(Some(Err(status))) = &result {
openshell_otel::mark_error(&self.span);
self.span
.record("rpc.grpc.status_code", status.code() as i32);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also record Code::Ok when the stream returns Poll::Ready(None)? Successful WatchSandboxes spans currently export without rpc.grpc.status_code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants