Skip to content

Commit 3986e8b

Browse files
Use TraceId from TEvProposeTransaction (#29003)
1 parent c05e419 commit 3986e8b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

ydb/core/persqueue/pqtablet/common/tracing_support.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66
namespace NKikimr::NPQ {
77

8-
NWilson::TSpan GenerateSpan(const TStringBuf name, NJaegerTracing::TSamplingThrottlingControl& tracingControl)
8+
NWilson::TSpan GenerateSpan(const TStringBuf name, NJaegerTracing::TSamplingThrottlingControl& tracingControl, NWilson::TTraceId&& traceId)
99
{
1010
NJaegerTracing::TRequestDiscriminator discriminator;
1111
discriminator.RequestType = NJaegerTracing::ERequestType::TOPIC_PROPOSE_TRANSACTION;
1212
discriminator.Database = {};
1313

14-
NWilson::TTraceId traceId = tracingControl.HandleTracing(discriminator, {});
14+
if (!traceId) {
15+
traceId = tracingControl.HandleTracing(discriminator, {});
16+
}
1517

1618
if (traceId) {
1719
return {TWilsonTopic::TopicTopLevel, std::move(traceId), TString(name), NWilson::EFlags::AUTO_END};

ydb/core/persqueue/pqtablet/common/tracing_support.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace NKikimr::NPQ {
88

9-
NWilson::TSpan GenerateSpan(const TStringBuf name, NJaegerTracing::TSamplingThrottlingControl& tracingControl);
9+
NWilson::TSpan GenerateSpan(const TStringBuf name, NJaegerTracing::TSamplingThrottlingControl& tracingControl, NWilson::TTraceId&& traceId);
1010
NWilson::TSpan GenerateSpan(const TStringBuf name, ui8 verbosity);
1111

1212
}

ydb/core/persqueue/pqtablet/pq_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3122,7 +3122,7 @@ void TPersQueue::Handle(TEvPersQueue::TEvProposeTransaction::TPtr& ev, const TAc
31223122
const NKikimrPQ::TEvProposeTransaction& event = ev->Get()->GetRecord();
31233123
PQ_LOG_TX_D("Handle TEvPersQueue::TEvProposeTransaction " << event.ShortDebugString());
31243124

3125-
auto span = GenerateSpan("Topic.Transaction", *SamplingControl);
3125+
auto span = GenerateSpan("Topic.Transaction", *SamplingControl, std::move(ev->TraceId));
31263126
span.Attribute("TxId", static_cast<i64>(event.GetTxId()));
31273127
span.Attribute("TabletId", static_cast<i64>(TabletID()));
31283128

0 commit comments

Comments
 (0)