Skip to content

feat(storage): record gcp.storage.client.network.io debug metric on gRPC - #15230

Open
nidhiii-27 wants to merge 9 commits into
feat/storage-server-unreached-metricfrom
feat/storage-network-io-metric
Open

nidhiii-27 wants to merge 9 commits into
feat/storage-server-unreached-metricfrom
feat/storage-network-io-metric

Conversation

@nidhiii-27

Copy link
Copy Markdown
Contributor

Summary

Stacked on #15229.

Adds Debug-tier gcp.storage.client.network.io (LongCounter, unit By) on gRPC calls to track socket-layer wire bytes transmitted and received.

Changes

  • StorageClientMetrics: add recordNetworkIo(Context, String networkPath, long transmitBytes, long receiveBytes) emitting exact 7-key attributes (gcp.client.service, gcp.client.version, gcp.client.artifact, rpc.system.name, server.address, network.path, network.io.direction with values transmit and receive).
  • StorageGrpcMetricsInterceptor: attach a ClientStreamTracer.Factory via callOptions.withStreamTracerFactory(...) when network.io is enabled, accumulating outbound/inbound wire bytes across the stream and flushing totals on onClose.
  • Unit tests in StorageClientMetricsTest and StorageGrpcMetricsInterceptorTest covering symmetric/asymmetric byte counts, disabled debug metrics, and exact attribute sets.

[Generated-by: AI]

Record Debug-tier gcp.storage.client.network.io (unit "By", exact
7-key attributes) on gRPC calls by attaching a ClientStreamTracer.Factory
when debug metrics are enabled, accumulating transmit/receive wire bytes
across streams and flushing on call close.

[Generated-by: AI]

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces network I/O tracking to the gRPC metrics interceptor by adding a recordNetworkIo method to StorageClientMetrics and implementing a NetworkIoTracerFactory in StorageGrpcMetricsInterceptor to trace inbound and outbound wire sizes. It also includes comprehensive unit tests to verify the recording of these metrics under various configurations. I have no feedback to provide.

…-network-io-metric

Resolve the StorageClientMetricsTest conflict: drop the duplicated record*_recordsExact*
tests and narrow the network.io unit test to the skip-non-positive/disabled behavior (exact
attributes, unit and directions stay covered by the interceptor test).

[Generated-by: AI]
@nidhiii-27
nidhiii-27 marked this pull request as ready for review November 26, 2026 06:05
@nidhiii-27
nidhiii-27 requested review from a team as code owners November 26, 2026 06:05
@nidhiii-27
nidhiii-27 requested review from Dhriti07 and cpriti-os and removed request for a team November 26, 2026 06:05

@cpriti-os cpriti-os left a comment

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.

Initial review

…est for Java 8 compatibility

Replace Mockito.mock(StreamController.class) with TestUtils.nullStreamController()
in stubMidStreamReadFailure to avoid ByteBuddy JDK 8 failures when copying JSpecify
@NullMarked annotations from StreamController.

[Generated-by: AI]
…lientStreamTracer

- Merge origin-auth/feat/storage-server-unreached-metric (1d45947)
- Track outbound/inbound wire bytes and network.path per ClientStreamTracer via streamCreated/streamClosed
- Clarify gcp.storage.client.network.io metric description and NetworkIoTracerFactory javadoc
- Add inboundWireSize non-positive guard assertions and multi-stream DirectPath/CloudPath test
Bring in the Java 8 compatibility fix for GrpcStorageImplTest (TestUtils.nullStreamController() instead of Mockito.mock(StreamController.class)) from feat/storage-grpc-veneer-operation-metrics (#14729).

[Generated-by: AI]

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull Request generated by AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants