Skip to content

Commit

Permalink
metrics: replicate selected seastar metrics
Browse files Browse the repository at this point in the history
This commit replicates a few metrics exposed by seastar in order to
expose them on the 'public_metrics' endpoint. See a list of the new
metrics below:

* redpanda_io_queue_total_write_ops
    * Description: Total write operations passed in the queue
    * Labels: class (i.e. the IO priority class used for the write),
      ioshard (i.e. the shard that executes the IO), shard (i.e. the
      shard that issued the IO request), mountpoint

* redpanda_io_queue_total_read_ops
    * Description: Total read operations passed in the queue
    * Labels: class (i.e. the IO priority class used for the write),
      ioshard (i.e. the shard that executes the IO), shard (i.e. the
      shard that issued the IO request), mountpoint

* redpanda_memory_free_memory
    * Description: Free memory size in bytes
    * Labels: shard

* redpanda_memory_allocated_memory
    * Description: Allocated memory size in bytes
    * Labels: shard
  • Loading branch information
Vlad Lazar committed Jul 12, 2022
1 parent f8d29fb commit 9179aee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/v/redpanda/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "redpanda/admin_server.h"
#include "resource_mgmt/io_priority.h"
#include "rpc/simple_protocol.h"
#include "ssx/metrics.h"
#include "storage/backlog_controller.h"
#include "storage/chunk_cache.h"
#include "storage/compaction_controller.h"
Expand Down Expand Up @@ -312,6 +313,16 @@ void application::initialize(
}

void application::setup_metrics() {
if (!config::shard_local_cfg().disable_public_metrics()) {
seastar::metrics::replicate_metric_families(
seastar::metrics::default_handle(),
{{"io_queue_total_read_ops", ssx::metrics::public_metrics_handle},
{"io_queue_total_write_ops", ssx::metrics::public_metrics_handle},
{"memory_allocated_memory", ssx::metrics::public_metrics_handle},
{"memory_free_memory", ssx::metrics::public_metrics_handle}})
.get();
}

if (config::shard_local_cfg().disable_metrics()) {
return;
}
Expand Down

0 comments on commit 9179aee

Please sign in to comment.