Skip to content

Commit a086775

Browse files
committed
Add tracing spans for output gate hold
1 parent 79f2afc commit a086775

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/workerd/io/io-gate.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class OutputGate {
271271
// If `promise` rejects, the exception will propagate to all future `wait()`s. If the returned
272272
// promise is canceled before completion, all future `wait()`s will also throw.
273273
template <typename T>
274-
kj::Promise<T> lockWhile(kj::Promise<T> promise);
274+
kj::Promise<T> lockWhile(kj::Promise<T> promise, SpanParent parentSpan = nullptr);
275275

276276
// Wait until all preceding locks are released. The wait will not be affected by any future
277277
// call to `lockWhile()`.
@@ -303,8 +303,9 @@ class OutputGate {
303303
// inline implementation details
304304

305305
template <typename T>
306-
kj::Promise<T> OutputGate::lockWhile(kj::Promise<T> promise) {
306+
kj::Promise<T> OutputGate::lockWhile(kj::Promise<T> promise, SpanParent parentSpan) {
307307
auto fulfiller = lock();
308+
SpanBuilder lockSpan = parentSpan.newChild("output_gate_lock_hold"_kjc);
308309

309310
if constexpr (std::is_void_v<T>) {
310311
promise = promise.exclusiveJoin(hooks.makeTimeoutPromise());

0 commit comments

Comments
 (0)