Skip to content

refactor(otel): unify compute driver tracing - #2995

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

refactor(otel): unify compute driver tracing#2995
krishicks wants to merge 1 commit into
mainfrom
hicks/push-ryuprmvruspr

Conversation

@krishicks

Copy link
Copy Markdown
Collaborator

Summary

This changes compute-driver tracing to use fully qualified protobuf operation names and stable semantic-convention gRPC status attributes across the gateway and drivers. It also keeps WatchSandboxes client and server spans open for the stream lifetime, distinguishes backend implementation spans, and updates the related tests and documentation.

Before:

image

After:

image

The above example is for docker, but all drivers were updated.

Related Issue

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)

@github-actions

Copy link
Copy Markdown

Comment thread crates/openshell-driver-docker/src/lib.rs Outdated
@krishicks
krishicks force-pushed the hicks/push-ryuprmvruspr branch from afd2908 to f4d7e74 Compare August 27, 2026 20:29
@krishicks
krishicks requested a review from elezar August 27, 2026 20:38
@krishicks
krishicks enabled auto-merge August 27, 2026 21:09

@elezar elezar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Request changes before approval:

  • [P2] Standalone Docker tracing remains on its legacy trace layer (driver.*, rpc.system, and rpc.grpc.status_code), while the in-process path is migrated. Please bring the standalone path to the same contract; this file is outside the PR diff, so I could not anchor this finding.
  • [P2] The inline findings cover missing cancellation outcomes for in-process Kubernetes and Podman watch spans, plus duplicate re-export mapping tests.

The operation-mapper simplification is non-blocking.

Comment thread crates/openshell-driver-kubernetes/src/grpc.rs Outdated
Comment thread crates/openshell-driver-podman/src/grpc.rs Outdated
Comment thread crates/openshell-driver-vm/src/otel_tracing.rs Outdated
Comment thread crates/openshell-otel/src/grpc.rs Outdated
@krishicks
krishicks force-pushed the hicks/push-ryuprmvruspr branch from f4d7e74 to 6d88a7c Compare August 28, 2026 17:26
@krishicks krishicks changed the title refactor(otel): clarify compute driver spans refactor(otel): unify compute driver tracing Aug 28, 2026
@krishicks

Copy link
Copy Markdown
Collaborator Author

@elezar I think I got all the feedback, plus did some further refactoring.

@krishicks
krishicks disabled auto-merge August 28, 2026 19:57
@krishicks
krishicks enabled auto-merge August 28, 2026 19:57

@elezar elezar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The refactor resolves the earlier shared-tracing concerns, but the emitted gRPC semantic-convention attributes need adjustment.

rpc.method is a stable gRPC semantic-convention attribute whose value must be the fully qualified logical method name (for example, openshell.compute.v1.ComputeDriver/CreateSandbox). This changes it to the short method name, while adding rpc.service, which is not part of the current stable gRPC semantic conventions. That leaves traces with a non-standard field and makes rpc.method ambiguous for standard telemetry queries and dashboards.

Please keep the fully qualified value in rpc.method (and otel.name) and remove the emitted rpc.service attribute. The descriptor can still store service and method separately, concatenating them at span creation to avoid repeating the service prefix in every RPC constant. OpenTelemetry gRPC semantic conventions

Centralize compute-driver RPC descriptors, stream instrumentation, provider
routing, and standalone installation in openshell-otel. Use typed RPC
constants so gateway and in-process driver paths cannot panic on unknown
operation strings or repeat runtime method parsing.

Emit semantic-convention rpc.service and rpc.method attributes, preserve
trace context and resource identity across deployment modes, and route both
RPC boundary and backend crate spans to each selected driver provider. Leave
consumer-dropped watch spans unset while recording observed terminal status,
and avoid reboxing untraced external-driver streams.

Derive each driver tracing identity from Cargo package and crate metadata and
attach its descriptor to the compute-driver registration, keeping provider
selection and target routing tied to the registered implementation. Share
tracing setup and round-trip test support across Docker, Podman, Kubernetes,
and VM, and update the gateway tracing documentation.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
@krishicks
krishicks force-pushed the hicks/push-ryuprmvruspr branch from 6d88a7c to b8fdc6b Compare August 31, 2026 18:05
@krishicks

Copy link
Copy Markdown
Collaborator Author

Updated rpc.method to use the fully qualified protobuf operation name across client and server spans, removed the obsolete rpc.service attribute, and aligned the tests and documentation with the current OpenTelemetry RPC semantic conventions.

@krishicks
krishicks requested a review from elezar August 31, 2026 18:05
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