Skip to content

refactor: add the framework-independent telemetry engine - #48

Merged
fateeand merged 11 commits into
mainfrom
split/4-engine
Nov 13, 2026
Merged

fateeand merged 11 commits into
mainfrom
split/4-engine

Conversation

@fateeand

@fateeand fateeand commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part 4 of 8 of the split of #34. This is new code, not a move: the framework-independent telemetry engine, and the Angular services rewired to delegate to it.

Changes

  • uwtCreateTelemetry(options) returns an engine with scenarios, bi, logging, setUserId, flush and an idempotent dispose(). A missing application, environment, version, destination or log store throws when the engine is created; everything after that fails open.
  • Browser features are opt-in through document. Nothing touches window or document on import, and there is no global engine state.
  • onSettled(listener) replaces the Observable inside the core, so its main entry needs no RxJS. The Angular settled$ listens only while it has subscribers, so no record is copied when nobody reads it.
  • dispose() stops watching the page, settles in-flight scenarios as abandoned, and flushes. Scenarios, BI events and logs started afterwards work as before.
  • The Angular logger, BI and scenario services each wrap the matching engine concern.
  • The /rxjs entry (traceScenario; rxjs is an optional peer), and the no-op sink and log API.

How to review

This is the part to read closely: src/lib/engine/, then the services under ngx-ui-watchtower/src/lib/services/.

Closes #40

Part 4 of 8 of the epic #35. Stack on GitHub, merged bottom first:

  1. test: add API, type and wire-protocol safety nets #45 Safety nets
  2. build: add the framework-independent core package #46 Scaffold the core
  3. refactor: move models, redaction and scenarios into the core #47 Move models, redaction and scenarios
  4. refactor: add the framework-independent telemetry engine #48 Telemetry engine (this PR)
  5. refactor: move the shell/fragment broadcast protocol into the core #49 Broadcast protocol
  6. refactor: move the AWS RUM sink into the core's rum entry point #50 RUM sink
  7. test: smoke-test the packed packages in real consumers #51 Smoke tests
  8. feat: release and publish both packages independently, with docs and logos #52 Release, docs and logos

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements
95.56% (-0.38% 🔻)
731/765
🟢 Branches
94.03% (-0.71% 🔻)
378/402
🟢 Functions
96.5% (+0.41% 🔼)
193/200
🟢 Lines
96.15% (-0.27% 🔻)
700/728
Show files with reduced coverage 🔻
St.❔
File Statements Branches Functions Lines
🟢
... / uwt-telemetry-common.providers.ts
98.08% (-0.04% 🔻)
96% (-0.77% 🔻)
100%
98.04% (-0.04% 🔻)
🟢
... / uwt-telemetry-safe.util.ts
100%
83.33% (-16.67% 🔻)
100% 100%

Test suite run success

564 tests passing in 13 suites.

Report generated by 🧪jest coverage report action from 70e0bcc

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Core coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements 99.37% 786/791
🟢 Branches 94.32% 432/458
🟢 Functions 98.95% 189/191
🟢 Lines 99.49% 775/779

Test suite run success

299 tests passing in 18 suites.

Report generated by 🧪jest coverage report action from 70e0bcc

Base automatically changed from split/3-models to main November 13, 2026 14:42
@fateeand
fateeand merged commit 93bc34c into main Nov 13, 2026
9 checks passed
@fateeand
fateeand deleted the split/4-engine branch November 13, 2026 15:29
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.

Add the framework-independent telemetry engine

2 participants