Skip to content

fix(laminar): bound diagnostic span and export memory - #164

Merged
sarath-menon merged 3 commits into
browser-use:mainfrom
sarath-menon:telemetry-memory-red
Sep 24, 2026
Merged

sarath-menon merged 3 commits into
browser-use:mainfrom
sarath-menon:telemetry-memory-red

Conversation

@sarath-menon

@sarath-menon sarath-menon commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Large diagnostic strings and count-only queues let tracing consume excessive worker and control-plane memory. This bounds diagnostic text to 16 KiB, encoded records to 64 KiB, uploads to 1 MiB, and pending diagnostics to 4 MiB or 512 records, preserving original task input and marking truncation. Verification: 14 tests and the configured monorepo typecheck pass, covering UTF-8 bounds, identity and usage preservation, queue recovery, real HTTP 413 without retry, and an attribute-key collision reproduced red then fixed green (evidence). Release this sender and update the Cloud worker pin before deploying the receiver change; older in-flight workers and chunked connection-reset behavior still need compatibility verification. Sender tests also verify timeout recovery, schema preservation, and near-limit encoded uploads; staging deployment follows the released worker pin.


Summary by cubic

Bounds tracing memory usage so large diagnostic strings and stalled exporters can no longer exhaust worker and control-plane memory.

  • Caps diagnostic text at 16 KiB, per-record encoding at 64 KiB, uploads at 1 MiB, and queued diagnostics at 4 MiB or 512 records.
  • Marks truncated spans with bcode.telemetry.truncated while preserving the original task input.
  • Drops over-budget spans instead of queuing them; the queue drains normally once the exporter resumes.
  • Releases the export budget when an export times out, and ignores late exporter callbacks so a batch can never be double-counted.
  • Adds @opentelemetry/otlp-transformer and @opentelemetry/resources and reduces the export timeout from 30 s to 10 s.

Draft with local synthetic test evidence only; nothing deployed. Requires the Cloud worker pin to be updated before deploying the companion receiver change.

Written for commit 12a406f. Summary will update on new commits.

Review in cubic

@sarath-menon
sarath-menon marked this pull request as ready for review September 24, 2026 15:21

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Re-trigger cubic

Comment thread packages/bcode-laminar/src/processor.ts
Comment thread packages/bcode-laminar/package.json Outdated
Comment thread packages/bcode-laminar/test/budget-safety.test.ts
Comment thread packages/bcode-laminar/src/budget.ts Outdated
Comment thread packages/bcode-laminar/src/budget.ts
Comment thread packages/bcode-laminar/test/memory-budget.test.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Fix all with cubic | Re-trigger cubic

Comment thread packages/bcode-laminar/test/budget-safety.test.ts
@sarath-menon
sarath-menon merged commit b2f8e65 into browser-use:main Sep 24, 2026
3 checks passed
@sarath-menon

Copy link
Copy Markdown
Collaborator Author

Verified in shared staging after merging BrowserCode #164 and Cloud #6142, #6143, #6140.

Limits: the local memory benchmark is not a staging RSS measurement; these checks do not establish that every historical OOM cause is eliminated. Production transport, mixed-version rollout, and production memory behavior still need release monitoring. No production deployment or manual AWS changes were made.

@sarath-menon sarath-menon added tested Verification completed tested-in-staging Verified in shared staging with recorded evidence labels Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tested Verification completed tested-in-staging Verified in shared staging with recorded evidence

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant