Skip to content

Commit

Permalink
metrics: pandaproxy: default aggregations
Browse files Browse the repository at this point in the history
Aggregate over shard, method by default

This accounts for pandaproxy and schema registry, so an addional
service label will be added (later).

Signed-off-by: Ben Pope <ben@redpanda.com>
  • Loading branch information
Vlad Lazar committed Jun 24, 2022
1 parent 7df8095 commit 2ea343d
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/v/pandaproxy/probe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<sm::label_instance> labels{
sm::label("operation")(path_desc.operations.nickname)};
operation_label(path_desc.operations.nickname)};

auto aggregate_labels = std::vector<sm::label>{
sm::shard_label, operation_label};
auto internal_aggregate_labels
= config::shard_local_cfg().aggregate_metrics()
? aggregate_labels
: std::vector<sm::label>{};

_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(internal_aggregate_labels)});
}

} // namespace pandaproxy
} // namespace pandaproxy

0 comments on commit 2ea343d

Please sign in to comment.