Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-2059: net: separate rpc metrics from generic transport #17717

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

dotnwat
Copy link
Member

@dotnwat dotnwat commented Apr 9, 2024

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

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x

Release Notes

  • none

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.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Copy link
Contributor

@rockwotj rockwotj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

#include <optional>
#include <random>
#include <utility>

using namespace std::chrono_literals;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this feels unrelated or maybe another commit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's related: by removing headers during the refactoring in net:: we unearthed places that were getting their chrono_literals through that path.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless you're saying that those chrono literals could have been added into a previous commit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, no it's fine.

@dotnwat dotnwat merged commit 4c13547 into redpanda-data:dev Apr 10, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants