Skip to content

Commit

Permalink
Extra sensors and logs (ydb-platform#3107)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hor911 committed Mar 25, 2024
1 parent 9c73319 commit 9749618
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class TComputeDatabaseMonitoringActor : public NActors::TActorBootstrapped<TComp
::NMonitoring::TDynamicCounters::TCounterPtr InstantLoadPercentage;
::NMonitoring::TDynamicCounters::TCounterPtr AverageLoadPercentage;
::NMonitoring::TDynamicCounters::TCounterPtr QuotedLoadPercentage;
::NMonitoring::TDynamicCounters::TCounterPtr AvailableLoadPercentage;
::NMonitoring::TDynamicCounters::TCounterPtr TargetLoadPercentage;
::NMonitoring::TDynamicCounters::TCounterPtr PendingQueueSize;
::NMonitoring::TDynamicCounters::TCounterPtr PendingQueueOverload;

Expand All @@ -51,6 +53,8 @@ class TComputeDatabaseMonitoringActor : public NActors::TActorBootstrapped<TComp
InstantLoadPercentage = subComponent->GetCounter("InstantLoadPercentage", false);
AverageLoadPercentage = subComponent->GetCounter("AverageLoadPercentage", false);
QuotedLoadPercentage = subComponent->GetCounter("QuotedLoadPercentage", false);
AvailableLoadPercentage = subComponent->GetCounter("AvailableLoadPercentage", false);
TargetLoadPercentage = subComponent->GetCounter("TargetLoadPercentage", false);
PendingQueueSize = subComponent->GetCounter("PendingQueueSize", false);
PendingQueueOverload = subComponent->GetCounter("PendingQueueOverload", true);
}
Expand Down Expand Up @@ -78,7 +82,10 @@ class TComputeDatabaseMonitoringActor : public NActors::TActorBootstrapped<TComp
, PendingQueueSize(config.GetPendingQueueSize())
, Strict(config.GetStrict())
, CpuNumber(config.GetCpuNumber())
{}
{
*Counters.AvailableLoadPercentage = 100;
*Counters.TargetLoadPercentage = static_cast<ui64>(MaxClusterLoad * 100);
}

static constexpr char ActorName[] = "FQ_COMPUTE_DATABASE_MONITORING_ACTOR";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include <ydb/core/fq/libs/compute/ydb/events/events.h>
#include <ydb/library/services/services.pb.h>

#include <ydb/library/security/ydb_credentials_provider_factory.h>

#include <ydb/library/actors/core/actor.h>
#include <ydb/library/actors/core/event.h>
#include <ydb/library/actors/core/hfunc.h>
#include <ydb/library/actors/core/log.h>

#include <ydb/library/actors/http/http_proxy.h>

#include <ydb/library/security/util.h>
#include <ydb/library/security/ydb_credentials_provider_factory.h>
#include <ydb/library/services/services.pb.h>

#include <ydb/library/yql/utils/actors/http_sender.h>
#include <ydb/library/yql/utils/actors/http_sender_actor.h>
#include <ydb/library/yql/utils/url_builder.h>
Expand Down Expand Up @@ -55,8 +55,9 @@ class TMonitoringRestServiceActor : public NActors::TActor<TMonitoringRestServic
.AddUrlParam("path", Database)
.Build()
);
LOG_D(httpRequest->GetRawData());
httpRequest->Set("Authorization", CredentialsProvider->GetAuthInfo());
auto ticket = CredentialsProvider->GetAuthInfo();
LOG_D(httpRequest->GetRawData() << " using ticket " << NKikimr::MaskTicket(ticket));
httpRequest->Set("Authorization", ticket);

auto httpSenderId = Register(NYql::NDq::CreateHttpSenderActor(SelfId(), HttpProxyId, NYql::NDq::THttpSenderRetryPolicy::GetNoRetryPolicy()));
Send(httpSenderId, new NHttp::TEvHttpProxy::TEvHttpOutgoingRequest(httpRequest), 0, Cookie);
Expand Down

0 comments on commit 9749618

Please sign in to comment.