Skip to content

📈 Add telemetry metric for session manager init duration#4488

Merged
thomas-lebeau merged 1 commit intov7from
thomas.lebeau/session-manager-init-metrics
Apr 15, 2026
Merged

📈 Add telemetry metric for session manager init duration#4488
thomas-lebeau merged 1 commit intov7from
thomas.lebeau/session-manager-init-metrics

Conversation

@thomas-lebeau
Copy link
Copy Markdown
Collaborator

@thomas-lebeau thomas-lebeau commented Apr 15, 2026

Motivation

The session manager is now async. We want to measure how long initialization takes in the wild to understand its impact on SDK startup time.

Changes

  • Add a new SESSION_MANAGER_INIT_METRICS_TELEMETRY_NAME telemetry metric
  • Measure elapsed time from the start of startSessionManager() to successful initialization using relativeNow() (performance.now())
  • Metric is emitted for both RUM and Logs (since both call startSessionManager)
  • Only emitted on successful initialization (early returns for missing strategy, stopped thread, or revoked consent are skipped)
  • Includes a monitor-until: 2026-10-15 comment

Test instructions

  • Existing session manager unit tests pass (54/54)
  • Typecheck passes

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@thomas-lebeau thomas-lebeau requested a review from a team as a code owner April 15, 2026 10:46
@thomas-lebeau thomas-lebeau force-pushed the thomas.lebeau/session-manager-init-metrics branch from 3d67389 to d6dc8d1 Compare April 15, 2026 10:47
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Apr 15, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 168.22 KiB 168.31 KiB +98 B +0.06%
Rum Profiler 6.09 KiB 6.09 KiB 0 B 0.00%
Rum Recorder 27.10 KiB 27.10 KiB 0 B 0.00%
Logs 53.80 KiB 53.97 KiB +177 B +0.32%
Rum Slim 126.58 KiB 126.65 KiB +74 B +0.06%
Worker 22.99 KiB 22.99 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0163 0.0045 -72.39%
RUM - add action 0.0451 0.0172 -61.86%
RUM - add error 0.0554 0.0165 -70.22%
RUM - add timing 0.0083 0.003 -63.86%
RUM - start view 0.0588 0.0141 -76.02%
RUM - start/stop session replay recording 0.0023 0.0008 -65.22%
Logs - log message 0.0578 0.018 -68.86%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add action 64.32 KiB 64.50 KiB +178 B
RUM - add global context 38.44 KiB 37.79 KiB -667 B
RUM - add timing 42.09 KiB 41.51 KiB -592 B
RUM - add error 69.03 KiB 68.57 KiB -474 B
RUM - start/stop session replay recording 41.75 KiB 41.12 KiB -643 B
RUM - start view 477.81 KiB 476.46 KiB -1.35 KiB
Logs - log message 53.80 KiB 53.65 KiB -161 B

🔗 RealWorld

@datadog-prod-us1-6
Copy link
Copy Markdown

datadog-prod-us1-6 Bot commented Apr 15, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.51% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: d6dc8d1 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@thomas-lebeau thomas-lebeau merged commit b6a0f0e into v7 Apr 15, 2026
20 checks passed
@thomas-lebeau thomas-lebeau deleted the thomas.lebeau/session-manager-init-metrics branch April 15, 2026 13:32
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants