googleapis / googleapis/google-cloud-rust

Unary gRPC drops trace-context propagation when client tracing is disabled

Open
#6,708 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Rust
Stars
955
Forks
144
Avg merge
1d 5h
Merged PRs (30d)
279

Description

Unconfirmed. This is the result of a search with Claude, may be a false positive.

In `src/gax-internal/src/grpc.rs`, unary gRPC requests inject distributed trace context into outbound metadata headers:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/gax-internal/src/grpc.rs#L496-L506

The injected span is created by `grpc_helpers::unary_make_request_span`. When `self.tracing_attributes` is `None` (client telemetry tracing disabled), `unary_make_request_span` returns `tracing::Span::none()`:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/gax-internal/src/grpc/grpc_helpers.rs#L142-L144

Injecting from `Span::none()` sends no traceparent or baggage headers. In contrast, all other transport paths (HTTP at `http.rs:326-331`, `501-506`, and gRPC streaming at `grpc.rs:212`, `367`) inject from `&tracing::Span::current()` to propagate active trace context regardless of whether client tracing is enabled.

Contributor guide

Open the contributing guide

Research direction

Start in src/gax-internal/src/grpc.rs at the unary request metadata injection and read grpc_helpers::unary_make_request_span in src/gax-internal/src/grpc/grpc_helpers.rs. Compare these paths with the HTTP locations in http.rs and streaming injections in grpc.rs. Done means unary requests preserve active trace context when client tracing is disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, rust
Domain
distributed-systems, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.