Skip to content

impl(gax-internal): integrate RequestRecorder with gRPC transport for Server Streaming#5375

Open
haphungw wants to merge 1 commit intogoogleapis:mainfrom
haphungw:o11y-server-request-recorder
Open

impl(gax-internal): integrate RequestRecorder with gRPC transport for Server Streaming#5375
haphungw wants to merge 1 commit intogoogleapis:mainfrom
haphungw:o11y-server-request-recorder

Conversation

@haphungw
Copy link
Copy Markdown
Contributor

Extend RequestRecorder into the server streaming implementation in gaxi. This ensures that transport-level metrics and spans are captured for server streams.

Note:
TODO (#5372): the span created by WithTransportSpan only covers stream initiation, and we should consider instrumenting the returned stream to capture errors during the stream's lifetime.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.60%. Comparing base (0d5080d) to head (efce3cf).

Files with missing lines Patch % Lines
src/gax-internal/src/grpc.rs 97.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5375      +/-   ##
==========================================
+ Coverage   97.58%   97.60%   +0.01%     
==========================================
  Files         222      222              
  Lines       46609    46625      +16     
==========================================
+ Hits        45485    45506      +21     
+ Misses       1124     1119       -5     

☔ 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 marked this pull request as ready for review April 13, 2026 13:19
@haphungw haphungw requested a review from a team as a code owner April 13, 2026 13:19
Comment on lines +404 to 407
if _prior_attempt_count > 0 {
Some(_prior_attempt_count)
} else {
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.

Suggested change
if _prior_attempt_count > 0 {
Some(_prior_attempt_count)
} else {
None
(_prior_attempt_count > 0).then_some(_prior_attempt_count)

Comment on lines +634 to +643
let (service, version, repo, artifact) = if let Some(info) = attrs.instrumentation {
(
Some(info.service_name),
Some(info.client_version),
Some("googleapis/google-cloud-rust"),
Some(info.client_artifact),
)
} 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.

Suggested change
let (service, version, repo, artifact) = if let Some(info) = attrs.instrumentation {
(
Some(info.service_name),
Some(info.client_version),
Some("googleapis/google-cloud-rust"),
Some(info.client_artifact),
)
} else {
(None, None, None, None)
};
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 +315 to +317
let pending = WithTransportMetric::new(self.metric.clone(), pending, 0);
let pending = WithTransportLogging::new(pending);
let pending = WithTransportSpan::new(span, pending);
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 on this pr), it might be nice to add some helpers that allow us to chain these more easily so the code can look like

let pending = pending
  .with_transport_metric(self.metric.clone(), 0)
  .with_transport_logging()
  .with_transport_spane(span);

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