Merge 'add_log_level_metrics' into 'cnch-dev'

feat(clickhousech@m-5371677194): add metric cnch_config_logger_level

See merge request: !25858
This commit is contained in:
武世琦 2024-10-22 10:12:40 +00:00 committed by Fred Wang
parent fb0718a4cf
commit 208e80034b
2 changed files with 7 additions and 0 deletions

View File

@ -159,6 +159,11 @@ void ServerPrometheusMetricsWriter::writeConfigMetrics(WriteBuffer & wb)
{
writeOutLine(wb, key_label, max_concurrent_system_queries);
}
else if(metric_name == LOGGER_LEVEL_KEY)
{
const int log_level = getLogger("ServerPrometheusMetricsWriter")->getLevel();
writeOutLine(wb, key_label, log_level);
}
else
{
LOG_WARNING(getLogger("ServerPrometheusMetricsWriter"), "Unknown config metric found, this should never happen");

View File

@ -724,12 +724,14 @@ private:
static constexpr auto MAX_CONCURRENT_DEFAULT_QUERIES_KEY = "max_concurrent_default_queries";
static constexpr auto MAX_CONCURRENT_INSERT_QUERIES_KEY = "max_concurrent_insert_queries";
static constexpr auto MAX_CONCURRENT_SYSTEM_QUERIES_KEY = "max_concurrent_system_queries";
static constexpr auto LOGGER_LEVEL_KEY = "logger_level";
const std::unordered_map<String, String> config_namedoc_map =
{
{MAX_CONCURRENT_DEFAULT_QUERIES_KEY, "Total number of maximum concurrent queries of Default type allowed"},
{MAX_CONCURRENT_INSERT_QUERIES_KEY, "Total number of maximum concurrent queries of Insert type allowed"},
{MAX_CONCURRENT_SYSTEM_QUERIES_KEY, "Total number of maximum concurrent queries of System type allowed"},
{LOGGER_LEVEL_KEY, "Logger level"},
{BUILD_INFO_KEY, "Build info"},
};