Skip to content

impl(gax-internal): integrate RequestRecorder with gRPC transport for Bidi Stream#5373

Closed
haphungw wants to merge 1 commit intogoogleapis:mainfrom
haphungw:o11y-bidi-request-recorder
Closed

impl(gax-internal): integrate RequestRecorder with gRPC transport for Bidi Stream#5373
haphungw wants to merge 1 commit intogoogleapis:mainfrom
haphungw:o11y-bidi-request-recorder

Conversation

@haphungw
Copy link
Copy Markdown
Contributor

Add the integration of the RequestRecorder to the bidirectional streaming implementation in gaxi. This ensures transport-level metrics and spans are correctly captured for bidi streams.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.58%. Comparing base (0d5080d) to head (239c1de).
⚠️ Report is 55 commits behind head on main.

Files with missing lines Patch % Lines
src/gax-internal/src/grpc.rs 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5373      +/-   ##
==========================================
- Coverage   97.58%   97.58%   -0.01%     
==========================================
  Files         222      222              
  Lines       46609    46623      +14     
==========================================
+ Hits        45485    45498      +13     
- Misses       1124     1125       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haphungw haphungw force-pushed the o11y-bidi-request-recorder branch from 881e278 to 239c1de Compare April 13, 2026 12:11
@haphungw haphungw marked this pull request as ready for review April 13, 2026 12:12
@haphungw haphungw requested a review from a team as a code owner April 13, 2026 12:12
Copy link
Copy Markdown
Contributor

@suzmue suzmue left a comment

Choose a reason for hiding this comment

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

Did a pass but leaving approval to someone more familiar with the observability portion of this CL

let extensions = {
let mut e = tonic::Extensions::new();
e.insert(tonic::GrpcMethod::new(
"google.test.v1.EchoServices",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No action required: EchoServices is used in all of our tests for the service name for GrpcMetho, but I think this maybe should actually be google.test.v1.EchoService (no s) which is the name we use in the paths, but it just doesn't have any affect on the test (I replaced all instances and reran the tests and it doesn't break anything).

)
} else {
(None, None, None, None)
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: this can alternatively be written as

Suggested change
};
let (service, version, repo, artifact) = attrs.instrumentation
.map(|info| (
Some(info.service_name),
Some(info.client_version),
Some("googleapis/google-cloud-rust"),
Some(info.client_artifact),
))
.unwrap_or_default();

Comment on lines +240 to +257
tracing::info_span!(
"grpc.request",
{ OTEL_NAME } = rpc_method,
{ RPC_SYSTEM_NAME } = attributes::RPC_SYSTEM_GRPC,
{ OTEL_KIND } = attributes::OTEL_KIND_CLIENT,
{ otel_trace::RPC_METHOD } = rpc_method,
{ otel_trace::SERVER_ADDRESS } = attrs.server_address,
{ otel_trace::SERVER_PORT } = attrs.server_port,
{ otel_attr::URL_DOMAIN } = attrs.url_domain,
{ RPC_RESPONSE_STATUS_CODE } = tracing::field::Empty,
{ OTEL_STATUS_CODE } = otel_status_codes::UNSET,
{ otel_trace::ERROR_TYPE } = tracing::field::Empty,
{ GCP_CLIENT_SERVICE } = service,
{ GCP_CLIENT_VERSION } = version,
{ GCP_CLIENT_REPO } = repo,
{ GCP_CLIENT_ARTIFACT } = artifact,
{ GCP_GRPC_RESEND_COUNT } = None::<i64>,
{ GCP_RESOURCE_DESTINATION_ID } = tracing::field::Empty,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

possible code clean up for later: This seems like it could share code with #5375

@coryan
Copy link
Copy Markdown
Contributor

coryan commented Apr 17, 2026

I think we should close this PR until we know what is the design (or even the requirements) for streaming RPCs.

@haphungw haphungw closed this Apr 17, 2026
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.

3 participants