Skip to content

Commit

Permalink
Conditional on context.isSampled in Span operator=().
Browse files Browse the repository at this point in the history
In operator= overload we need to check if the current span which is being
overwritten is eligble for serialization. If so we must send to the tracer
via the g_tracer->trace(*this) call. Previously we were incorrectly checking
the function argument o's context for sampling. This resulted in loss traces
for the NAPI:readVersionBatcher spans.
  • Loading branch information
sfc-gh-rjenkins authored and sfc-gh-ljoswiak committed Jul 14, 2022
1 parent 7e3e79c commit bdef353
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fdbclient/Tracing.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void openTracer(TracerType type) {
ITracer::~ITracer() {}

Span& Span::operator=(Span&& o) {
if (begin > 0.0 && o.context.isSampled() > 0) {
if (begin > 0.0 && context.isSampled()) {
end = g_network->now();
g_tracer->trace(*this);
}
Expand Down

0 comments on commit bdef353

Please sign in to comment.