diff options
author | Oleg Shatov <olegsh@ydb.tech> | 2024-03-13 07:55:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 07:55:19 +0100 |
commit | 16094ade421c56b579eaf2491c6eafc2138371f8 (patch) | |
tree | 3ee7fe6c8418084cd960d9ae4396fcc2477eb7c1 | |
parent | 1db9855b9afed1e6758cb609a2468d29334acc2b (diff) | |
download | ydb-16094ade421c56b579eaf2491c6eafc2138371f8.tar.gz |
Discovery request check spans (#2641)
-rw-r--r-- | ydb/core/grpc_services/grpc_request_check_actor.h | 28 | ||||
-rw-r--r-- | ydb/core/grpc_services/rpc_discovery.cpp | 4 | ||||
-rw-r--r-- | ydb/library/wilson_ids/wilson.h | 1 |
3 files changed, 23 insertions, 10 deletions
diff --git a/ydb/core/grpc_services/grpc_request_check_actor.h b/ydb/core/grpc_services/grpc_request_check_actor.h index ba72cd08c2..f07babac91 100644 --- a/ydb/core/grpc_services/grpc_request_check_actor.h +++ b/ydb/core/grpc_services/grpc_request_check_actor.h @@ -17,6 +17,7 @@ #include <ydb/core/grpc_services/counters/proxy_counters.h> #include <ydb/core/security/secure_request.h> #include <ydb/core/tx/scheme_cache/scheme_cache.h> +#include <ydb/library/wilson_ids/wilson.h> #include <util/string/split.h> @@ -106,6 +107,7 @@ public: , GrpcRequestBaseCtx_(Request_->Get()) , SkipCheckConnectRigths_(skipCheckConnectRigths) , FacilityProvider_(facilityProvider) + , Span_(TWilsonGrpc::RequestCheckActor, GrpcRequestBaseCtx_->GetWilsonTraceId(), "RequestCheckActor") { TMaybe<TString> authToken = GrpcRequestBaseCtx_->GetYdbToken(); if (authToken) { @@ -240,7 +242,7 @@ public: void HandlePoison(TEvents::TEvPoisonPill::TPtr&) { GrpcRequestBaseCtx_->FinishSpan(); - TBase::PassAway(); + PassAway(); } ui64 GetChannelBufferSize() const override { @@ -253,6 +255,11 @@ public: return this->RegisterWithSameMailbox(actor); } + void PassAway() override { + Span_.EndOk(); + TBase::PassAway(); + } + private: static NYql::TIssues GetRlIssues(const Ydb::RateLimiter::AcquireResourceResponse& resp) { NYql::TIssues opIssues; @@ -390,39 +397,39 @@ private: GrpcRequestBaseCtx_->RaiseIssue(issue); GrpcRequestBaseCtx_->ReplyWithYdbStatus(Ydb::StatusIds::UNAUTHORIZED); GrpcRequestBaseCtx_->FinishSpan(); - TBase::PassAway(); + PassAway(); } void ReplyUnavailableAndDie(const NYql::TIssue& issue) { GrpcRequestBaseCtx_->RaiseIssue(issue); GrpcRequestBaseCtx_->ReplyWithYdbStatus(Ydb::StatusIds::UNAVAILABLE); GrpcRequestBaseCtx_->FinishSpan(); - TBase::PassAway(); + PassAway(); } void ReplyUnavailableAndDie(const NYql::TIssues& issue) { GrpcRequestBaseCtx_->RaiseIssues(issue); GrpcRequestBaseCtx_->ReplyWithYdbStatus(Ydb::StatusIds::UNAVAILABLE); GrpcRequestBaseCtx_->FinishSpan(); - TBase::PassAway(); + PassAway(); } void ReplyUnauthenticatedAndDie() { GrpcRequestBaseCtx_->ReplyUnauthenticated("Unknown database"); GrpcRequestBaseCtx_->FinishSpan(); - TBase::PassAway(); + PassAway(); } void ReplyOverloadedAndDie(const NYql::TIssue& issue) { GrpcRequestBaseCtx_->RaiseIssue(issue); GrpcRequestBaseCtx_->ReplyWithYdbStatus(Ydb::StatusIds::OVERLOADED); GrpcRequestBaseCtx_->FinishSpan(); - TBase::PassAway(); + PassAway(); } void Continue() { if (!ValidateAndReplyOnError(GrpcRequestBaseCtx_)) { - TBase::PassAway(); + PassAway(); return; } HandleAndDie(Request_); @@ -435,7 +442,7 @@ private: GrpcRequestBaseCtx_->FinishSpan(); event->Release().Release()->Pass(*this); - TBase::PassAway(); + PassAway(); } void HandleAndDie(TAutoPtr<TEventHandle<TEvListEndpointsRequest>>&) { @@ -451,13 +458,13 @@ private: void HandleAndDie(T& event) { GrpcRequestBaseCtx_->FinishSpan(); TGRpcRequestProxyHandleMethods::Handle(event, TlsActivationContext->AsActorContext()); - TBase::PassAway(); + PassAway(); } void ReplyBackAndDie() { GrpcRequestBaseCtx_->FinishSpan(); TlsActivationContext->Send(Request_->Forward(Owner_)); - TBase::PassAway(); + PassAway(); } std::pair<bool, std::optional<NYql::TIssue>> CheckConnectRight() { @@ -534,6 +541,7 @@ private: const IFacilityProvider* FacilityProvider_; bool DmlAuditEnabled_ = false; std::unordered_set<TString> DmlAuditExpectedSubjects_; + NWilson::TSpan Span_; }; // default behavior - attributes in schema diff --git a/ydb/core/grpc_services/rpc_discovery.cpp b/ydb/core/grpc_services/rpc_discovery.cpp index 2bc5cc74a4..84c26fe124 100644 --- a/ydb/core/grpc_services/rpc_discovery.cpp +++ b/ydb/core/grpc_services/rpc_discovery.cpp @@ -29,6 +29,8 @@ class TListEndpointsRPC : public TActorBootstrapped<TListEndpointsRPC> { THolder<TEvDiscovery::TEvDiscoveryData> LookupResponse; THolder<TEvInterconnect::TEvNodeInfo> NameserviceResponse; + NWilson::TSpan Span; + public: static constexpr NKikimrServices::TActivity::EType ActorActivityType() { return NKikimrServices::TActivity::GRPC_REQ; @@ -37,6 +39,7 @@ public: TListEndpointsRPC(TEvListEndpointsRequest::TPtr &msg, TActorId cacheId) : Request(msg->Release().Release()) , CacheId(cacheId) + , Span(TWilsonGrpc::RequestActor, Request->GetWilsonTraceId(), "ListEndpointsRpc") {} void Bootstrap() { @@ -54,6 +57,7 @@ public: if (Discoverer) { Send(Discoverer, new TEvents::TEvPoisonPill()); } + Span.EndOk(); TActorBootstrapped<TListEndpointsRPC>::PassAway(); } diff --git a/ydb/library/wilson_ids/wilson.h b/ydb/library/wilson_ids/wilson.h index b033abec9c..68eebebff6 100644 --- a/ydb/library/wilson_ids/wilson.h +++ b/ydb/library/wilson_ids/wilson.h @@ -89,6 +89,7 @@ namespace NKikimr { enum { RequestProxy = TComponentTracingLevels::TGrpcProxy::TopLevel, RequestActor = TComponentTracingLevels::TGrpcProxy::TopLevel, + RequestCheckActor = TComponentTracingLevels::TGrpcProxy::Basic, }; }; |