Skip to content
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

chore: fix this.rootSpan undefined bug in PageLoadInstrumentation #36459

Open
wants to merge 3 commits into
base: release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions app/client/src/UITelemetry/PageLoadInstrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ export class PageLoadInstrumentation extends InstrumentationBase {
this.ignoreResourceUrls = ignoreResourceUrls;
// Start the root span for the page load
this.rootSpan = startRootSpan("PAGE_LOAD", {}, 0);
}

init() {
// init method is present in the base class and needs to be implemented
// This is method is never called by the OpenTelemetry SDK
// Leaving it empty as it is done by other OpenTelemetry instrumentation classes
// Initialize the instrumentation after starting the root span
this.init();
}

enable(): void {
init() {
// Register connection change listener
this.addConnectionAttributes();

Expand All @@ -71,6 +68,11 @@ export class PageLoadInstrumentation extends InstrumentationBase {
}
}

enable() {
// enable method is present in the base class and needs to be implemented
// Leaving it empty as there is no need to do anything here
}

private addDeviceAttributes() {
this.rootSpan.setAttributes({
deviceMemory: (navigator as TNavigator).deviceMemory,
Expand Down
Loading