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
BenPope authored and Vlad Lazar committed Jun 21, 2022
1 parent de2a0eb commit 83ab25c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 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(); })});
labels,
[this] { return _request_hist.seastar_histogram_logform(); },
internal_aggregate_labels)});
}

} // namespace pandaproxy
} // namespace pandaproxy

0 comments on commit 83ab25c

Please sign in to comment.