fix: Refine connectivity metric for RPCs that receive no response and sent to Transport layer - #4220
fix: Refine connectivity metric for RPCs that receive no response and sent to Transport layer #4220surbhigarg92 wants to merge 1 commit into
Conversation
8142951 to
d35b81c
Compare
4d45e98 to
aa7e823
Compare
|
@surbhigarg92 nit: Can you please update the PR title? it should reflect little more on what are you trying to fix since it comes in the release tag |
Done |
| */ | ||
| package com.google.cloud.spanner; | ||
|
|
||
| import io.grpc.ClientStreamTracer; |
There was a problem hiding this comment.
This is an experimental API right? Until tracer is launched, we can't use it right? https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/ClientStreamTracer.java#L27
| return new SimpleForwardingClientCall<ReqT, RespT>(next.newCall(method, callOptions)) { | ||
| final AtomicBoolean headersReceived = new AtomicBoolean(false); | ||
| SpannerGrpcStreamTracer streamTracer = new SpannerGrpcStreamTracer(); | ||
| CallOptions newOptions = |
There was a problem hiding this comment.
Does customer have access to CallOptions? If yes, We need to make sure we are not overriding withStreamTracerFactory which is set by the customer
|
Closing this PR as we can't use Experimental API |
This PR enhances the connectivity error metrics in the Java Spanner client library to provide a more accurate and comprehensive tracking of network-related issues.
Description:
The current connectivity error metric is only incremented in the rare event that a response header is received from the server but lacks GFE/AFE server timing latency. This limitation means that more common and critical connectivity problems are not captured, such as:
To address this gap, this change updates the logic to also capture RPCs that have been passed to the gRPC transport layer but for which no response is received. This will result in a more accurate and reliable connectivity error metric.
Note Client-side timeouts that occur before an RPC is sent to the transport layer are explicitly excluded from this metric.