Skip to content

Commit 62d6d47

Browse files
Update grpc_client_low.h
1 parent e902e8a commit 62d6d47

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/library/grpc/client/grpc_client_low.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ struct TCallMeta {
200200
std::shared_ptr<grpc::CallCredentials> CallCredentials;
201201
std::vector<std::pair<std::string, std::string>> Aux;
202202
std::variant<TDuration, TInstant> Timeout; // timeout as duration from now or time point in future
203+
std::string TraceParent; // Поле для трассировки
203204
};
204205

205206
class TGRpcRequestProcessorCommon {
@@ -208,6 +209,12 @@ class TGRpcRequestProcessorCommon {
208209
for (const auto& rec : meta.Aux) {
209210
Context.AddMetadata(NYdb::TStringType{rec.first}, NYdb::TStringType{rec.second});
210211
}
212+
213+
// Добавление traceparent в заголовки gRPC
214+
if (!meta.TraceParent.empty()) {
215+
Context.AddMetadata("traceparent", NYdb::TStringType{*meta.TraceParent});
216+
}
217+
211218
if (meta.CallCredentials) {
212219
Context.set_credentials(meta.CallCredentials);
213220
}

0 commit comments

Comments
 (0)