Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/workerd/io/tracer.c++
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ void WorkerTracer::addSpanClose(tracing::SpanEndData&& span, kj::Maybe<kj::Date>
}

void WorkerTracer::addSpanUpdate(tracing::SpanId spanId, tracing::SpanUpdate&& update) {
if (maybeTailStreamWriter == kj::none) {
return;
}
addSpanUpdateInternal(spanId, kj::mv(update), getTime());
}

void WorkerTracer::addSpanUpdateInternal(
tracing::SpanId spanId, tracing::SpanUpdate&& update, kj::Date timestamp) {
if (pipelineLogLevel == PipelineLogLevel::NONE) {
return;
}
Expand All @@ -285,7 +293,7 @@ void WorkerTracer::addSpanUpdate(tracing::SpanId spanId, tracing::SpanUpdate&& u
auto context = tracing::InvocationSpanContext(topLevelContext.getTraceId(),
topLevelContext.getInvocationId(), spanId, topLevelContext.getTraceFlags());
auto size = update.size();
tailStreamWriter->report(context, kj::mv(update), getTime(), size);
tailStreamWriter->report(context, kj::mv(update), timestamp, size);
}

void WorkerTracer::addException(const tracing::InvocationSpanContext& context,
Expand Down
3 changes: 3 additions & 0 deletions src/workerd/io/tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ class WorkerTracer final: public BaseTracer {
kj::Date startTime) override;
void addSpanClose(tracing::SpanEndData&& span, kj::Maybe<kj::Date> maybeStartTime) override;
void addSpanUpdate(tracing::SpanId spanId, tracing::SpanUpdate&& update) override;
// Variant for RPC-based tracing, where the caller supplies the timestamp from its IoContext.
void addSpanUpdateInternal(
tracing::SpanId spanId, tracing::SpanUpdate&& update, kj::Date timestamp);
void addSpanAttribute(const tracing::InvocationSpanContext& context,
kj::ConstString key,
tracing::Attribute::Value value) override;
Expand Down
Loading