CORE-2059: net: separate rpc metrics from generic transport #17717
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.
The net::transport metrics managed a superset of metrics for all specializations (e.g. rpc, kafka client). This commit separates them so that the client transport specializations can manage their own metrics.
It's not pretty, but there is also only one user of it in the tree: the rpc transport. With at least one more example the pattern could likely be made more tasty.
The basic strategy is to have a transport probe inherit from the base transport probe. The specialization owns the probe, and passes in a reference to the base transport which will update the metrics common to all transports.
When the specialization sets up metrics it collects its own and passes them to the base transport metrics setup function which combines all of them together and registers them.
Backports Required
Release Notes