Scylla generates many metrics, and when multiplied by the number of shards, the total number of metrics adds a significant load to a monitoring server. With multi-tier monitoring, it is helpful to have a smaller subset of metrics users care about and allow them to get only those. This patch adds two kind of labels, the a __level label, currently with a single value, but we can add more in the future. The second kind, is a cross feature label, curently for alternator, cdc and cas. We will use the __level label to mark the interesting user-facing metrics. The current level value is: basic - metrics for Scylla monitoring In this phase, basic will mark all metrics used in the dashboards. In practice, without any configuration change, Prometheus would get the same metrics as it gets today. While it is possible to filter by the label, e.g.: curl http://localhost:9180/metrics?__level=basic The labels themselves are not reported thanks to label filtering of labels begin with __. The feature labels: __cdc, __cas and __alternator can be an easy way to disable a set of metrics when not using a feature. Signed-off-by: Amnon Heiman <amnon@scylladb.com>
11 lines
439 B
C++
11 lines
439 B
C++
// Copyright (C) 2025-present ScyllaDB
|
|
// SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
|
|
#include "utils/labels.hh"
|
|
|
|
seastar::metrics::label level_label("__level");
|
|
seastar::metrics::label_instance basic_level("__level", "basic");
|
|
seastar::metrics::label_instance cdc_label("__cdc", "1");
|
|
seastar::metrics::label_instance cas_label("__cas", "1");
|
|
seastar::metrics::label_instance alternator_label("__alternator", "1");
|