Skip to content

⚗️ Track Server-Sent Events counts on RUM resources#4764

Draft
samcolmanetti wants to merge 1 commit into
mainfrom
sam.colmanetti/sse-resource-tracking
Draft

⚗️ Track Server-Sent Events counts on RUM resources#4764
samcolmanetti wants to merge 1 commit into
mainfrom
sam.colmanetti/sse-resource-tracking

Conversation

@samcolmanetti

@samcolmanetti samcolmanetti commented Jun 10, 2026

Copy link
Copy Markdown

Context

A text/event-stream fetch is opaque in RUM today: no visibility into how many events streamed, of which types, or when the stream went quiet. This adds a compact resource.sse object to the resource event, behind the sse_event_counts experimental flag. Wire-schema (rum-events-format) update is a tracked follow-up; ingestion already accepts the field.

Note: There's also work underway to support WebSockets (design doc). There may be room to consolidate both into a generalized "event stream" abstraction down the line. The key difference: SSE already appears in RUM as a normal Resource (type: fetch) and only lacks this metadata, whereas I don't believe WebSocket connections show up as RUM resources today.

Changes

  • Count fetch SSE events incrementally without retaining the body
  • Release page activity at headers; read stream in background
  • Deliver counts out of band, attach at resource assembly
  • Bound reads with byte and time caps
image

Test Plan

  • Unit: SSE parser + counter (LF/CRLF/bare-CR, chunk splits, caps, _other_, id truncation)
  • Unit: resource enrichment attaches out-of-band counts; request/resource specs pass
  • typecheck and lint clean
  • Manual: /sse dev endpoint yields resource.sse; SSE-triggered click closes without hitting the 10s max
  • Staging

@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 10, 2026

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 172.40 KiB 175.00 KiB +2.59 KiB +1.51%
Rum Profiler 7.88 KiB 7.88 KiB +1 B +0.01%
Rum Recorder 21.22 KiB 21.22 KiB 0 B 0.00%
Logs 54.82 KiB 56.99 KiB +2.17 KiB +3.97%
Rum Slim 130.14 KiB 132.63 KiB +2.49 KiB +1.91%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%

@samcolmanetti samcolmanetti changed the title ✨ Track Server-Sent Events counts on RUM resources Track Server-Sent Events counts on RUM resources Jun 10, 2026
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Jun 10, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

CLA Assistant | CLAAssistant   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 57.05%
Overall Coverage: 76.44% (-0.41%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: edb8637 | Docs | Datadog PR Page | Give us feedback!

@samcolmanetti samcolmanetti force-pushed the sam.colmanetti/sse-resource-tracking branch from 6be3829 to 68a37e2 Compare June 10, 2026 20:42
@samcolmanetti samcolmanetti changed the title Track Server-Sent Events counts on RUM resources ⚗️ Track Server-Sent Events counts on RUM resources Jun 10, 2026
@samcolmanetti samcolmanetti force-pushed the sam.colmanetti/sse-resource-tracking branch from 68a37e2 to f856fe8 Compare June 10, 2026 20:48
@samcolmanetti samcolmanetti force-pushed the sam.colmanetti/sse-resource-tracking branch from f856fe8 to edb8637 Compare June 10, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant