diff --git a/src/v/pandaproxy/probe.cc b/src/v/pandaproxy/probe.cc index 981f335df7249..f43e05e2be203 100644 --- a/src/v/pandaproxy/probe.cc +++ b/src/v/pandaproxy/probe.cc @@ -23,15 +23,26 @@ probe::probe(ss::httpd::path_description& path_desc) return; } namespace sm = ss::metrics; + + auto operation_label = sm::label("operation"); std::vector labels{ - sm::label("operation")(path_desc.operations.nickname)}; + operation_label(path_desc.operations.nickname)}; + + auto aggregate_labels = std::vector{ + sm::shard_label, operation_label}; + auto internal_aggregate_labels + = config::shard_local_cfg().aggregate_metrics() + ? aggregate_labels + : std::vector{}; + _metrics.add_group( "pandaproxy", {sm::make_histogram( - "request_latency", - sm::description("Request latency"), - std::move(labels), - [this] { return _request_hist.seastar_histogram_logform(); })}); + "request_latency", + sm::description("Request latency"), + labels, + [this] { return _request_hist.seastar_histogram_logform(); }) + .aggregate(aggregate_labels)}); } -} // namespace pandaproxy \ No newline at end of file +} // namespace pandaproxy