feat(bigquery/storage/managedwriter): refine connection metrics #8324
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 changes metrics instrumentation in two ways:
The AppendClientOpenView is now tagged with an error dimension, so that failures to open a connection are clearer. We use grpc status code for the tagging, with the expectation that non-rpc errors are tagged as Unknown.
A new metric (and view), AppendRequestReconnectsView provides additional visibility into when errors during Send trigger reconnection of the underlying connection. We attempt to also attribute this to the origin writer, so it may be tagged by error (grpc status code again) and source stream.
Additional thanks to @tanner-bruce for additional suggestions here
Towards: #8311