Skip to content

Commit 2817a54

Browse files
committed
fix(webapp): record real payload size on the trigger span
When a payload is offloaded to object storage the trigger span only saw the small application/store reference, so its size attribute measured the reference, not the payload. Prefer the caller-reported pre-offload size when present so the span reflects the real payload size. Inline payloads are unchanged.
1 parent 3ff70ab commit 2817a54

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Record the real pre-offload payload size on the trigger span, even when the payload was offloaded to object storage, so payload size is observable without fetching the reference.

apps/webapp/app/runEngine/concerns/payloads.server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ export class DefaultPayloadProcessor implements PayloadProcessor {
2424
);
2525

2626
span.setAttribute("needsOffloading", needsOffloading);
27-
span.setAttribute("size", size);
27+
// When the caller already offloaded the payload (payloadType "application/store"), the
28+
// packet here is just the small object-store reference, so `size` measures the reference,
29+
// not the payload. Prefer the caller-reported pre-offload size when it's provided so the
30+
// span reflects the real payload size. For inline payloads the two agree.
31+
span.setAttribute("size", request.body.options?.payloadSize ?? size);
2832

2933
if (!needsOffloading) {
3034
return packet;

0 commit comments

Comments
 (0)