diff options
| author | maybenotilya <[email protected]> | 2026-06-01 23:17:46 +0300 |
|---|---|---|
| committer | maybenotilya <[email protected]> | 2026-06-01 23:58:11 +0300 |
| commit | 25d27b87739eaf7a6254d961b62d5daa16ab44bf (patch) | |
| tree | 7b8d662b0cebdc32c75d14b4290e665ed0ffb91f /yt/cpp/mapreduce/client/file_reader.cpp | |
| parent | d1f86ecda9fdcf55e00df8d6d22ea39ac3f1edb0 (diff) | |
YT-27835: Add tracing for readers and writers
* Changelog entry
Type: fix
Component: cpp-sdk
Trace readers and writers with same trace_id
commit_hash:89a881e5bf608ca03821f248ef784f5f4771f532
Diffstat (limited to 'yt/cpp/mapreduce/client/file_reader.cpp')
| -rw-r--r-- | yt/cpp/mapreduce/client/file_reader.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/yt/cpp/mapreduce/client/file_reader.cpp b/yt/cpp/mapreduce/client/file_reader.cpp index ffdd2c9ac30..e96a06b5602 100644 --- a/yt/cpp/mapreduce/client/file_reader.cpp +++ b/yt/cpp/mapreduce/client/file_reader.cpp @@ -6,6 +6,7 @@ #include <yt/cpp/mapreduce/common/helpers.h> #include <yt/cpp/mapreduce/common/retry_lib.h> #include <yt/cpp/mapreduce/common/retry_request.h> +#include <yt/cpp/mapreduce/common/trace_context.h> #include <yt/cpp/mapreduce/common/wait_proxy.h> #include <yt/cpp/mapreduce/interface/config.h> @@ -41,14 +42,19 @@ TStreamReaderBase::TStreamReaderBase( const TTransactionId& transactionId) : RawClient_(rawClient) , ClientRetryPolicy_(std::move(clientRetryPolicy)) - , ReadTransaction_(std::make_unique<TPingableTransaction>( + , ReadTransaction_() + , TraceContext_(NTracing::CreateTraceContext("TStreamReaderBase", context.Config)) +{ + NTracing::TCurrentTraceContextGuard guard(TraceContext_->Ptr); + + ReadTransaction_ = std::make_unique<TPingableTransaction>( RawClient_, ClientRetryPolicy_, context, transactionId, transactionPinger->GetChildTxPinger(), - TStartTransactionOptions())) -{ } + TStartTransactionOptions()); +} void TStreamReaderBase::Abort() { @@ -64,11 +70,15 @@ TStreamReaderBase::~TStreamReaderBase() = default; TYPath TStreamReaderBase::Snapshot(const TYPath& path) { + NTracing::TCurrentTraceContextGuard guard(TraceContext_->Ptr); + return NYT::Snapshot(RawClient_, ClientRetryPolicy_, ReadTransaction_->GetId(), path); } size_t TStreamReaderBase::DoRead(void* buf, size_t len) { + NTracing::TCurrentTraceContextGuard guard(TraceContext_->Ptr); + if (len == 0) { return 0; } |
