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 /library | |
parent | 209fdadc6ff1cc9613c70e5e4ab328592ae304fa (diff) | |
download | ydb-bb8c46e49183081b19bf22eb2163479b44ee05d0.tar.gz |
Specify service.name for tracing
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/actors/wilson/wilson_uploader.cpp | 11 | ||||
-rw-r--r-- | library/cpp/actors/wilson/wilson_uploader.h | 2 |
2 files changed, 9 insertions, 4 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 |