diff options
author | a-sumin <a-sumin@yandex-team.com> | 2023-06-22 20:30:31 +0300 |
---|---|---|
committer | a-sumin <a-sumin@yandex-team.com> | 2023-06-22 20:30:31 +0300 |
commit | bb8c46e49183081b19bf22eb2163479b44ee05d0 (patch) | |
tree | eeeba49e6bf4d6a292b1fd03b537d738d6573b8e | |
parent | 209fdadc6ff1cc9613c70e5e4ab328592ae304fa (diff) | |
download | ydb-bb8c46e49183081b19bf22eb2163479b44ee05d0.tar.gz |
Specify service.name for tracing
-rw-r--r-- | library/cpp/actors/wilson/wilson_uploader.cpp | 11 | ||||
-rw-r--r-- | library/cpp/actors/wilson/wilson_uploader.h | 2 | ||||
-rw-r--r-- | ydb/core/driver_lib/run/kikimr_services_initializers.cpp | 6 | ||||
-rw-r--r-- | ydb/core/protos/config.proto | 1 |
4 files changed, 14 insertions, 6 deletions
diff --git a/library/cpp/actors/wilson/wilson_uploader.cpp b/library/cpp/actors/wilson/wilson_uploader.cpp index 3e47a8a315..3a08eb4205 100644 --- a/library/cpp/actors/wilson/wilson_uploader.cpp +++ b/library/cpp/actors/wilson/wilson_uploader.cpp @@ -24,6 +24,7 @@ namespace NWilson { TString Host; ui16 Port; TString RootCA; + TString ServiceName; std::shared_ptr<grpc::Channel> Channel; std::unique_ptr<NServiceProto::TraceService::Stub> Stub; @@ -50,10 +51,11 @@ namespace NWilson { bool WakeupScheduled = false; public: - TWilsonUploader(TString host, ui16 port, TString rootCA) + TWilsonUploader(TString host, ui16 port, TString rootCA, TString serviceName) : Host(std::move(host)) , Port(std::move(port)) , RootCA(std::move(rootCA)) + , ServiceName(std::move(serviceName)) {} ~TWilsonUploader() { @@ -116,6 +118,9 @@ namespace NWilson { NServiceProto::ExportTraceServiceRequest request; auto *rspan = request.add_resource_spans(); + auto *serviceNameAttr = rspan->mutable_resource()->add_attributes(); + serviceNameAttr->set_key("service.name"); + serviceNameAttr->mutable_value()->set_string_value(ServiceName); auto *sspan = rspan->add_scope_spans(); NextSendTimestamp = now; @@ -181,8 +186,8 @@ namespace NWilson { } // anonymous - IActor *CreateWilsonUploader(TString host, ui16 port, TString rootCA) { - return new TWilsonUploader(std::move(host), port, std::move(rootCA)); + IActor *CreateWilsonUploader(TString host, ui16 port, TString rootCA, TString serviceName) { + return new TWilsonUploader(std::move(host), port, std::move(rootCA), std::move(serviceName)); } } // NWilson diff --git a/library/cpp/actors/wilson/wilson_uploader.h b/library/cpp/actors/wilson/wilson_uploader.h index b6a65aadd7..bc02fc1aaa 100644 --- a/library/cpp/actors/wilson/wilson_uploader.h +++ b/library/cpp/actors/wilson/wilson_uploader.h @@ -19,6 +19,6 @@ namespace NWilson { return NActors::TActorId(0, TStringBuf("WilsonUpload", 12)); } - NActors::IActor *CreateWilsonUploader(TString host, ui16 port, TString rootCA); + NActors::IActor *CreateWilsonUploader(TString host, ui16 port, TString rootCA, TString serviceName); } // NWilson diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp index b5c2944af0..91b339aa37 100644 --- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp +++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp @@ -1167,8 +1167,10 @@ void TBasicServicesInitializer::InitializeServices(NActors::TActorSystemSetup* s if (Config.HasTracingConfig()) { const auto& tracing = Config.GetTracingConfig(); - setup->LocalServices.emplace_back(NWilson::MakeWilsonUploaderId(), TActorSetupCmd(NWilson::CreateWilsonUploader( - tracing.GetHost(), tracing.GetPort(), tracing.GetRootCA()), TMailboxType::ReadAsFilled, appData->BatchPoolId)); + setup->LocalServices.emplace_back( + NWilson::MakeWilsonUploaderId(), + TActorSetupCmd(NWilson::CreateWilsonUploader(tracing.GetHost(), tracing.GetPort(), tracing.GetRootCA(), tracing.GetServiceName()), + TMailboxType::ReadAsFilled, appData->BatchPoolId)); } } diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index c036d3de57..3c3fa68ae5 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1742,6 +1742,7 @@ message TTracingConfig { optional string Host = 1; optional uint32 Port = 2; optional string RootCA = 3; + optional string ServiceName = 4; } message TFailureInjectionConfig { |