aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormregrock <mregrock@ydb.tech>2025-03-13 21:54:58 +0300
committerGitHub <noreply@github.com>2025-03-13 21:54:58 +0300
commit6185a388040840e604fded1bef22227604d9a68e (patch)
treea3eaae53f62b179e85c8e7bda31b190e37766f36
parentdc044aadbf882b34d4a1209ba9076c4097d56107 (diff)
downloadydb-6185a388040840e604fded1bef22227604d9a68e.tar.gz
Fix gui and add config metrics (#15703)
-rw-r--r--ydb/core/base/counters.cpp1
-rw-r--r--ydb/core/cms/console/configs_dispatcher.cpp20
-rw-r--r--ydb/core/config/init/init_impl.h2
3 files changed, 19 insertions, 4 deletions
diff --git a/ydb/core/base/counters.cpp b/ydb/core/base/counters.cpp
index 2222070449..7ca43e1943 100644
--- a/ydb/core/base/counters.cpp
+++ b/ydb/core/base/counters.cpp
@@ -10,6 +10,7 @@ static const THashSet<TString> DATABASE_SERVICES
= {{
TString("blob_depot_agent"),
TString("compile"),
+ TString("config"),
TString("coordinator"),
TString("dsproxy"),
TString("dsproxy_mon"),
diff --git a/ydb/core/cms/console/configs_dispatcher.cpp b/ydb/core/cms/console/configs_dispatcher.cpp
index d28ba507b7..6377b34180 100644
--- a/ydb/core/cms/console/configs_dispatcher.cpp
+++ b/ydb/core/cms/console/configs_dispatcher.cpp
@@ -251,6 +251,8 @@ private:
bool StartupConfigProcessDiff = false;
TString StartupConfigInfo;
::NMonitoring::TDynamicCounters::TCounterPtr StartupConfigChanged;
+ ::NMonitoring::TDynamicCounters::TCounterPtr ConfigurationV1;
+ ::NMonitoring::TDynamicCounters::TCounterPtr ConfigurationV2;
const std::optional<TDebugInfo> DebugInfo;
std::shared_ptr<NConfig::TRecordedInitialConfiguratorDeps> RecordedInitialConfiguratorDeps;
std::vector<TString> Args;
@@ -298,8 +300,18 @@ void TConfigsDispatcher::Bootstrap()
}
TIntrusivePtr<NMonitoring::TDynamicCounters> rootCounters = AppData()->Counters;
TIntrusivePtr<NMonitoring::TDynamicCounters> authCounters = GetServiceCounters(rootCounters, "config");
- NMonitoring::TDynamicCounterPtr counters = authCounters->GetSubgroup("subsystem", "ConfigsDispatcher");
+ NMonitoring::TDynamicCounterPtr counters = authCounters->GetSubgroup("subsystem", "configs_dispatcher");
StartupConfigChanged = counters->GetCounter("StartupConfigChanged", true);
+ ConfigurationV1 = counters->GetCounter("ConfigurationV1", true);
+ ConfigurationV2 = counters->GetCounter("ConfigurationV2", false);
+
+ if (Labels.contains("configuration_version")) {
+ if (Labels.at("configuration_version") == "v1") {
+ *ConfigurationV1 = 1;
+ } else {
+ *ConfigurationV2 = 1;
+ }
+ }
auto commonClient = CreateConfigsSubscriber(
SelfId(),
@@ -522,6 +534,7 @@ void TConfigsDispatcher::Handle(TEvInterconnect::TEvNodesInfo::TPtr &ev)
DIV_CLASS("container") {
DIV_CLASS("navbar navbar-expand-lg navbar-light bg-light") {
+ str << "<style>.navbar { z-index: 1030; position: relative; }</style>" << Endl;
DIV_CLASS("navbar-collapse") {
UL_CLASS("navbar-nav mr-auto") {
LI_CLASS("nav-item") {
@@ -536,9 +549,10 @@ void TConfigsDispatcher::Handle(TEvInterconnect::TEvNodesInfo::TPtr &ev)
}
DIV_CLASS("alert alert-info") {
+ str << "<style>.alert-info { position: relative; z-index: 1020; }</style>" << Endl;
str << "<strong>Configuration version: </strong>";
- if (Labels.contains("config_version")) {
- str << Labels.at("config_version");
+ if (Labels.contains("configuration_version")) {
+ str << Labels.at("configuration_version");
} else {
str << "unknown";
}
diff --git a/ydb/core/config/init/init_impl.h b/ydb/core/config/init/init_impl.h
index 73352129ef..190dcce300 100644
--- a/ydb/core/config/init/init_impl.h
+++ b/ydb/core/config/init/init_impl.h
@@ -1402,7 +1402,7 @@ public:
configsDispatcherInitInfo.StartupConfigYaml = appConfig.GetStartupConfigYaml();
configsDispatcherInitInfo.ItemsServeRules = std::monostate{},
configsDispatcherInitInfo.Labels = Labels;
- configsDispatcherInitInfo.Labels["config_version"] = appConfig.GetConfigDirPath() ? "v2" : "v1";
+ configsDispatcherInitInfo.Labels["configuration_version"] = appConfig.GetConfigDirPath() ? "v2" : "v1";
configsDispatcherInitInfo.DebugInfo = TDebugInfo {
.InitInfo = InitDebug.ConfigTransformInfo,
};