Skip to content

feat(cli): forward TRACEPARENT/TRACESTATE to gateway for CI trace continuity - #2931

Open
cmoore-redhat wants to merge 2 commits into
NVIDIA:mainfrom
cmoore-redhat:fix2639
Open

feat(cli): forward TRACEPARENT/TRACESTATE to gateway for CI trace continuity#2931
cmoore-redhat wants to merge 2 commits into
NVIDIA:mainfrom
cmoore-redhat:fix2639

Conversation

@cmoore-redhat

Copy link
Copy Markdown

Summary

The CLI's gateway gRPC channel now passively forwards the W3C trace context (TRACEPARENT/TRACESTATE) from its environment, so a CI pipeline's trace parents the gateway's spans. This needs no OTel collector or provider on the CLI side - short-lived clients on CI runners and jump hosts just pass through what the CI system already exports.

Add EnvTraceContextInterceptor to openshell-otel: it reads the trace context once at construction and injects it as gRPC metadata, and is a no-op when the context is unset or invalid. Compose it with EdgeAuthInterceptor via a new GatewayInterceptor, since tonic allows only one interceptor per channel.

Related Issue

Closes issue #2639

Changes

  • Add EnvTraceContextInterceptor to openshell-otel — reads TRACEPARENT/TRACESTATE from the environment and forwards them as gRPC metadata (no-op when unset or invalid)
  • Compose it with EdgeAuthInterceptor in a new GatewayInterceptor on the CLI's gateway channel, so CI trace context now parents the gateway's spans
  • Add unit tests for the valid, unset, and invalid cases
  • Update architecture/gateway.md to document the passive CLI trace forwarding

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)

…tinuity

The CLI's gateway gRPC channel now passively forwards the W3C trace context
(TRACEPARENT/TRACESTATE) from its environment, so a CI pipeline's trace parents
the gateway's spans. This needs no OTel collector or provider on the CLI side -
short-lived clients on CI runners and jump hosts just pass through what the CI
system already exports.

Add EnvTraceContextInterceptor to openshell-otel: it reads the trace context
once at construction and injects it as gRPC metadata, and is a no-op when the
context is unset or invalid. Compose it with EdgeAuthInterceptor via a new
GatewayInterceptor, since tonic allows only one interceptor per channel.

Closes issue NVIDIA#2639

Signed-off-by: Chris Moore <cmoore@redhat.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@cmoore-redhat

Copy link
Copy Markdown
Author

I have read the DCO document and I hereby sign the DCO.

@johntmyers

Copy link
Copy Markdown
Collaborator

@krishicks this might be in your wheelhouse for a look

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