Skip to content

Commit

Permalink
MNTOR-2931 - initialize Glean after logging setup, for auto pageload …
Browse files Browse the repository at this point in the history
…events (#4402)
  • Loading branch information
rhelmer authored Apr 10, 2024
1 parent bf9ad08 commit 24b7d65
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/hooks/useGlean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ export const useGlean = () => {
throw new ErrorEvent("No PUBLIC_APP_ENV provided for Glean");
}

Glean.initialize("monitor.frontend", uploadEnabled, {
// This will submit an events ping every time an event is recorded.
maxEvents: 1,
channel: PUBLIC_APP_ENV,
enableAutoPageLoadEvents: true,
});

// Glean debugging options can be found here:
// https://mozilla.github.io/glean/book/reference/debug/index.html
if (
Expand All @@ -43,6 +36,13 @@ export const useGlean = () => {
// @see https://debug-ping-preview.firebaseapp.com/pings/fx-monitor-local-dev
Glean.setDebugViewTag(`fx-monitor-${PUBLIC_APP_ENV}-dev`);
}

Glean.initialize("monitor.frontend", uploadEnabled, {
// This will submit an events ping every time an event is recorded.
maxEvents: 1,
channel: PUBLIC_APP_ENV,
enableAutoPageLoadEvents: true,
});
// This effect should only run once
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
Expand Down

0 comments on commit 24b7d65

Please sign in to comment.