Skip to content
Merged
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
9 changes: 7 additions & 2 deletions app/client/src/UITelemetry/generateTraces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { deviceType } from "react-device-detect";

import { APP_MODE } from "entities/App";
import { matchBuilderPath, matchViewerPath } from "constants/routes";
import memoizeOne from "memoize-one";

const GENERATOR_TRACE = "generator-tracer";

export type OtlpSpan = Span;
export type SpanAttributes = Attributes;

const getCommonTelemetryAttributes = () => {
const pathname = window.location.pathname;
const getAppMode = memoizeOne((pathname: string) => {
const isEditorUrl = matchBuilderPath(pathname);
const isViewerUrl = matchViewerPath(pathname);

Expand All @@ -27,6 +27,11 @@ const getCommonTelemetryAttributes = () => {
: isViewerUrl
? APP_MODE.PUBLISHED
: "";
return appMode;
});
const getCommonTelemetryAttributes = () => {
const pathname = window.location.pathname;
const appMode = getAppMode(pathname);

return {
appMode,
Expand Down