Skip to content

Commit

Permalink
move all methods to init
Browse files Browse the repository at this point in the history
  • Loading branch information
dvj1988 committed Sep 20, 2024
1 parent e1b888a commit d40ebc1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 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 = () => {
init() {
// Register connection change listener
this.addConnectionAttributes();

Expand All @@ -69,7 +66,12 @@ export class PageLoadInstrumentation extends InstrumentationBase {
// If PerformanceObserver is not available, fallback to polling
this.pollResourceTimingEntries();
}
};
}

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({
Expand Down

0 comments on commit d40ebc1

Please sign in to comment.