feat(client): add transport health telemetry - #590
Open
aej wants to merge 10 commits into
Open
Conversation
aej
marked this pull request as ready for review
September 9, 2026 09:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Today an observability library can see RPC and logical connection events, but it cannot reliably answer basic transport questions: is the HTTP/2 connection up, did it reconnect, how many streams are active, or has the peer's stream limit been reached?
The only way to get those facts is to inspect Gun/Mint processes or other private state. I don't think observability code should depend on those implementation details.
What this adds
This adds a transport-neutral
[:grpc, :client, :transport, ...]telemetry API for both Gun and Mint::started:connected:connect_errorresolve,tcp,tls, orhttp2stage.:down:stopped:down.:settingsSETTINGS_MAX_CONCURRENT_STREAMSchanged, or the value is not safely known.:streamsIt also adds optional
failure_stageandfailure_reasonfields to existing client RPC telemetry where the cause is known, for example a deadline, unavailable connection, or stream error.The intention is that a consumer can calculate logical readiness and capacity across multiple physical transports without using connection references as metric labels.
Deliberate limits
Mint also reports
100both before an explicit peer limit is known and when the peer really advertises 100. This PR reports that case as:unknownrather than inventing finite capacity. A small upstream Mint hook exposing whether the setting was present would close that gap.Connect failures are only given a stage (
resolve,tcp,tls, orhttp2) when the adapter exposes that reliably. Error text is not parsed.Testing
The new events use temporary telemetry handlers in tests