From e0e4fcec6bb422a50d2984bdecf4ea4a83abc054 Mon Sep 17 00:00:00 2001 From: Daniil Komarevtsev Date: Fri, 19 Jan 2024 12:20:45 +0700 Subject: [PATCH] NBS-4748: migrate from solomon to monitoring --- cloud/blockstore/config/diagnostics.proto | 31 ++++++- cloud/blockstore/libs/diagnostics/config.cpp | 33 +++++++- cloud/blockstore/libs/diagnostics/config.h | 32 ++++++- .../blockstore/libs/diagnostics/hostname.cpp | 83 +++++++++---------- cloud/blockstore/libs/diagnostics/hostname.h | 19 ++--- .../libs/diagnostics/server_stats.cpp | 10 +-- .../libs/storage/core/monitoring_utils.cpp | 8 +- .../libs/storage/core/monitoring_utils.h | 2 +- .../partition/part_actor_monitoring.cpp | 44 +++++++++- .../partition2/part2_actor_monitoring.cpp | 2 +- .../service/service_actor_monitoring.cpp | 11 ++- .../volume/volume_actor_monitoring.cpp | 6 +- cloud/blockstore/tools/cms/lib/tools.py | 4 +- .../files/dca1-ct5-13.cloud.net/nbs-diag.txt | 3 + .../files/dca1-ct5-17.cloud.net/nbs-diag.txt | 3 + .../files/dca1-ct5-18.cloud.net/nbs-diag.txt | 3 + cloud/filestore/config/diagnostics.proto | 25 +++++- cloud/filestore/libs/diagnostics/config.cpp | 24 +++++- cloud/filestore/libs/diagnostics/config.h | 27 +++++- 19 files changed, 271 insertions(+), 99 deletions(-) diff --git a/cloud/blockstore/config/diagnostics.proto b/cloud/blockstore/config/diagnostics.proto index edeca693c82..52fff23a75c 100644 --- a/cloud/blockstore/config/diagnostics.proto +++ b/cloud/blockstore/config/diagnostics.proto @@ -56,6 +56,25 @@ message TVolumePerfSettings optional uint32 CriticalFactor = 3; }; +//////////////////////////////////////////////////////////////////////////////// +// Monitoring URL components + +message TMonitoringUrlData +{ + // Monitoring cluster name (e.g. yandexcloud_prod_vla). + optional string MonitoringClusterName = 1; + // Monitoring host url. + optional string MonitoringUrl = 2; + // Project name in monitoring. + optional string MonitoringProject = 3; + + // Dashboards ids for monitoring URL formation. + optional string MonitoringVolumeDashboard = 4; + optional string MonitoringPartitionDashboard = 5; + optional string MonitoringNBSAlertsDashboard = 6; + optional string MonitoringNBSTVDashboard = 7; +}; + //////////////////////////////////////////////////////////////////////////////// message TDiagnosticsConfig @@ -72,8 +91,9 @@ message TDiagnosticsConfig // Kikimr monitoring port. optional string KikimrMonitoringPort = 4; + // [obsolete] // Name of cluster in Solomon. - optional string SolomonClusterName = 5; + // optional string SolomonClusterName = 5; // Kikimr monitoring port. optional uint32 KikimrMonPort = 6; @@ -94,8 +114,9 @@ message TDiagnosticsConfig // HDD disk performance threshold // optional TVolumePerfThreshold HddPerfThreshold = 15; + // [obsolete] // Solomon host url. - optional string SolomonUrl = 16; + // optional string SolomonUrl = 16; // Allow destructive LWTrace actions. optional bool UnsafeLWTrace = 17; @@ -103,8 +124,9 @@ message TDiagnosticsConfig // Path to LWTrace query file. optional string LWTraceDebugInitializationQuery = 18; + // [obsolete] // Project name in solomon. - optional string SolomonProject = 20; + // optional string SolomonProject = 20; // Sampling rate for request tracking optional uint32 SamplingRate = 21; @@ -178,4 +200,7 @@ message TDiagnosticsConfig // Performance measurements coefficients for HDD NRD. optional TVolumePerfSettings HddNonreplPerfSettings = 46; + + // Monitoring data necessary for link generation on monpages. + optional TMonitoringUrlData MonitoringUrlData = 47; } diff --git a/cloud/blockstore/libs/diagnostics/config.cpp b/cloud/blockstore/libs/diagnostics/config.cpp index 8f184bd2f34..fc6ff79b56c 100644 --- a/cloud/blockstore/libs/diagnostics/config.cpp +++ b/cloud/blockstore/libs/diagnostics/config.cpp @@ -15,7 +15,6 @@ namespace { xxx(HostNameScheme, NProto::EHostNameScheme, NProto::EHostNameScheme::HOSTNAME_RAW )\ xxx(BastionNameSuffix, TString, "" )\ xxx(ViewerHostName, TString, "" )\ - xxx(SolomonClusterName, TString, "" )\ xxx(KikimrMonPort, ui32, 8765 )\ xxx(NbsMonPort, ui32, 8766 )\ \ @@ -26,8 +25,6 @@ namespace { \ xxx(ProfileLogTimeThreshold, TDuration, TDuration::Seconds(15) )\ xxx(UseAsyncLogger, bool, false )\ - xxx(SolomonUrl, TString, "" )\ - xxx(SolomonProject, TString, "nbs" )\ xxx(UnsafeLWTrace, bool, false )\ xxx(LWTraceDebugInitializationQuery, TString, "" )\ xxx(SsdPerfSettings, TVolumePerfSettings, {} )\ @@ -40,6 +37,7 @@ namespace { xxx(ExpectedIoParallelism, ui32, 32 )\ xxx(CloudIdsWithStrictSLA, TVector, {} )\ xxx(LWTraceShuttleCount, ui32, 2000 )\ + xxx(MonitoringUrlData, TMonitoringUrlData, {} )\ \ xxx(CpuWaitFilename, TString, "/sys/fs/cgroup/cpu/system.slice/nbs.service/cpuacct.wait" )\ \ @@ -85,6 +83,14 @@ ConvertValue( return TVolumePerfSettings(value); } +template <> +TMonitoringUrlData +ConvertValue( + const NProto::TMonitoringUrlData& value) +{ + return TMonitoringUrlData(value); +} + template <> TRequestThresholds ConvertValue( @@ -115,6 +121,11 @@ bool IsEmpty(const NProto::TVolumePerfSettings& t) return t.ByteSizeLong() == 0; } +bool IsEmpty(const NProto::TMonitoringUrlData& t) +{ + return t.ByteSizeLong() == 0; +} + template bool IsEmpty(const google::protobuf::RepeatedPtrField& value) { @@ -253,6 +264,22 @@ void Out( SerializeToTextFormat(v, out); } +template <> +void Out( + IOutputStream& out, + const NCloud::NBlockStore::TMonitoringUrlData& value) +{ + NCloud::NBlockStore::NProto::TMonitoringUrlData v; + v.SetMonitoringClusterName(value.MonitoringClusterName); + v.SetMonitoringUrl(value.MonitoringUrl); + v.SetMonitoringProject(value.MonitoringProject); + v.SetMonitoringVolumeDashboard(value.MonitoringVolumeDashboard); + v.SetMonitoringPartitionDashboard(value.MonitoringPartitionDashboard); + v.SetMonitoringNBSAlertsDashboard(value.MonitoringNBSAlertsDashboard); + v.SetMonitoringNBSTVDashboard(value.MonitoringNBSTVDashboard); + SerializeToTextFormat(v, out); +} + template <> void Out( IOutputStream& out, diff --git a/cloud/blockstore/libs/diagnostics/config.h b/cloud/blockstore/libs/diagnostics/config.h index 0fd30aa2d9c..6a739881470 100644 --- a/cloud/blockstore/libs/diagnostics/config.h +++ b/cloud/blockstore/libs/diagnostics/config.h @@ -70,6 +70,34 @@ struct TVolumePerfSettings: //////////////////////////////////////////////////////////////////////////////// +struct TMonitoringUrlData: public TAtomicRefCount +{ + TString MonitoringClusterName; + TString MonitoringUrl; + TString MonitoringProject; + TString MonitoringVolumeDashboard; + TString MonitoringPartitionDashboard; + TString MonitoringNBSAlertsDashboard; + TString MonitoringNBSTVDashboard; + + TMonitoringUrlData() + : MonitoringProject("nbs") + {} + TMonitoringUrlData(const TMonitoringUrlData& rhs) = default; + + explicit TMonitoringUrlData(const NProto::TMonitoringUrlData& data) + : MonitoringClusterName(data.GetMonitoringClusterName()) + , MonitoringUrl(data.GetMonitoringUrl()) + , MonitoringProject(data.GetMonitoringProject()) + , MonitoringVolumeDashboard(data.GetMonitoringVolumeDashboard()) + , MonitoringPartitionDashboard(data.GetMonitoringPartitionDashboard()) + , MonitoringNBSAlertsDashboard(data.GetMonitoringNBSAlertsDashboard()) + , MonitoringNBSTVDashboard(data.GetMonitoringNBSTVDashboard()) + {} +}; + +//////////////////////////////////////////////////////////////////////////////// + class TDiagnosticsConfig { private: @@ -81,9 +109,6 @@ class TDiagnosticsConfig NProto::EHostNameScheme GetHostNameScheme() const; TString GetBastionNameSuffix() const; TString GetViewerHostName() const; - TString GetSolomonClusterName() const; - TString GetSolomonUrl() const; - TString GetSolomonProject() const; ui32 GetKikimrMonPort() const; ui32 GetNbsMonPort() const; ui32 GetSamplingRate() const; @@ -106,6 +131,7 @@ class TDiagnosticsConfig TVolumePerfSettings GetLocalSSDPerfSettings() const; ui32 GetExpectedIoParallelism() const; TVector GetCloudIdsWithStrictSLA() const; + TMonitoringUrlData GetMonitoringUrlData() const; TString GetCpuWaitFilename() const; diff --git a/cloud/blockstore/libs/diagnostics/hostname.cpp b/cloud/blockstore/libs/diagnostics/hostname.cpp index 330ded1ca06..1b9245030a4 100644 --- a/cloud/blockstore/libs/diagnostics/hostname.cpp +++ b/cloud/blockstore/libs/diagnostics/hostname.cpp @@ -72,74 +72,65 @@ TString GetExternalHostUrl( return out; } -TString GetSolomonVolumeUrl( +TString GetMonitoringVolumeUrl( const TDiagnosticsConfig& config, - const TString& diskId, - const TString& dashboard) + const TString& diskId) { + TMonitoringUrlData data = config.GetMonitoringUrlData(); return TStringBuilder() - << config.GetSolomonUrl() - << "/?project=" << config.GetSolomonProject() - << "&service=service_volume" - << "&cluster="<< config.GetSolomonClusterName() - << "&volume=" << diskId - << "&dashboard=" << dashboard; + << data.MonitoringUrl << "/projects/" << data.MonitoringProject + << "/dashboards/" << data.MonitoringVolumeDashboard + << "?from=now-1d&to=now&refresh=60000&p.cluster=" + << data.MonitoringClusterName << "&p.volume=" << diskId; } -TString GetSolomonPartitionUrl( - const TDiagnosticsConfig& config, - const TString& dashboard) +TString GetMonitoringPartitionUrl(const TDiagnosticsConfig& config) { + TMonitoringUrlData data = config.GetMonitoringUrlData(); return TStringBuilder() - << config.GetSolomonUrl() - << "/?project=" << config.GetSolomonProject() - << "&service=tablets" - << "&cluster=" << config.GetSolomonClusterName() - << "&host=" << GetShortHostName() - << "&dashboard=" << dashboard; + << data.MonitoringUrl << "/projects/" << data.MonitoringProject + << "/dashboards/" << data.MonitoringPartitionDashboard + << "?from=now-1d&to=now&" + "refresh=60000&p.service=tablets&p.cluster=" + << data.MonitoringClusterName << "&p.host=" << GetShortHostName(); } -TString GetSolomonServerUrl( - const TDiagnosticsConfig& config, - const TString& dashboard) +TString GetMonitoringNBSAlertsUrl(const TDiagnosticsConfig& config) { + TMonitoringUrlData data = config.GetMonitoringUrlData(); return TStringBuilder() - << config.GetSolomonUrl() - << "/?project" << config.GetSolomonProject() - << "&service=server" - << "&cluster=" << config.GetSolomonClusterName() - << "&host=" << GetShortHostName() - << "&type=-" - << "&dashboard="<< dashboard; + << data.MonitoringUrl << "/projects/" << data.MonitoringProject + << "/dashboards/" << data.MonitoringNBSAlertsDashboard + << "?from=now-1d&to=now&refresh=60000&p.cluster=" + << data.MonitoringClusterName << "&p.host=" << GetShortHostName(); } -TString GetSolomonClientUrl( - const TDiagnosticsConfig& config, - const TString& dashboard) +TString GetMonitoringNBSOverviewToTVUrl(const TDiagnosticsConfig& config) { + TMonitoringUrlData data = config.GetMonitoringUrlData(); return TStringBuilder() - << config.GetSolomonUrl() - << "/?project=" << config.GetSolomonProject() - << "&service=client" - << "&cluster="<< config.GetSolomonClusterName() - << "&host=" << GetShortHostName() - << "&type=-" - << "&dashboard=" << dashboard; + << data.MonitoringUrl << "/projects/" << data.MonitoringProject + << "/dashboards/" << data.MonitoringNBSTVDashboard + << "?from=now-1d&to=now&refresh=60000&p.cluster=" + << data.MonitoringClusterName << "&p.host=cluster"; } TString GetSolomonBsProxyUrl( const TDiagnosticsConfig& config, ui32 groupId, - const TString& dashboard) + const TString& storagePool) { + TMonitoringUrlData data = config.GetMonitoringUrlData(); return TStringBuilder() - << config.GetSolomonUrl() - << "/?project" << config.GetSolomonProject() - << "&service=dsproxy_percentile" - << "&cluster=" << config.GetSolomonClusterName() - << "&host=" << GetShortHostName() - << "&blobstorageproxy=" << groupId - << "&dashboard=" << dashboard; + << data.MonitoringUrl + << "/projects/kikimr/explorer/" + "queries?q.0.s=histogram_percentile(99, {project=\"kikimr" + << "\", cluster=\"" << data.MonitoringClusterName + << "\", storagePool=\"" << storagePool << "\", group=\"" << groupId + << "\", host=\"*\", service=\"vdisks\", " + "subsystem=\"latency_histo\", " + "handleclass=\"GetFast\"})&q.0.name=A&from=now-1d&to=now&refresh=" + "60000"; } } // namespace NCloud::NBlockStore diff --git a/cloud/blockstore/libs/diagnostics/hostname.h b/cloud/blockstore/libs/diagnostics/hostname.h index 9a5d7615add..2d275e5f647 100644 --- a/cloud/blockstore/libs/diagnostics/hostname.h +++ b/cloud/blockstore/libs/diagnostics/hostname.h @@ -24,26 +24,19 @@ TString GetExternalHostUrl( EHostService serviceType, const TDiagnosticsConfig& config); -TString GetSolomonServerUrl( - const TDiagnosticsConfig& config, - const TString& dashboard); +TString GetMonitoringNBSAlertsUrl(const TDiagnosticsConfig& config); -TString GetSolomonClientUrl( - const TDiagnosticsConfig& config, - const TString& dashboard); +TString GetMonitoringNBSOverviewToTVUrl(const TDiagnosticsConfig& config); -TString GetSolomonVolumeUrl( +TString GetMonitoringVolumeUrl( const TDiagnosticsConfig& config, - const TString& diskId, - const TString& dashboard); + const TString& diskId); -TString GetSolomonPartitionUrl( - const TDiagnosticsConfig& config, - const TString& dashboard); +TString GetMonitoringPartitionUrl(const TDiagnosticsConfig& config); TString GetSolomonBsProxyUrl( const TDiagnosticsConfig& config, ui32 groupId, - const TString& dashboard); + const TString& storagePool); } // namespace NCloud::NBlockStore diff --git a/cloud/blockstore/libs/diagnostics/server_stats.cpp b/cloud/blockstore/libs/diagnostics/server_stats.cpp index 43ff5016b28..916ceefcbc3 100644 --- a/cloud/blockstore/libs/diagnostics/server_stats.cpp +++ b/cloud/blockstore/libs/diagnostics/server_stats.cpp @@ -601,15 +601,15 @@ void TServerStats::OutputHtml(IOutputStream& out, const IMonHttpRequest& request if (DiagnosticsConfig) { TAG(TH3) { out << "Server dashboards"; + << GetMonitoringNBSAlertsUrl(*DiagnosticsConfig) + << "'>NBS Alerts dashboard"; }; TAG(TH3) { out << "Client dashboards"; - }; + << GetMonitoringNBSOverviewToTVUrl(*DiagnosticsConfig) + << "'>NBS overview To TV"; + } } TAG(TH3) { out << "Config"; } diff --git a/cloud/blockstore/libs/storage/core/monitoring_utils.cpp b/cloud/blockstore/libs/storage/core/monitoring_utils.cpp index e51c8735421..3d6665d06ce 100644 --- a/cloud/blockstore/libs/storage/core/monitoring_utils.cpp +++ b/cloud/blockstore/libs/storage/core/monitoring_utils.cpp @@ -968,15 +968,14 @@ void DumpCompactionMap( } } -void DumpSolomonVolumeLink( +void DumpMonitoringVolumeLink( IOutputStream& out, const TDiagnosticsConfig& config, const TString& diskId) { HTML(out) { TAG(TH3) { - out << "Volume dashboards"; } } @@ -988,8 +987,7 @@ void DumpSolomonPartitionLink( { HTML(out) { TAG(TH3) { - out << "Partition dashboards"; } } diff --git a/cloud/blockstore/libs/storage/core/monitoring_utils.h b/cloud/blockstore/libs/storage/core/monitoring_utils.h index 174717df560..f444d407edb 100644 --- a/cloud/blockstore/libs/storage/core/monitoring_utils.h +++ b/cloud/blockstore/libs/storage/core/monitoring_utils.h @@ -159,7 +159,7 @@ void DumpCompactionMap( const TVector& items, const ui32 rangeSize); -void DumpSolomonVolumeLink( +void DumpMonitoringVolumeLink( IOutputStream& out, const TDiagnosticsConfig& config, const TString& diskId); diff --git a/cloud/blockstore/libs/storage/partition/part_actor_monitoring.cpp b/cloud/blockstore/libs/storage/partition/part_actor_monitoring.cpp index acebb3e3c19..cddb788d2c6 100644 --- a/cloud/blockstore/libs/storage/partition/part_actor_monitoring.cpp +++ b/cloud/blockstore/libs/storage/partition/part_actor_monitoring.cpp @@ -32,7 +32,9 @@ namespace { void DumpDownGroups( IOutputStream& out, TInstant now, - const TPartitionState& state) + const TPartitionState& state, + const TTabletStorageInfo& storage, + const TDiagnosticsConfig& config) { HTML(out) { @@ -53,7 +55,36 @@ void DumpDownGroups( const TDowntimeHistory& history) { TABLER() { - TABLEH() { out << groupId; } + TABLEH() + { + auto groupIdFinder = + [groupId](const TTabletChannelInfo& channelInfo) + { + const auto* entry = channelInfo.LatestEntry(); + if (!entry) { + return false; + } + return entry->GroupID == groupId; + }; + auto it = std::ranges::find_if( + storage.Channels, + groupIdFinder); + if (it == storage.Channels.end() || + std::any_of( + it + 1, + storage.Channels.end(), + groupIdFinder)) + { + out << groupId; + } else { + out << groupId << " Graphs"; + } + } TABLEH() { TSvgWithDownGraph svg(out); for (const auto& [time, state]: history) { @@ -152,7 +183,7 @@ void DumpChannels( << GetSolomonBsProxyUrl( config, latestEntry->GroupID, - "nbs-dsproxy-percentile") + channel.StoragePool) << "'>Graphs"; } TABLED() { @@ -641,7 +672,12 @@ void TPartitionActor::HandleHttpInfo_Default( } DIV_CLASS_ID("tab-pane", "Channels") { - DumpDownGroups(out, ctx.Now(), *State); + DumpDownGroups( + out, + ctx.Now(), + *State, + *Info(), + *DiagnosticsConfig); TAG(TH3) { BuildMenuButton(out, "reassign-all"); diff --git a/cloud/blockstore/libs/storage/partition2/part2_actor_monitoring.cpp b/cloud/blockstore/libs/storage/partition2/part2_actor_monitoring.cpp index 1950ca20a7e..de6bc2530dd 100644 --- a/cloud/blockstore/libs/storage/partition2/part2_actor_monitoring.cpp +++ b/cloud/blockstore/libs/storage/partition2/part2_actor_monitoring.cpp @@ -109,7 +109,7 @@ void DumpChannels( << GetSolomonBsProxyUrl( config, latestEntry->GroupID, - "nbs-dsproxy-percentile") + channel.StoragePool) << "'>Graphs"; } TABLED() { diff --git a/cloud/blockstore/libs/storage/service/service_actor_monitoring.cpp b/cloud/blockstore/libs/storage/service/service_actor_monitoring.cpp index c6f95b947ef..a2b18cd1e0f 100644 --- a/cloud/blockstore/libs/storage/service/service_actor_monitoring.cpp +++ b/cloud/blockstore/libs/storage/service/service_actor_monitoring.cpp @@ -181,7 +181,9 @@ void TServiceActor::RenderDownDisks(IOutputStream& out) const } } - auto addVolumeRow = [&](const TString& diskId) { + auto addVolumeRow = [&](const TVolumeInfo& volume) + { + const TString& diskId = volume.VolumeInfo->GetDiskId(); auto history = VolumeStats->GetDowntimeHistory(diskId); bool hasDowntimes = false; for (const auto& [_, state]: history) { @@ -192,7 +194,10 @@ void TServiceActor::RenderDownDisks(IOutputStream& out) const } if (hasDowntimes) { TABLER() { - TABLEH() { out << diskId; } + TABLEH() { + out << "" << diskId << ""; + } TABLEH() { TSvgWithDownGraph svg(out); for (const auto& [time, state]: history) { @@ -206,7 +211,7 @@ void TServiceActor::RenderDownDisks(IOutputStream& out) const }; for (const auto& p: State.GetVolumes()) { - addVolumeRow(p.first); + addVolumeRow(*p.second); } } } diff --git a/cloud/blockstore/libs/storage/volume/volume_actor_monitoring.cpp b/cloud/blockstore/libs/storage/volume/volume_actor_monitoring.cpp index f363f7cdda5..81511b44f4a 100644 --- a/cloud/blockstore/libs/storage/volume/volume_actor_monitoring.cpp +++ b/cloud/blockstore/libs/storage/volume/volume_actor_monitoring.cpp @@ -1,6 +1,7 @@ #include "volume_actor.h" #include +#include #include #include @@ -790,7 +791,10 @@ void TVolumeActor::RenderHtmlInfo(IOutputStream& out, TInstant now) const HTML(out) { DIV_CLASS("row") { DIV_CLASS("col-md-6") { - DumpSolomonVolumeLink(out, *DiagnosticsConfig, State->GetDiskId()); + DumpMonitoringVolumeLink( + out, + *DiagnosticsConfig, + State->GetDiskId()); } } diff --git a/cloud/blockstore/tools/cms/lib/tools.py b/cloud/blockstore/tools/cms/lib/tools.py index 4e7e1f087fe..2c3becc1574 100644 --- a/cloud/blockstore/tools/cms/lib/tools.py +++ b/cloud/blockstore/tools/cms/lib/tools.py @@ -67,7 +67,9 @@ def get_config_files(host, scp, cfg_path): s = f.read().decode("utf-8").strip() if s: logging.debug(f'[get_config_files] {name} {path}: {s}') - message = ProtoParse(s, libconfig.CONFIGS[name]()) + message = ProtoParse(s, + libconfig.CONFIGS[name](), + allow_unknown_field=True) fs_configs[name] = message diff --git a/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-13.cloud.net/nbs-diag.txt b/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-13.cloud.net/nbs-diag.txt index fadf6d90e7f..4d0714b6cdd 100644 --- a/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-13.cloud.net/nbs-diag.txt +++ b/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-13.cloud.net/nbs-diag.txt @@ -2,4 +2,7 @@ HostNameScheme: HOSTNAME_YDBVIEWER ViewerHostName: "ydb.bastion.cloud.ru" SolomonClusterName: "cloud_hw-nbs-dev-lab" UseAsyncLogger: true +MonitoringUrlData { + MonitoringClusterName: "cloud_hw-nbs-dev-lab" +} diff --git a/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-17.cloud.net/nbs-diag.txt b/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-17.cloud.net/nbs-diag.txt index fadf6d90e7f..4d0714b6cdd 100644 --- a/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-17.cloud.net/nbs-diag.txt +++ b/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-17.cloud.net/nbs-diag.txt @@ -2,4 +2,7 @@ HostNameScheme: HOSTNAME_YDBVIEWER ViewerHostName: "ydb.bastion.cloud.ru" SolomonClusterName: "cloud_hw-nbs-dev-lab" UseAsyncLogger: true +MonitoringUrlData { + MonitoringClusterName: "cloud_hw-nbs-dev-lab" +} diff --git a/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-18.cloud.net/nbs-diag.txt b/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-18.cloud.net/nbs-diag.txt index fadf6d90e7f..4d0714b6cdd 100644 --- a/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-18.cloud.net/nbs-diag.txt +++ b/cloud/blockstore/tools/cms/patcher/tests/data/files/dca1-ct5-18.cloud.net/nbs-diag.txt @@ -2,4 +2,7 @@ HostNameScheme: HOSTNAME_YDBVIEWER ViewerHostName: "ydb.bastion.cloud.ru" SolomonClusterName: "cloud_hw-nbs-dev-lab" UseAsyncLogger: true +MonitoringUrlData { + MonitoringClusterName: "cloud_hw-nbs-dev-lab" +} diff --git a/cloud/filestore/config/diagnostics.proto b/cloud/filestore/config/diagnostics.proto index 23f52b9817d..9da3e5483a8 100644 --- a/cloud/filestore/config/diagnostics.proto +++ b/cloud/filestore/config/diagnostics.proto @@ -6,6 +6,19 @@ option go_package = "github.com/ydb-platform/nbs/cloud/filestore/config"; import "cloud/storage/core/protos/trace.proto"; +//////////////////////////////////////////////////////////////////////////////// +// Monitoring URL components + +message TMonitoringUrlData +{ + // Monitoring cluster name (e.g. yandexcloud_prod_vla). + optional string MonitoringClusterName = 1; + // Monitoring host url. + optional string MonitoringUrl = 2; + // Project name in monitoring. + optional string MonitoringProject = 3; +}; + //////////////////////////////////////////////////////////////////////////////// message TDiagnosticsConfig @@ -13,14 +26,17 @@ message TDiagnosticsConfig // For proper monpage link generation. optional string BastionNameSuffix = 1; + // [obsolete] // Solomon cluster name (e.g. yandexcloud_prod_vla). - optional string SolomonClusterName = 2; + // optional string SolomonClusterName = 2; + // [obsolete] // Solomon host url. - optional string SolomonUrl = 3; + // optional string SolomonUrl = 3; + // [obsolete] // Project name in solomon. - optional string SolomonProject = 4; + // optional string SolomonProject = 4; // Monserver will listen on this port. optional uint32 FilestoreMonPort = 5; @@ -73,4 +89,7 @@ message TDiagnosticsConfig // Requests percentage in predictor to calculate possible delay [0.0, 1.0]. optional double PostponeTimePredictorPercentage = 21; + + // Monitoring data necessary for link generation on monpages. + optional TMonitoringUrlData MonitoringUrlData = 22; } diff --git a/cloud/filestore/libs/diagnostics/config.cpp b/cloud/filestore/libs/diagnostics/config.cpp index 37d39a19637..f987d60653c 100644 --- a/cloud/filestore/libs/diagnostics/config.cpp +++ b/cloud/filestore/libs/diagnostics/config.cpp @@ -13,9 +13,6 @@ namespace { #define FILESTORE_DIAGNOSTICS_CONFIG(xxx) \ xxx(BastionNameSuffix, TString, "ydb.bastion.cloud.yandex-team.ru" )\ - xxx(SolomonClusterName, TString, "" )\ - xxx(SolomonUrl, TString, "https://solomon.yandex-team.ru" )\ - xxx(SolomonProject, TString, "nfs" )\ xxx(FilestoreMonPort, ui32, 8767 )\ \ xxx(SamplingRate, ui32, 0 )\ @@ -36,6 +33,7 @@ namespace { xxx(PostponeTimePredictorInterval, TDuration, TDuration::Seconds(15) )\ xxx(PostponeTimePredictorMaxTime, TDuration, TDuration::Minutes(1) )\ xxx(PostponeTimePredictorPercentage, double, 0.0 )\ + xxx(MonitoringUrlData, TMonitoringUrlData, {} )\ // FILESTORE_DIAGNOSTICS_CONFIG #define FILESTORE_DIAGNOSTICS_DECLARE_CONFIG(name, type, value) \ @@ -68,6 +66,14 @@ ConvertValue( return ConvertRequestThresholds(value); } +template <> +TMonitoringUrlData +ConvertValue( + const NProto::TMonitoringUrlData& value) +{ + return TMonitoringUrlData(value); +} + } // namespace //////////////////////////////////////////////////////////////////////////////// @@ -136,3 +142,15 @@ void Out( { OutRequestThresholds(out, value); } + +template <> +void Out( + IOutputStream& out, + const NCloud::NFileStore::TMonitoringUrlData& value) +{ + NCloud::NFileStore::NProto::TMonitoringUrlData v; + v.SetMonitoringClusterName(value.MonitoringClusterName); + v.SetMonitoringUrl(value.MonitoringUrl); + v.SetMonitoringProject(value.MonitoringProject); + SerializeToTextFormat(v, out); +} diff --git a/cloud/filestore/libs/diagnostics/config.h b/cloud/filestore/libs/diagnostics/config.h index cc0082d5f1a..2ecd0ce0594 100644 --- a/cloud/filestore/libs/diagnostics/config.h +++ b/cloud/filestore/libs/diagnostics/config.h @@ -13,6 +13,27 @@ namespace NCloud::NFileStore { //////////////////////////////////////////////////////////////////////////////// +struct TMonitoringUrlData: public TAtomicRefCount +{ + TString MonitoringClusterName; + TString MonitoringUrl; + TString MonitoringProject; + + TMonitoringUrlData() + : MonitoringUrl("https://monitoring.yandex-team.ru") + , MonitoringProject("nfs") + {} + TMonitoringUrlData(const TMonitoringUrlData& rhs) = default; + + TMonitoringUrlData(const NProto::TMonitoringUrlData& data) + : MonitoringClusterName(data.GetMonitoringClusterName()) + , MonitoringUrl(data.GetMonitoringUrl()) + , MonitoringProject(data.GetMonitoringProject()) + {} +}; + +//////////////////////////////////////////////////////////////////////////////// + class TDiagnosticsConfig { private: @@ -23,10 +44,6 @@ class TDiagnosticsConfig TString GetBastionNameSuffix() const; - TString GetSolomonClusterName() const; - TString GetSolomonUrl() const; - TString GetSolomonProject() const; - ui32 GetFilestoreMonPort() const; TRequestThresholds GetRequestThresholds() const; @@ -49,6 +66,8 @@ class TDiagnosticsConfig TDuration GetPostponeTimePredictorMaxTime() const; double GetPostponeTimePredictorPercentage() const; + TMonitoringUrlData GetMonitoringUrlData() const; + void Dump(IOutputStream& out) const; void DumpHtml(IOutputStream& out) const; };