Skip to content

Commit

Permalink
Merge pull request #3154 from cloudflare/jsnell/implement-streaming-t…
Browse files Browse the repository at this point in the history
…ail-types
  • Loading branch information
jasnell authored Dec 6, 2024
2 parents 75bef94 + 069b981 commit 03ea5e3
Show file tree
Hide file tree
Showing 9 changed files with 1,963 additions and 132 deletions.
4 changes: 4 additions & 0 deletions src/workerd/api/trace.c++
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ kj::Maybe<TraceItem::EventInfo> getTraceEvent(jsg::Lock& js, const Trace& trace)
}
KJ_UNREACHABLE;
}
KJ_CASE_ONEOF(resume, tracing::Resume) {
// Resume events are not used with legacy trace
KJ_UNREACHABLE;
}
KJ_CASE_ONEOF(custom, tracing::CustomEventInfo) {
return kj::Maybe(jsg::alloc<TraceItem::CustomEventInfo>(trace, custom));
}
Expand Down
2 changes: 1 addition & 1 deletion src/workerd/io/io-context.c++
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ IoContext::IncomingRequest::IoContext_IncomingRequest(kj::Own<IoContext> context
kj::Own<IoChannelFactory> ioChannelFactoryParam,
kj::Own<RequestObserver> metricsParam,
kj::Maybe<kj::Own<WorkerTracer>> workerTracer,
kj::Rc<tracing::InvocationSpanContext> invocationSpanContext)
tracing::InvocationSpanContext invocationSpanContext)
: context(kj::mv(contextParam)),
metrics(kj::mv(metricsParam)),
workerTracer(kj::mv(workerTracer)),
Expand Down
6 changes: 3 additions & 3 deletions src/workerd/io/io-context.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class IoContext_IncomingRequest final {
kj::Own<IoChannelFactory> ioChannelFactory,
kj::Own<RequestObserver> metrics,
kj::Maybe<kj::Own<WorkerTracer>> workerTracer,
kj::Rc<tracing::InvocationSpanContext> invocationSpanContext);
tracing::InvocationSpanContext invocationSpanContext);
KJ_DISALLOW_COPY_AND_MOVE(IoContext_IncomingRequest);
~IoContext_IncomingRequest() noexcept(false);

Expand Down Expand Up @@ -163,7 +163,7 @@ class IoContext_IncomingRequest final {

// The invocation span context is a unique identifier for a specific
// worker invocation.
kj::Rc<tracing::InvocationSpanContext>& getInvocationSpanContext() {
tracing::InvocationSpanContext& getInvocationSpanContext() {
return invocationSpanContext;
}

Expand All @@ -176,7 +176,7 @@ class IoContext_IncomingRequest final {
// The invocation span context identifies the trace id, invocation id, and root
// span for the current request. Every invocation of a worker function always
// has a root span, even if it is not explicitly traced.
kj::Rc<tracing::InvocationSpanContext> invocationSpanContext;
tracing::InvocationSpanContext invocationSpanContext;

bool wasDelivered = false;

Expand Down
Loading

0 comments on commit 03ea5e3

Please sign in to comment.