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>
27 lines
838 B
C++
27 lines
838 B
C++
// Copyright (C) 2025-present ScyllaDB
|
|
// SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
|
|
#include <seastar/core/metrics.hh>
|
|
|
|
extern seastar::metrics::label level_label;
|
|
/*!
|
|
* \brief we use label to allow granularity when reporting metrics
|
|
*/
|
|
|
|
/*!
|
|
* \brief Basic level are metrics that are being used by Scylla Monitoring
|
|
* To scrap only those metrics a user can use __level=basic
|
|
*/
|
|
extern seastar::metrics::label_instance basic_level;
|
|
|
|
|
|
/*!
|
|
* \brief The following labels are used for specific features
|
|
* It allows user disable a set of metrics that belong to the same
|
|
* feature in an easy way.
|
|
*/
|
|
extern seastar::metrics::label_instance cdc_label;
|
|
extern seastar::metrics::label_instance cas_label;
|
|
extern seastar::metrics::label_instance lwt_label;
|
|
extern seastar::metrics::label_instance alternator_label;
|