Skip to content

Commit

Permalink
Move blobstorageproxies actor services to different monitoring shard (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
serbel324 authored Sep 6, 2024
1 parent df7e1b2 commit a1a4409
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions ydb/core/base/counters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ static const THashSet<TString> DATABASE_SERVICES
= {{ TString("compile"),
TString("coordinator"),
TString("dsproxy"),
TString("dsproxy_mon"),
TString("dsproxynode"),
TString("dsproxy_overview"),
TString("dsproxy_percentile"),
Expand Down
11 changes: 9 additions & 2 deletions ydb/core/blobstorage/dsproxy/dsproxy_monactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,15 @@ class TBlobStorageGroupProxyMonActor : public TActorBootstrapped<TBlobStorageGro

TString path = Sprintf("blobstorageproxy%09" PRIu32, (ui32)GroupId);
TString name = Sprintf("BlobStorageProxy%09" PRIu32, (ui32)GroupId);
mon->RegisterActorPage(proxiesMonPage, path, name, false, TlsActivationContext->ExecutorThread.ActorSystem,
SelfId());
mon->RegisterActorPage(TMon::TRegisterActorPageFields{
.Title = name,
.RelPath = path,
.ActorSystem = TlsActivationContext->ExecutorThread.ActorSystem,
.Index = proxiesMonPage,
.PreTag = false,
.ActorId = SelfId(),
.MonServiceName = "dsproxy_mon"
});
}

Become(&TThis::StateOnline);
Expand Down
6 changes: 4 additions & 2 deletions ydb/core/mon/async_http_mon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ class THttpMonLegacyActorRequest : public TActorBootstrapped<THttpMonLegacyActor
void ReplyWith(NHttp::THttpOutgoingResponsePtr response) {
TString url(Event->Get()->Request->URL.Before('?'));
TString status(response->Status);
NMonitoring::THistogramPtr ResponseTimeHgram = NKikimr::GetServiceCounters(NKikimr::AppData()->Counters, "utils")
NMonitoring::THistogramPtr ResponseTimeHgram = NKikimr::GetServiceCounters(NKikimr::AppData()->Counters,
ActorMonPage->MonServiceName)
->GetSubgroup("subsystem", "mon")
->GetSubgroup("url", url)
->GetSubgroup("status", status)
Expand Down Expand Up @@ -870,7 +871,8 @@ NMonitoring::IMonPage* TAsyncHttpMon::RegisterActorPage(TRegisterActorPageFields
fields.ActorSystem,
fields.ActorId,
fields.AllowedSIDs ? fields.AllowedSIDs : Config.AllowedSIDs,
fields.UseAuth ? Config.Authorizer : TRequestAuthorizer());
fields.UseAuth ? Config.Authorizer : TRequestAuthorizer(),
fields.MonServiceName);
if (fields.Index) {
fields.Index->Register(page);
if (fields.SortPages) {
Expand Down
1 change: 1 addition & 0 deletions ydb/core/mon/mon.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class TMon {
bool UseAuth = true;
TVector<TString> AllowedSIDs;
bool SortPages = true;
TString MonServiceName = "utils";
};

virtual NMonitoring::IMonPage* RegisterActorPage(TRegisterActorPageFields fields) = 0;
Expand Down
4 changes: 3 additions & 1 deletion ydb/core/mon/mon_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,15 @@ class TActorMonPage: public IMonPage {
public:
TActorMonPage(const TString &path, const TString &title, const TString &host, bool preTag,
TActorSystem *actorSystem, const TActorId &actorId, const TVector<TString> &sids,
TMon::TRequestAuthorizer authorizer)
TMon::TRequestAuthorizer authorizer, TString monServiceName = "utils")
: IMonPage(path, title)
, Host(host)
, PreTag(preTag)
, ActorSystem(actorSystem)
, TargetActorId(actorId)
, AllowedSIDs(sids)
, Authorizer(std::move(authorizer))
, MonServiceName(monServiceName)
{
}

Expand Down Expand Up @@ -405,6 +406,7 @@ class TActorMonPage: public IMonPage {
TActorId TargetActorId;
const TVector<TString> AllowedSIDs;
TMon::TRequestAuthorizer Authorizer;
TString MonServiceName;
};

inline TString GetPageFullPath(const NMonitoring::IMonPage* page) {
Expand Down
3 changes: 2 additions & 1 deletion ydb/core/mon/sync_http_mon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ namespace NActors {
fields.ActorSystem,
fields.ActorId,
fields.AllowedSIDs ? fields.AllowedSIDs : Config.AllowedSIDs,
fields.UseAuth ? Config.Authorizer : TRequestAuthorizer());
fields.UseAuth ? Config.Authorizer : TRequestAuthorizer(),
fields.MonServiceName);
if (fields.Index) {
fields.Index->Register(page);
if (fields.SortPages) {
Expand Down
1 change: 1 addition & 0 deletions ydb/deploy/helm/ydb-prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ ydb:
format: prometheus
tenant: "{{ .target.path }}"
skipNameRelabeling: true
- counter: dsproxy_mon

# Cluster which will be monitored
clusters: []
Expand Down

0 comments on commit a1a4409

Please sign in to comment.