Skip to content

✨ [RUM-14241] Implement Assembly with Hooks system#11

Merged
bcaudan merged 8 commits into
mainfrom
bcaudan/assembly
Feb 20, 2026
Merged

✨ [RUM-14241] Implement Assembly with Hooks system#11
bcaudan merged 8 commits into
mainfrom
bcaudan/assembly

Conversation

@bcaudan

@bcaudan bcaudan commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Allow domain components to declare which data they add to which event format:

this.hooks.registerRum(() => ({
  domain: { attribute: my_value },
}));

this.hooks.registerTelemetry(() => ({
  domain_attribute: my_value,
}));

Changes

  • Introduce EventFormat with rum and telmetry (logs and spans will be added later)
  • Adapt browser-core hooks to support more than main and telemetry format types
  • Extract common event properties to CommonContext
  • Use hooks to generate Server events from Raw events with dummy view and telemetry errors
  • Extract types for RawData to improve typings

Test instructions

no functional changes, CI should pass

Checklist

  • Tested locally (playground)
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@datadog-official

datadog-official Bot commented Feb 13, 2026

Copy link
Copy Markdown

✅ Code Quality    ✅ Code Vulnerabilities    ✅ Library Vulnerabilities

🎉 All green!

🛠️ No new code quality issues
🛡️ No new code vulnerabilities
📚 No new vulnerable libraries detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5d2362f | Docs | Datadog PR Page | Was this helpful? Give us feedback!

Comment thread src/domain/hooks/hooks.ts Outdated
Comment thread src/index.ts
Comment thread src/index.ts
Comment thread src/domain/hooks/hooks.spec.ts Outdated
Comment thread src/index.ts
Comment thread src/index.ts
Base automatically changed from bcaudan/sdk-telemetry to main February 16, 2026 15:20
Comment thread scripts/generate-schema-types.ts Outdated
Comment thread scripts/generate-schema-types.ts Outdated
Comment thread src/config.ts Outdated
Comment thread scripts/generate-schema-types.ts Outdated
Comment thread e2e/lib/helpers.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Comment thread src/domain/telemetry/telemetryEvent.types.ts
Assembly will depend on the data format: rum, telemetry, logs, spans
Similar to browser-core but without the HookNames constraints to allow to add specific hooks for spans and logs later
@bcaudan bcaudan marked this pull request as ready for review February 16, 2026 17:03
@bcaudan bcaudan requested a review from cdn34dd as a code owner February 16, 2026 17:03

@cdn34dd cdn34dd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The PR is well structured, seems good to merge, I would make one change though. I don't think hooks and commonContext belong inside domain. I think of domain as a place for product features, things like Rum, Logs, Traces, Session Replay, etc.

Hooks, Assembly, commonContext I think should place outside as these are part of the event pipeline but not a feature.

regroup assembly / hooks / common context
@bcaudan bcaudan merged commit 7764d64 into main Feb 20, 2026
10 checks passed
@bcaudan bcaudan deleted the bcaudan/assembly branch February 20, 2026 09:44
@bcaudan bcaudan mentioned this pull request Mar 26, 2026
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.

2 participants