-
Notifications
You must be signed in to change notification settings - Fork 166
⚗️[MFE] Source code context event enrichment #3926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage 🔗 Commit SHA: 31e5ac1 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
943c7a2 to
55969dd
Compare
2ced5e0 to
0e9289e
Compare
packages/rum-core/src/domain/contexts/sourceCodeContext.spec.ts
Outdated
Show resolved
Hide resolved
| type DeepReadonly<T> = { | ||
| readonly [K in keyof T]: DeepReadonly<T[K]> | ||
| } | ||
|
|
||
| export interface AssembleHookParams { | ||
| readonly eventType: RumEvent['type'] | ||
| rawRumEvent: DeepReadonly<RawRumEvent> | ||
| domainContext: DeepReadonly<RumEventDomainContext<RawRumEvent['type']>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ question: What is the intent with the DeepReadonly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh ok, what about adding a comment with the code to make the intent more explicit?
| import type { BrowserWindow } from './sourceCodeContext' | ||
| import { startSourceCodeContext } from './sourceCodeContext' | ||
|
|
||
| describe('sourceCodeContext', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 suggestion: It could be interesting to add e2e tests for this feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
14cfe74 to
4736888
Compare
bcaudan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| }, | ||
| } | ||
|
|
||
| // because the evaluation the script in a different context than the page, resulting in unexpected stack traces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 suggestion: unclear to me what information we want to convey here and how it relates to create body 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it’s a copy-paste from here. It means we use createBody instead of page.evaluate() because page.evaluate() messes up the stack trace and drops the URL. I’ll improve the comments.
BeltranBulbarellaDD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!

Motivation
In the context of micro frontend support, we add the ability to enrich events with source code context (service and version) from window.DD_SOURCE_CODE_CONTEXT.
DD_SOURCE_CODE_CONTEXT is injected at build time by the build plugin.
Changes
sourceCodeContext.ts.rawRumEventanddomainContextto the assemble hook parameters to allow extracting the stack for sourceCodeContext.Test instructions
Checklist