fix: Connectivity Error Metrics #4220
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.