@sentry/ember 11.0.0-alpha.2 → 11.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentEmberAppInstanceForPerformance.d.ts","sourceRoot":"","sources":["../../src/utils/instrumentEmberAppInstanceForPerformance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAGnE,OAAO,KAAK,EACV,iCAAiC,IAAI,qCAAqC,EAC1E,+BAA+B,IAAI,mCAAmC,EACvE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentEmberAppInstanceForPerformance.d.ts","sourceRoot":"","sources":["../../src/utils/instrumentEmberAppInstanceForPerformance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAGnE,OAAO,KAAK,EACV,iCAAiC,IAAI,qCAAqC,EAC1E,+BAA+B,IAAI,mCAAmC,EACvE,MAAM,iBAAiB,CAAC;AAUzB,OAAO,EAOL,KAAK,MAAM,EAEZ,MAAM,cAAc,CAAC;AAGtB,UAAU,eAAe;IACvB,QAAQ,EAAE;QACR,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;QACpC,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAID,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,mBAAmB,EAChC,MAAM,EAAE;IAAE,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAAE,EAC7G,+BAA+B,EAAE,OAAO,mCAAmC,EAC3E,iCAAiC,EAAE,OAAO,qCAAqC,GAC9E,IAAI,CAyIN;AA+ED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,MAAM,CAW7E"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { startSpan, WINDOW, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN as SEMANTIC_ATTRIBU
|
|
|
3
3
|
export * from '@sentry/browser';
|
|
4
4
|
import { applySdkMetadata, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, PAGELOAD_SPAN_NAME_FALLBACK, hasSpanStreamingEnabled, getCurrentScope, spanToJSON, ROUTER_SPAN_NAME_FALLBACK, filterCollectedUrl, timestampInSeconds, browserPerformanceTimeOrigin } from '@sentry/core';
|
|
5
5
|
import { CODE_FUNCTION_NAME, SENTRY_OP, SENTRY_SEGMENT_NAME_SOURCE, URL_TEMPLATE, URL_FULL, URL_PATH, UI_COMPONENT_NAME } from '@sentry/conventions/attributes';
|
|
6
|
-
import { FUNCTION, UI_MOUNT, UI_TASK, UI_RENDER } from '@sentry/conventions/op';
|
|
6
|
+
import { FUNCTION, ROUTER, UI_MOUNT, UI_TASK, UI_RENDER } from '@sentry/conventions/op';
|
|
7
7
|
import { _backburner, run, scheduleOnce } from '@ember/runloop';
|
|
8
8
|
import { subscribe } from '@ember/instrumentation';
|
|
9
9
|
import { macroCondition, isTesting } from '@embroider/macros';
|
|
@@ -205,8 +205,7 @@ function instrumentEmberAppInstanceForPerformance(client, appInstance, config, s
|
|
|
205
205
|
}
|
|
206
206
|
transitionSpan = startInactiveSpan({
|
|
207
207
|
attributes: {
|
|
208
|
-
|
|
209
|
-
[SENTRY_OP]: 'router',
|
|
208
|
+
[SENTRY_OP]: ROUTER,
|
|
210
209
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN$1]: 'auto.ui.ember'
|
|
211
210
|
},
|
|
212
211
|
// With span streaming, span names have to be low cardinality, and Ember gives us no route
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/init.ts","../src/utils/instrumentRoutePerformance.ts","../src/utils/utils.ts","../src/utils/instrumentEmberAppInstanceForPerformance.ts","../src/utils/instrumentEmberGlobals.ts","../src/utils/browserTracingIntegration.ts"],"sourcesContent":["import * as Sentry from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\n\nimport type { BrowserOptions } from '@sentry/browser';\nimport type { Client } from '@sentry/core';\n\n/**\n * Initialize the Sentry SDK for Ember.\n *\n * This should be called early in your application's startup, typically in app/app.ts\n * before your Application class is defined.\n *\n * @param config - Sentry browser options\n * @returns The Sentry client instance\n *\n * @example\n * ```typescript\n * import * as Sentry from '@sentry/ember';\n *\n * Sentry.init({\n * dsn: 'YOUR_DSN_HERE',\n * tracesSampleRate: 1.0,\n * });\n * ```\n */\nexport function init(config?: BrowserOptions): Client | undefined {\n const initConfig = { ...config };\n\n applySdkMetadata(initConfig, 'ember');\n\n return Sentry.init(initConfig);\n}\n","import { startSpan } from '@sentry/browser';\nimport { CODE_FUNCTION_NAME, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION } from '@sentry/conventions/op';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\n\nimport type Route from '@ember/routing/route';\n\ntype RouteConstructor = new (...args: ConstructorParameters<typeof Route>) => Route;\n\n/**\n * Enables monitoring the performance of an Ember app.\n *\n * This wraps the route's lifecycle hooks (beforeModel, model, afterModel, setupController)\n * with Sentry spans to track their performance.\n *\n * @param BaseRoute - The Route class to instrument\n * @returns The instrumented Route class\n *\n * @example\n * ```ts\n * import Route from '@ember/routing/route';\n * import { instrumentRoutePerformance } from '@sentry/ember';\n *\n * class ApplicationRoute extends Route {\n * async model() {\n * return this.store.findAll('post');\n * }\n * }\n *\n * export default instrumentRoutePerformance(ApplicationRoute);\n * ```\n */\nexport function instrumentRoutePerformance<T extends RouteConstructor>(BaseRoute: T): T {\n const instrumentFunction = async (\n hookName: string,\n name: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Route hooks have varied signatures that can't be unified with unknown\n fn: (...args: any[]) => any,\n args: unknown[],\n ): Promise<unknown> => {\n return startSpan(\n {\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n [SENTRY_OP]: FUNCTION,\n [CODE_FUNCTION_NAME]: hookName,\n },\n name,\n onlyIfParent: true,\n },\n () => {\n return fn(...args);\n },\n );\n };\n\n const routeName = BaseRoute.name;\n\n return {\n // @ts-expect-error TS2545 We do not need to redefine a constructor here\n [routeName]: class extends BaseRoute {\n public beforeModel(...args: unknown[]): void | Promise<unknown> {\n return instrumentFunction('beforeModel', this.fullRouteName, super.beforeModel.bind(this), args);\n }\n\n public async model(...args: unknown[]): Promise<unknown> {\n return instrumentFunction('model', this.fullRouteName, super.model.bind(this), args);\n }\n\n public afterModel(...args: unknown[]): void | Promise<unknown> {\n return instrumentFunction('afterModel', this.fullRouteName, super.afterModel.bind(this), args);\n }\n\n public setupController(...args: unknown[]): void | Promise<unknown> {\n return instrumentFunction('setupController', this.fullRouteName, super.setupController.bind(this), args);\n }\n },\n }[routeName] as T;\n}\n","import { _backburner, run } from '@ember/runloop';\n\ninterface ExtendedBackburner {\n on(eventName: string, callback: (...args: unknown[]) => void): void;\n off(eventName: string, callback: (...args: unknown[]) => void): void;\n}\n\nexport function getBackburner(): Pick<ExtendedBackburner, 'on' | 'off'> {\n if (_backburner) {\n return _backburner;\n }\n\n if ((run as unknown as { backburner?: Pick<ExtendedBackburner, 'on' | 'off'> }).backburner) {\n return (run as unknown as { backburner: Pick<ExtendedBackburner, 'on' | 'off'> }).backburner;\n }\n\n return {\n on() {\n // noop\n },\n off() {\n // noop\n },\n };\n}\n","import type ApplicationInstance from '@ember/application/instance';\nimport type Transition from '@ember/routing/transition';\nimport type RouterService from '@ember/routing/router-service';\nimport type {\n startBrowserTracingNavigationSpan as startBrowserTracingNavigationSpanType,\n startBrowserTracingPageLoadSpan as startBrowserTracingPageLoadSpanType,\n} from '@sentry/browser';\nimport { getAbsoluteUrl, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan, WINDOW } from '@sentry/browser';\nimport {\n SENTRY_SEGMENT_NAME_SOURCE,\n SENTRY_OP,\n URL_FULL,\n URL_PATH,\n URL_TEMPLATE,\n} from '@sentry/conventions/attributes';\nimport {\n filterCollectedUrl,\n getCurrentScope,\n hasSpanStreamingEnabled,\n PAGELOAD_SPAN_NAME_FALLBACK,\n ROUTER_SPAN_NAME_FALLBACK,\n spanToJSON,\n type Client,\n type Span,\n} from '@sentry/core';\nimport { getBackburner } from './utils.ts';\n\ninterface EmberRouterMain {\n location: {\n formatURL?: (url: string) => string;\n getURL?: () => string;\n implementation?: string;\n rootURL: string;\n };\n}\n\ntype TransitionWithIntent = Transition & { intent?: { url?: string } };\n\nexport function instrumentEmberAppInstanceForPerformance(\n client: Client,\n appInstance: ApplicationInstance,\n config: { disableRunloopPerformance?: boolean; instrumentPageLoad?: boolean; instrumentNavigation?: boolean },\n startBrowserTracingPageLoadSpan: typeof startBrowserTracingPageLoadSpanType,\n startBrowserTracingNavigationSpan: typeof startBrowserTracingNavigationSpanType,\n): void {\n const { disableRunloopPerformance, instrumentPageLoad, instrumentNavigation } = config;\n const routerService = getRouterService(appInstance);\n\n if (!routerService.recognize) {\n // Router is missing critical functionality to limit cardinality of the transaction names.\n return;\n }\n\n const routerMain = getRouterMain(appInstance);\n const location = routerMain.location;\n let activeRootSpan: Span | undefined;\n let transitionSpan: Span | undefined;\n\n const url = _getLocationURL(location);\n\n if (instrumentPageLoad !== false) {\n // Somehow the router service etc. may not be fully ready/initialized yet at this point\n // Probably because we are running this before the Ember setup is necessarily completed\n // So in order to accomodate this, we fall back to starting the pageload span with the current URL and update it later\n const routeInfo = url ? routerService.recognize(url) : undefined;\n\n activeRootSpan = startBrowserTracingPageLoadSpan(client, {\n // With span streaming, span names have to be low cardinality, so we can't fall back to the URL.\n name: routeInfo\n ? `route:${routeInfo.name}`\n : hasSpanStreamingEnabled(client)\n ? PAGELOAD_SPAN_NAME_FALLBACK\n : url || WINDOW.location.pathname,\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: routeInfo ? 'route' : 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.ember',\n ...(url ? _getRouteUrlAttributes(client, url, routeInfo?.params) : {}),\n toRoute: routeInfo?.name,\n },\n });\n }\n\n const finishActiveTransaction = (_: unknown, nextInstance: unknown): void => {\n if (nextInstance) {\n return;\n }\n activeRootSpan?.end();\n getBackburner().off('end', finishActiveTransaction);\n };\n\n routerService.on('routeWillChange', (transition: Transition) => {\n const { fromRoute, toRoute } = getTransitionInformation(transition, routerService);\n\n // Store this here to be used, even if the active span has ended\n getCurrentScope().setTransactionName(`route:${toRoute}`);\n\n // We want to ignore loading && error routes\n if (transitionIsIntermediate(transition)) {\n return;\n }\n\n // If this is not the initial transition, we want to end the active root span and start a new one\n if (fromRoute != null) {\n activeRootSpan?.end();\n\n if (instrumentNavigation !== false) {\n // Only `intent.url` reliably reflects the *destination* URL at `routeWillChange` time. The\n // router's location still points at the current (pre-transition) route here, so falling back to\n // it would tag the navigation span with the previous route's `url.*` attributes. When we don't\n // have a trustworthy target URL, we omit them and let `routeDidChange` set them from `currentURL`.\n const targetUrl = (transition as TransitionWithIntent).intent?.url;\n const urlAttributes = targetUrl ? _getRouteUrlAttributes(client, targetUrl, transition.to?.params) : {};\n\n activeRootSpan = startBrowserTracingNavigationSpan(client, {\n name: `route:${toRoute}`,\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: 'route',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.ember',\n ...urlAttributes,\n fromRoute,\n toRoute,\n },\n });\n }\n } else if (activeRootSpan && spanToJSON(activeRootSpan).attributes[SENTRY_SEGMENT_NAME_SOURCE] === 'url') {\n // We make sure to update the pageload span with the current URL, if we couldn't get it before\n // In this case we re-load the router:main reference, as this may change and we may have a stale reference\n const location = getRouterMain(appInstance).location;\n const url = _getLocationURL(location);\n if (url) {\n const routeInfo = routerService.recognize(url);\n activeRootSpan.updateName(`route:${toRoute}`);\n activeRootSpan.setAttributes({\n [SENTRY_SEGMENT_NAME_SOURCE]: 'route',\n ..._getRouteUrlAttributes(client, url, routeInfo?.params),\n toRoute: toRoute,\n });\n }\n }\n\n // transition spans are only emitted if instrumentNavigation is true\n if (instrumentNavigation === false) {\n return;\n }\n\n transitionSpan = startInactiveSpan({\n attributes: {\n // TODO(conventions): Replace `'router'` with the `router` span op constant once it is released in `@sentry/conventions`.\n [SENTRY_OP]: 'router',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n },\n // With span streaming, span names have to be low cardinality, and Ember gives us no route\n // template for the transition itself, so it's the fallback.\n name: hasSpanStreamingEnabled(client) ? ROUTER_SPAN_NAME_FALLBACK : `route:${fromRoute} -> route:${toRoute}`,\n onlyIfParent: true,\n });\n });\n\n routerService.on('routeDidChange', transition => {\n if (!transitionSpan || !activeRootSpan || transitionIsIntermediate(transition)) {\n return;\n }\n transitionSpan.end();\n\n const url = routerService.currentURL ?? _getLocationURL(location);\n if (url) {\n const routeInfo = routerService.recognize(url);\n // `currentURL` is the normalized route path and never includes the hash fragment, so we source\n // `url.full` from the location URL (which preserves `#/...` for hash-location apps) when available.\n const fullUrl = _getLocationURL(location) || url;\n activeRootSpan.setAttributes(\n _getRouteUrlAttributes(client, url, routeInfo?.params ?? transition.to?.params, fullUrl),\n );\n }\n\n if (disableRunloopPerformance) {\n activeRootSpan.end();\n return;\n }\n\n getBackburner().on('end', finishActiveTransaction);\n });\n}\n\nfunction getRouterService(appInstance: ApplicationInstance): RouterService {\n const routerService = appInstance.lookup('service:router') as RouterService & {\n externalRouter?: RouterService;\n };\n\n if (routerService.externalRouter) {\n // Using ember-engines-router-service in an engine.\n return routerService.externalRouter;\n }\n\n return routerService;\n}\n\nfunction getRouterMain(appInstance: ApplicationInstance): EmberRouterMain {\n return appInstance.lookup('router:main') as EmberRouterMain;\n}\n\nfunction getTransitionInformation(\n transition: Transition | undefined,\n router: RouterService,\n): { fromRoute?: string; toRoute?: string } {\n const fromRoute = transition?.from?.name;\n const toRoute = transition?.to?.name ?? router.currentRouteName ?? undefined;\n\n return {\n fromRoute,\n toRoute,\n };\n}\n\nfunction getUrlPathFromEmberLocation(url: string): string {\n if (!url) {\n return '/';\n }\n\n const withoutQuery = url.split('?')[0] ?? url;\n\n if (withoutQuery.includes('#')) {\n const hashPart = withoutQuery.substring(withoutQuery.indexOf('#') + 1);\n return hashPart.startsWith('/') ? hashPart : `/${hashPart}`;\n }\n\n return withoutQuery.startsWith('/') ? withoutQuery : `/${withoutQuery}`;\n}\n\nfunction buildUrlTemplate(path: string, params: Record<string, unknown> = {}): string {\n let template = path;\n\n const paramEntries = Object.entries(params)\n .filter((entry): entry is [string, string] => typeof entry[1] === 'string' && entry[1].length > 0)\n .sort(([, a], [, b]) => b.length - a.length);\n\n for (const [key, value] of paramEntries) {\n template = template.replace(`/${value}`, `/:${key}`);\n }\n\n return template;\n}\n\nfunction _getRouteUrlAttributes(\n client: Client,\n url: string,\n params: Record<string, unknown> = {},\n fullUrl: string = url,\n): Record<string, string> {\n const path = getUrlPathFromEmberLocation(url);\n\n // `url.full` is derived from the unstripped URL so that hash-location apps keep their `#/...`\n // fragment (e.g. `https://host/#/tracing`), which would otherwise be lost by `getUrlPathFromEmberLocation`.\n return {\n [URL_PATH]: path,\n [URL_FULL]: filterCollectedUrl(getAbsoluteUrl(fullUrl), client),\n [URL_TEMPLATE]: buildUrlTemplate(path, params),\n };\n}\n\n// Only exported for testing\nexport function _getLocationURL(location: EmberRouterMain['location']): string {\n if (!location?.getURL || !location?.formatURL) {\n return '';\n }\n const url = location.formatURL(location.getURL());\n\n // `implementation` is optional in Ember's predefined location types, so we also check if the URL starts with '#'.\n if (location.implementation === 'hash' || url.startsWith('#')) {\n return `${location.rootURL}${url}`;\n }\n return url;\n}\n\nfunction transitionIsIntermediate(transition: Transition): boolean {\n // We want to use ignore, as this may actually be defined on new versions\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore This actually exists on newer versions\n const isIntermediate: boolean | undefined = transition.isIntermediate;\n\n if (typeof isIntermediate === 'boolean') {\n return isIntermediate;\n }\n\n // For versions without this, we look if the route is a `.loading` or `.error` route\n // This is not perfect and may false-positive in some cases, but it's the best we can do\n return transition.to?.localName === 'loading' || transition.to?.localName === 'error';\n}\n","import { subscribe } from '@ember/instrumentation';\nimport { scheduleOnce } from '@ember/runloop';\nimport { SENTRY_OP, UI_COMPONENT_NAME } from '@sentry/conventions/attributes';\nimport { UI_MOUNT, UI_RENDER, UI_TASK, FUNCTION } from '@sentry/conventions/op';\nimport { getActiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/browser';\nimport type { Span } from '@sentry/core';\nimport { browserPerformanceTimeOrigin, timestampInSeconds } from '@sentry/core';\nimport { getBackburner } from './utils.ts';\n\n// Ember runloop queue names\ntype EmberRunQueues = 'actions' | 'afterRender' | 'destroy' | 'render' | 'routerTransitions' | 'sync';\n\ntype Payload = {\n containerKey: string;\n initialRender: true;\n object: string;\n};\n\ntype RenderEntry = {\n now: number;\n};\n\nexport type RenderEntries = WeakMap<Payload, RenderEntry>;\n\n/** This is global, so should only be run once in tests! */\nexport function instrumentGlobalsForPerformance(config: {\n disableRunloopPerformance?: boolean;\n minimumRunloopQueueDuration?: number;\n disableInstrumentComponents?: boolean;\n minimumComponentRenderDuration?: number;\n enableComponentDefinitions?: boolean;\n disableInitialLoadInstrumentation?: boolean;\n}): void {\n const {\n disableRunloopPerformance,\n minimumRunloopQueueDuration,\n disableInstrumentComponents,\n minimumComponentRenderDuration,\n enableComponentDefinitions,\n disableInitialLoadInstrumentation,\n } = config;\n\n if (!disableRunloopPerformance) {\n _instrumentEmberRunloop({\n minimumRunloopQueueDuration,\n });\n }\n if (!disableInstrumentComponents) {\n _instrumentComponents({\n minimumComponentRenderDuration,\n enableComponentDefinitions,\n });\n }\n if (!disableInitialLoadInstrumentation) {\n _instrumentInitialLoad();\n }\n}\n\nfunction _instrumentEmberRunloop(config: { minimumRunloopQueueDuration?: number }): void {\n const { minimumRunloopQueueDuration } = config;\n let currentQueueStart: number | undefined;\n let currentQueueSpan: Span | undefined;\n const instrumentedEmberQueues = [\n 'actions',\n 'routerTransitions',\n 'render',\n 'afterRender',\n 'destroy',\n ] as EmberRunQueues[];\n\n getBackburner().on('begin', (_: unknown, previousInstance: unknown) => {\n if (previousInstance) {\n return;\n }\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n if (currentQueueSpan) {\n currentQueueSpan.end();\n }\n currentQueueStart = timestampInSeconds();\n\n const processQueue = (queue: EmberRunQueues): void => {\n // Process this queue using the end of the previous queue.\n if (currentQueueStart) {\n const now = timestampInSeconds();\n const minQueueDuration = minimumRunloopQueueDuration ?? 5;\n\n if ((now - currentQueueStart) * 1000 >= minQueueDuration) {\n startInactiveSpan({\n attributes: {\n [SENTRY_OP]: UI_TASK,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n 'ember.runloop.queue': queue,\n },\n name: 'runloop',\n startTime: currentQueueStart,\n onlyIfParent: true,\n })?.end(now);\n }\n currentQueueStart = undefined;\n }\n\n // Setup for next queue\n\n const stillActiveSpan = getActiveSpan();\n if (!stillActiveSpan) {\n return;\n }\n currentQueueStart = timestampInSeconds();\n };\n\n instrumentedEmberQueues.forEach(queue => {\n scheduleOnce(queue, null, processQueue, queue);\n });\n });\n getBackburner().on('end', (_: unknown, nextInstance: unknown) => {\n if (nextInstance) {\n return;\n }\n if (currentQueueSpan) {\n currentQueueSpan.end();\n currentQueueSpan = undefined;\n }\n });\n}\n\nexport function _processComponentRenderBefore(payload: Payload, beforeEntries: RenderEntries): void {\n beforeEntries.set(payload, { now: timestampInSeconds() });\n}\n\nexport function _processComponentRenderAfter(\n payload: Payload,\n beforeEntries: RenderEntries,\n op: string,\n minComponentDuration: number,\n): void {\n const begin = beforeEntries.get(payload);\n\n if (!begin) {\n return;\n }\n\n // A WeakMap entry cannot outlive its payload, but delete promptly anyway\n // so a long-lived payload doesn't keep the entry around between renders.\n beforeEntries.delete(payload);\n\n const now = timestampInSeconds();\n const componentRenderDuration = now - begin.now;\n\n const name = payload.containerKey || payload.object;\n\n if (componentRenderDuration * 1000 >= minComponentDuration) {\n startInactiveSpan({\n name,\n startTime: begin.now,\n attributes: {\n [SENTRY_OP]: op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n [UI_COMPONENT_NAME]: name,\n },\n onlyIfParent: true,\n })?.end(now);\n }\n}\n\nfunction _instrumentComponents(config: {\n minimumComponentRenderDuration?: number;\n enableComponentDefinitions?: boolean;\n}): void {\n const { minimumComponentRenderDuration, enableComponentDefinitions } = config;\n\n const minComponentDuration = minimumComponentRenderDuration ?? 2;\n\n const beforeEntries: RenderEntries = new WeakMap();\n const beforeComponentDefinitionEntries: RenderEntries = new WeakMap();\n\n function _subscribeToRenderEvents(): void {\n subscribe<void>('render.component', {\n before(_name: string, _timestamp: number, payload: object) {\n _processComponentRenderBefore(payload as Payload, beforeEntries);\n },\n\n after(_name: string, _timestamp: number, payload: object) {\n _processComponentRenderAfter(payload as Payload, beforeEntries, UI_RENDER, minComponentDuration);\n },\n });\n if (enableComponentDefinitions) {\n subscribe<void>('render.getComponentDefinition', {\n before(_name: string, _timestamp: number, payload: object) {\n _processComponentRenderBefore(payload as Payload, beforeComponentDefinitionEntries);\n },\n\n after(_name: string, _timestamp: number, payload: object) {\n _processComponentRenderAfter(payload as Payload, beforeComponentDefinitionEntries, FUNCTION, 0);\n },\n });\n }\n }\n _subscribeToRenderEvents();\n}\n\nfunction _instrumentInitialLoad(): void {\n const startName = '@sentry/ember:initial-load-start';\n const endName = '@sentry/ember:initial-load-end';\n\n const { HAS_PERFORMANCE, HAS_PERFORMANCE_TIMING } = _hasPerformanceSupport();\n\n if (!HAS_PERFORMANCE) {\n return;\n }\n\n const { performance } = window;\n\n const origin = browserPerformanceTimeOrigin();\n // Split performance check in two so clearMarks still happens even if timeOrigin isn't available.\n if (!HAS_PERFORMANCE_TIMING || origin === undefined) {\n return;\n }\n const measureName = '@sentry/ember:initial-load';\n\n const startMarkExists = performance.getEntriesByName(startName).length > 0;\n const endMarkExists = performance.getEntriesByName(endName).length > 0;\n if (!startMarkExists || !endMarkExists) {\n return;\n }\n\n performance.measure(measureName, startName, endName);\n const measures = performance.getEntriesByName(measureName);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const measure = measures[0]!;\n\n const startTime = (measure.startTime + origin) / 1000;\n const endTime = startTime + measure.duration / 1000;\n\n startInactiveSpan({\n name: 'init',\n attributes: {\n [SENTRY_OP]: UI_MOUNT,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n },\n startTime,\n onlyIfParent: true,\n })?.end(endTime);\n performance.clearMarks(startName);\n performance.clearMarks(endName);\n\n performance.clearMeasures(measureName);\n}\n\nfunction _hasPerformanceSupport(): { HAS_PERFORMANCE: boolean; HAS_PERFORMANCE_TIMING: boolean } {\n // TS says that all of these methods are always available, but some of them may not be supported in older browsers\n // So we \"pretend\" they are all optional in order to be able to check this properly without TS complaining\n const _performance = window.performance as {\n clearMarks?: Performance['clearMarks'];\n clearMeasures?: Performance['clearMeasures'];\n measure?: Performance['measure'];\n getEntriesByName?: Performance['getEntriesByName'];\n };\n const HAS_PERFORMANCE = Boolean(_performance?.clearMarks && _performance.clearMeasures);\n const HAS_PERFORMANCE_TIMING = Boolean(\n _performance.measure && _performance.getEntriesByName && browserPerformanceTimeOrigin !== undefined,\n );\n\n return {\n HAS_PERFORMANCE,\n HAS_PERFORMANCE_TIMING,\n };\n}\n","import {\n addIntegration,\n browserTracingIntegration as originalBrowserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n} from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type ApplicationInstance from '@ember/application/instance';\nimport { instrumentEmberAppInstanceForPerformance } from './instrumentEmberAppInstanceForPerformance.ts';\nimport { instrumentGlobalsForPerformance } from './instrumentEmberGlobals.ts';\nimport { isTesting, macroCondition } from '@embroider/macros';\n\ntype EmberBrowserTracingIntegrationOptions = Parameters<typeof originalBrowserTracingIntegration>[0] & {\n appInstance: ApplicationInstance;\n disableRunloopPerformance?: boolean;\n minimumRunloopQueueDuration?: number;\n disableInstrumentComponents?: boolean;\n minimumComponentRenderDuration?: number;\n enableComponentDefinitions?: boolean;\n disableInitialLoadInstrumentation?: boolean;\n};\n\nlet _initialized = false;\n\nexport function browserTracingIntegration(options: EmberBrowserTracingIntegrationOptions): Integration {\n const { appInstance } = options;\n\n const instrumentNavigation = options.instrumentNavigation ?? true;\n const instrumentPageLoad = options.instrumentPageLoad ?? true;\n\n const integration = originalBrowserTracingIntegration({\n ...options,\n instrumentNavigation: false,\n instrumentPageLoad: false,\n });\n\n const appInstancePerformanceConfig = {\n disableRunloopPerformance: options.disableRunloopPerformance ?? false,\n instrumentPageLoad,\n instrumentNavigation,\n };\n\n const globalsPerformanceConfig = {\n disableRunloopPerformance: options.disableRunloopPerformance ?? false,\n minimumRunloopQueueDuration: options.minimumRunloopQueueDuration,\n disableInstrumentComponents: options.disableInstrumentComponents ?? false,\n minimumComponentRenderDuration: options.minimumComponentRenderDuration,\n enableComponentDefinitions: options.enableComponentDefinitions ?? false,\n disableInitialLoadInstrumentation: options.disableInitialLoadInstrumentation ?? false,\n };\n\n return {\n ...integration,\n afterAllSetup(client) {\n integration.afterAllSetup(client);\n\n instrumentEmberAppInstanceForPerformance(\n client,\n appInstance,\n appInstancePerformanceConfig,\n startBrowserTracingPageLoadSpan,\n startBrowserTracingNavigationSpan,\n );\n\n // We only want to run this once in tests!\n if (macroCondition(isTesting())) {\n if (_initialized) {\n return;\n }\n }\n\n instrumentGlobalsForPerformance(globalsPerformanceConfig);\n _initialized = true;\n },\n };\n}\n\n/**\n * Utility to simplify adding the browser tracing integration to an app instance.\n */\nexport function instrumentAppInstancePerformance(\n appInstance: ApplicationInstance,\n options?: Partial<Parameters<typeof browserTracingIntegration>[0]>,\n): void {\n // Disable in FastBoot — we only want to run Sentry client-side\n const fastboot = appInstance.lookup('service:fastboot') as { isFastBoot: boolean } | undefined;\n if (fastboot?.isFastBoot) {\n return;\n }\n\n addIntegration(\n browserTracingIntegration({\n ...options,\n appInstance,\n }),\n );\n}\n"],"names":["init","config","initConfig","applySdkMetadata","Sentry","instrumentRoutePerformance","BaseRoute","instrumentFunction","hookName","name","fn","args","startSpan","attributes","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SENTRY_OP","FUNCTION","CODE_FUNCTION_NAME","onlyIfParent","routeName","beforeModel","fullRouteName","bind","model","afterModel","setupController","getBackburner","_backburner","run","backburner","on","off","instrumentEmberAppInstanceForPerformance","client","appInstance","startBrowserTracingPageLoadSpan","startBrowserTracingNavigationSpan","disableRunloopPerformance","instrumentPageLoad","instrumentNavigation","routerService","getRouterService","recognize","routerMain","getRouterMain","location","activeRootSpan","transitionSpan","url","_getLocationURL","routeInfo","undefined","hasSpanStreamingEnabled","PAGELOAD_SPAN_NAME_FALLBACK","WINDOW","pathname","SENTRY_SEGMENT_NAME_SOURCE","_getRouteUrlAttributes","params","toRoute","finishActiveTransaction","_","nextInstance","end","transition","fromRoute","getTransitionInformation","getCurrentScope","setTransactionName","transitionIsIntermediate","targetUrl","intent","urlAttributes","to","spanToJSON","updateName","setAttributes","startInactiveSpan","ROUTER_SPAN_NAME_FALLBACK","currentURL","fullUrl","lookup","externalRouter","router","from","currentRouteName","getUrlPathFromEmberLocation","withoutQuery","split","includes","hashPart","substring","indexOf","startsWith","buildUrlTemplate","path","template","paramEntries","Object","entries","filter","entry","length","sort","a","b","key","value","replace","URL_PATH","URL_FULL","filterCollectedUrl","getAbsoluteUrl","URL_TEMPLATE","getURL","formatURL","implementation","rootURL","isIntermediate","localName","instrumentGlobalsForPerformance","minimumRunloopQueueDuration","disableInstrumentComponents","minimumComponentRenderDuration","enableComponentDefinitions","disableInitialLoadInstrumentation","_instrumentEmberRunloop","_instrumentComponents","_instrumentInitialLoad","currentQueueStart","instrumentedEmberQueues","previousInstance","activeSpan","getActiveSpan","timestampInSeconds","processQueue","queue","now","minQueueDuration","UI_TASK","startTime","stillActiveSpan","forEach","scheduleOnce","_processComponentRenderBefore","payload","beforeEntries","set","_processComponentRenderAfter","op","minComponentDuration","begin","get","delete","componentRenderDuration","containerKey","object","UI_COMPONENT_NAME","WeakMap","beforeComponentDefinitionEntries","_subscribeToRenderEvents","subscribe","before","_name","_timestamp","after","UI_RENDER","startName","endName","HAS_PERFORMANCE","HAS_PERFORMANCE_TIMING","_hasPerformanceSupport","performance","window","origin","browserPerformanceTimeOrigin","measureName","startMarkExists","getEntriesByName","endMarkExists","measure","measures","endTime","duration","UI_MOUNT","clearMarks","clearMeasures","_performance","Boolean","_initialized","browserTracingIntegration","options","integration","originalBrowserTracingIntegration","appInstancePerformanceConfig","globalsPerformanceConfig","afterAllSetup","macroCondition","isTesting","instrumentAppInstancePerformance","fastboot","isFastBoot","addIntegration"],"mappings":";;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,IAAIA,CAACC,MAAuB,EAAsB;AAChE,EAAA,MAAMC,UAAU,GAAG;IAAE,GAAGD;GAAQ;AAEhCE,EAAAA,gBAAgB,CAACD,UAAU,EAAE,OAAO,CAAC;AAErC,EAAA,OAAOE,MAAM,CAACJ,IAAI,CAACE,UAAU,CAAC;AAChC;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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2B,EAAEsE,OAAO,CAACtE,2BAA2B;AAChEC,IAAAA,2BAA2B,EAAEqE,OAAO,CAACrE,2BAA2B,IAAI,KAAK;IACzEC,8BAA8B,EAAEoE,OAAO,CAACpE,8BAA8B;AACtEC,IAAAA,0BAA0B,EAAEmE,OAAO,CAACnE,0BAA0B,IAAI,KAAK;AACvEC,IAAAA,iCAAiC,EAAEkE,OAAO,CAAClE,iCAAiC,IAAI;GACjF;EAED,OAAO;AACL,IAAA,GAAGmE,WAAW;IACdI,aAAaA,CAACnK,MAAM,EAAE;AACpB+J,MAAAA,WAAW,CAACI,aAAa,CAACnK,MAAM,CAAC;MAEjCD,wCAAwC,CACtCC,MAAM,EACNC,WAAW,EACXgK,4BAA4B,EAC5B/J,+BAA+B,EAC/BC,iCACF,CAAC;;AAED;AACA,MAAA,IAAIiK,cAAc,CAACC,SAAS,EAAE,CAAC,EAAE;AAC/B,QAAA,IAAIT,YAAY,EAAE;AAChB,UAAA;AACF,QAAA;AACF,MAAA;MAEArE,+BAA+B,CAAC2E,wBAAwB,CAAC;AACzDN,MAAAA,YAAY,GAAG,IAAI;AACrB,IAAA;GACD;AACH;;AAEA;AACA;AACA;AACO,SAASU,gCAAgCA,CAC9CrK,WAAgC,EAChC6J,OAAkE,EAC5D;AACN;AACA,EAAA,MAAMS,QAAQ,GAAGtK,WAAW,CAAC+C,MAAM,CAAC,kBAAkB,CAAwC;EAC9F,IAAIuH,QAAQ,EAAEC,UAAU,EAAE;AACxB,IAAA;AACF,EAAA;EAEAC,cAAc,CACZZ,yBAAyB,CAAC;AACxB,IAAA,GAAGC,OAAO;AACV7J,IAAAA;AACF,GAAC,CACH,CAAC;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/init.ts","../src/utils/instrumentRoutePerformance.ts","../src/utils/utils.ts","../src/utils/instrumentEmberAppInstanceForPerformance.ts","../src/utils/instrumentEmberGlobals.ts","../src/utils/browserTracingIntegration.ts"],"sourcesContent":["import * as Sentry from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\n\nimport type { BrowserOptions } from '@sentry/browser';\nimport type { Client } from '@sentry/core';\n\n/**\n * Initialize the Sentry SDK for Ember.\n *\n * This should be called early in your application's startup, typically in app/app.ts\n * before your Application class is defined.\n *\n * @param config - Sentry browser options\n * @returns The Sentry client instance\n *\n * @example\n * ```typescript\n * import * as Sentry from '@sentry/ember';\n *\n * Sentry.init({\n * dsn: 'YOUR_DSN_HERE',\n * tracesSampleRate: 1.0,\n * });\n * ```\n */\nexport function init(config?: BrowserOptions): Client | undefined {\n const initConfig = { ...config };\n\n applySdkMetadata(initConfig, 'ember');\n\n return Sentry.init(initConfig);\n}\n","import { startSpan } from '@sentry/browser';\nimport { CODE_FUNCTION_NAME, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION } from '@sentry/conventions/op';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\n\nimport type Route from '@ember/routing/route';\n\ntype RouteConstructor = new (...args: ConstructorParameters<typeof Route>) => Route;\n\n/**\n * Enables monitoring the performance of an Ember app.\n *\n * This wraps the route's lifecycle hooks (beforeModel, model, afterModel, setupController)\n * with Sentry spans to track their performance.\n *\n * @param BaseRoute - The Route class to instrument\n * @returns The instrumented Route class\n *\n * @example\n * ```ts\n * import Route from '@ember/routing/route';\n * import { instrumentRoutePerformance } from '@sentry/ember';\n *\n * class ApplicationRoute extends Route {\n * async model() {\n * return this.store.findAll('post');\n * }\n * }\n *\n * export default instrumentRoutePerformance(ApplicationRoute);\n * ```\n */\nexport function instrumentRoutePerformance<T extends RouteConstructor>(BaseRoute: T): T {\n const instrumentFunction = async (\n hookName: string,\n name: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Route hooks have varied signatures that can't be unified with unknown\n fn: (...args: any[]) => any,\n args: unknown[],\n ): Promise<unknown> => {\n return startSpan(\n {\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n [SENTRY_OP]: FUNCTION,\n [CODE_FUNCTION_NAME]: hookName,\n },\n name,\n onlyIfParent: true,\n },\n () => {\n return fn(...args);\n },\n );\n };\n\n const routeName = BaseRoute.name;\n\n return {\n // @ts-expect-error TS2545 We do not need to redefine a constructor here\n [routeName]: class extends BaseRoute {\n public beforeModel(...args: unknown[]): void | Promise<unknown> {\n return instrumentFunction('beforeModel', this.fullRouteName, super.beforeModel.bind(this), args);\n }\n\n public async model(...args: unknown[]): Promise<unknown> {\n return instrumentFunction('model', this.fullRouteName, super.model.bind(this), args);\n }\n\n public afterModel(...args: unknown[]): void | Promise<unknown> {\n return instrumentFunction('afterModel', this.fullRouteName, super.afterModel.bind(this), args);\n }\n\n public setupController(...args: unknown[]): void | Promise<unknown> {\n return instrumentFunction('setupController', this.fullRouteName, super.setupController.bind(this), args);\n }\n },\n }[routeName] as T;\n}\n","import { _backburner, run } from '@ember/runloop';\n\ninterface ExtendedBackburner {\n on(eventName: string, callback: (...args: unknown[]) => void): void;\n off(eventName: string, callback: (...args: unknown[]) => void): void;\n}\n\nexport function getBackburner(): Pick<ExtendedBackburner, 'on' | 'off'> {\n if (_backburner) {\n return _backburner;\n }\n\n if ((run as unknown as { backburner?: Pick<ExtendedBackburner, 'on' | 'off'> }).backburner) {\n return (run as unknown as { backburner: Pick<ExtendedBackburner, 'on' | 'off'> }).backburner;\n }\n\n return {\n on() {\n // noop\n },\n off() {\n // noop\n },\n };\n}\n","import type ApplicationInstance from '@ember/application/instance';\nimport type Transition from '@ember/routing/transition';\nimport type RouterService from '@ember/routing/router-service';\nimport type {\n startBrowserTracingNavigationSpan as startBrowserTracingNavigationSpanType,\n startBrowserTracingPageLoadSpan as startBrowserTracingPageLoadSpanType,\n} from '@sentry/browser';\nimport { getAbsoluteUrl, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan, WINDOW } from '@sentry/browser';\nimport {\n SENTRY_SEGMENT_NAME_SOURCE,\n SENTRY_OP,\n URL_FULL,\n URL_PATH,\n URL_TEMPLATE,\n} from '@sentry/conventions/attributes';\nimport { ROUTER } from '@sentry/conventions/op';\nimport {\n filterCollectedUrl,\n getCurrentScope,\n hasSpanStreamingEnabled,\n PAGELOAD_SPAN_NAME_FALLBACK,\n ROUTER_SPAN_NAME_FALLBACK,\n spanToJSON,\n type Client,\n type Span,\n} from '@sentry/core';\nimport { getBackburner } from './utils.ts';\n\ninterface EmberRouterMain {\n location: {\n formatURL?: (url: string) => string;\n getURL?: () => string;\n implementation?: string;\n rootURL: string;\n };\n}\n\ntype TransitionWithIntent = Transition & { intent?: { url?: string } };\n\nexport function instrumentEmberAppInstanceForPerformance(\n client: Client,\n appInstance: ApplicationInstance,\n config: { disableRunloopPerformance?: boolean; instrumentPageLoad?: boolean; instrumentNavigation?: boolean },\n startBrowserTracingPageLoadSpan: typeof startBrowserTracingPageLoadSpanType,\n startBrowserTracingNavigationSpan: typeof startBrowserTracingNavigationSpanType,\n): void {\n const { disableRunloopPerformance, instrumentPageLoad, instrumentNavigation } = config;\n const routerService = getRouterService(appInstance);\n\n if (!routerService.recognize) {\n // Router is missing critical functionality to limit cardinality of the transaction names.\n return;\n }\n\n const routerMain = getRouterMain(appInstance);\n const location = routerMain.location;\n let activeRootSpan: Span | undefined;\n let transitionSpan: Span | undefined;\n\n const url = _getLocationURL(location);\n\n if (instrumentPageLoad !== false) {\n // Somehow the router service etc. may not be fully ready/initialized yet at this point\n // Probably because we are running this before the Ember setup is necessarily completed\n // So in order to accomodate this, we fall back to starting the pageload span with the current URL and update it later\n const routeInfo = url ? routerService.recognize(url) : undefined;\n\n activeRootSpan = startBrowserTracingPageLoadSpan(client, {\n // With span streaming, span names have to be low cardinality, so we can't fall back to the URL.\n name: routeInfo\n ? `route:${routeInfo.name}`\n : hasSpanStreamingEnabled(client)\n ? PAGELOAD_SPAN_NAME_FALLBACK\n : url || WINDOW.location.pathname,\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: routeInfo ? 'route' : 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.ember',\n ...(url ? _getRouteUrlAttributes(client, url, routeInfo?.params) : {}),\n toRoute: routeInfo?.name,\n },\n });\n }\n\n const finishActiveTransaction = (_: unknown, nextInstance: unknown): void => {\n if (nextInstance) {\n return;\n }\n activeRootSpan?.end();\n getBackburner().off('end', finishActiveTransaction);\n };\n\n routerService.on('routeWillChange', (transition: Transition) => {\n const { fromRoute, toRoute } = getTransitionInformation(transition, routerService);\n\n // Store this here to be used, even if the active span has ended\n getCurrentScope().setTransactionName(`route:${toRoute}`);\n\n // We want to ignore loading && error routes\n if (transitionIsIntermediate(transition)) {\n return;\n }\n\n // If this is not the initial transition, we want to end the active root span and start a new one\n if (fromRoute != null) {\n activeRootSpan?.end();\n\n if (instrumentNavigation !== false) {\n // Only `intent.url` reliably reflects the *destination* URL at `routeWillChange` time. The\n // router's location still points at the current (pre-transition) route here, so falling back to\n // it would tag the navigation span with the previous route's `url.*` attributes. When we don't\n // have a trustworthy target URL, we omit them and let `routeDidChange` set them from `currentURL`.\n const targetUrl = (transition as TransitionWithIntent).intent?.url;\n const urlAttributes = targetUrl ? _getRouteUrlAttributes(client, targetUrl, transition.to?.params) : {};\n\n activeRootSpan = startBrowserTracingNavigationSpan(client, {\n name: `route:${toRoute}`,\n attributes: {\n [SENTRY_SEGMENT_NAME_SOURCE]: 'route',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.ember',\n ...urlAttributes,\n fromRoute,\n toRoute,\n },\n });\n }\n } else if (activeRootSpan && spanToJSON(activeRootSpan).attributes[SENTRY_SEGMENT_NAME_SOURCE] === 'url') {\n // We make sure to update the pageload span with the current URL, if we couldn't get it before\n // In this case we re-load the router:main reference, as this may change and we may have a stale reference\n const location = getRouterMain(appInstance).location;\n const url = _getLocationURL(location);\n if (url) {\n const routeInfo = routerService.recognize(url);\n activeRootSpan.updateName(`route:${toRoute}`);\n activeRootSpan.setAttributes({\n [SENTRY_SEGMENT_NAME_SOURCE]: 'route',\n ..._getRouteUrlAttributes(client, url, routeInfo?.params),\n toRoute: toRoute,\n });\n }\n }\n\n // transition spans are only emitted if instrumentNavigation is true\n if (instrumentNavigation === false) {\n return;\n }\n\n transitionSpan = startInactiveSpan({\n attributes: {\n [SENTRY_OP]: ROUTER,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n },\n // With span streaming, span names have to be low cardinality, and Ember gives us no route\n // template for the transition itself, so it's the fallback.\n name: hasSpanStreamingEnabled(client) ? ROUTER_SPAN_NAME_FALLBACK : `route:${fromRoute} -> route:${toRoute}`,\n onlyIfParent: true,\n });\n });\n\n routerService.on('routeDidChange', transition => {\n if (!transitionSpan || !activeRootSpan || transitionIsIntermediate(transition)) {\n return;\n }\n transitionSpan.end();\n\n const url = routerService.currentURL ?? _getLocationURL(location);\n if (url) {\n const routeInfo = routerService.recognize(url);\n // `currentURL` is the normalized route path and never includes the hash fragment, so we source\n // `url.full` from the location URL (which preserves `#/...` for hash-location apps) when available.\n const fullUrl = _getLocationURL(location) || url;\n activeRootSpan.setAttributes(\n _getRouteUrlAttributes(client, url, routeInfo?.params ?? transition.to?.params, fullUrl),\n );\n }\n\n if (disableRunloopPerformance) {\n activeRootSpan.end();\n return;\n }\n\n getBackburner().on('end', finishActiveTransaction);\n });\n}\n\nfunction getRouterService(appInstance: ApplicationInstance): RouterService {\n const routerService = appInstance.lookup('service:router') as RouterService & {\n externalRouter?: RouterService;\n };\n\n if (routerService.externalRouter) {\n // Using ember-engines-router-service in an engine.\n return routerService.externalRouter;\n }\n\n return routerService;\n}\n\nfunction getRouterMain(appInstance: ApplicationInstance): EmberRouterMain {\n return appInstance.lookup('router:main') as EmberRouterMain;\n}\n\nfunction getTransitionInformation(\n transition: Transition | undefined,\n router: RouterService,\n): { fromRoute?: string; toRoute?: string } {\n const fromRoute = transition?.from?.name;\n const toRoute = transition?.to?.name ?? router.currentRouteName ?? undefined;\n\n return {\n fromRoute,\n toRoute,\n };\n}\n\nfunction getUrlPathFromEmberLocation(url: string): string {\n if (!url) {\n return '/';\n }\n\n const withoutQuery = url.split('?')[0] ?? url;\n\n if (withoutQuery.includes('#')) {\n const hashPart = withoutQuery.substring(withoutQuery.indexOf('#') + 1);\n return hashPart.startsWith('/') ? hashPart : `/${hashPart}`;\n }\n\n return withoutQuery.startsWith('/') ? withoutQuery : `/${withoutQuery}`;\n}\n\nfunction buildUrlTemplate(path: string, params: Record<string, unknown> = {}): string {\n let template = path;\n\n const paramEntries = Object.entries(params)\n .filter((entry): entry is [string, string] => typeof entry[1] === 'string' && entry[1].length > 0)\n .sort(([, a], [, b]) => b.length - a.length);\n\n for (const [key, value] of paramEntries) {\n template = template.replace(`/${value}`, `/:${key}`);\n }\n\n return template;\n}\n\nfunction _getRouteUrlAttributes(\n client: Client,\n url: string,\n params: Record<string, unknown> = {},\n fullUrl: string = url,\n): Record<string, string> {\n const path = getUrlPathFromEmberLocation(url);\n\n // `url.full` is derived from the unstripped URL so that hash-location apps keep their `#/...`\n // fragment (e.g. `https://host/#/tracing`), which would otherwise be lost by `getUrlPathFromEmberLocation`.\n return {\n [URL_PATH]: path,\n [URL_FULL]: filterCollectedUrl(getAbsoluteUrl(fullUrl), client),\n [URL_TEMPLATE]: buildUrlTemplate(path, params),\n };\n}\n\n// Only exported for testing\nexport function _getLocationURL(location: EmberRouterMain['location']): string {\n if (!location?.getURL || !location?.formatURL) {\n return '';\n }\n const url = location.formatURL(location.getURL());\n\n // `implementation` is optional in Ember's predefined location types, so we also check if the URL starts with '#'.\n if (location.implementation === 'hash' || url.startsWith('#')) {\n return `${location.rootURL}${url}`;\n }\n return url;\n}\n\nfunction transitionIsIntermediate(transition: Transition): boolean {\n // We want to use ignore, as this may actually be defined on new versions\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore This actually exists on newer versions\n const isIntermediate: boolean | undefined = transition.isIntermediate;\n\n if (typeof isIntermediate === 'boolean') {\n return isIntermediate;\n }\n\n // For versions without this, we look if the route is a `.loading` or `.error` route\n // This is not perfect and may false-positive in some cases, but it's the best we can do\n return transition.to?.localName === 'loading' || transition.to?.localName === 'error';\n}\n","import { subscribe } from '@ember/instrumentation';\nimport { scheduleOnce } from '@ember/runloop';\nimport { SENTRY_OP, UI_COMPONENT_NAME } from '@sentry/conventions/attributes';\nimport { UI_MOUNT, UI_RENDER, UI_TASK, FUNCTION } from '@sentry/conventions/op';\nimport { getActiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/browser';\nimport type { Span } from '@sentry/core';\nimport { browserPerformanceTimeOrigin, timestampInSeconds } from '@sentry/core';\nimport { getBackburner } from './utils.ts';\n\n// Ember runloop queue names\ntype EmberRunQueues = 'actions' | 'afterRender' | 'destroy' | 'render' | 'routerTransitions' | 'sync';\n\ntype Payload = {\n containerKey: string;\n initialRender: true;\n object: string;\n};\n\ntype RenderEntry = {\n now: number;\n};\n\nexport type RenderEntries = WeakMap<Payload, RenderEntry>;\n\n/** This is global, so should only be run once in tests! */\nexport function instrumentGlobalsForPerformance(config: {\n disableRunloopPerformance?: boolean;\n minimumRunloopQueueDuration?: number;\n disableInstrumentComponents?: boolean;\n minimumComponentRenderDuration?: number;\n enableComponentDefinitions?: boolean;\n disableInitialLoadInstrumentation?: boolean;\n}): void {\n const {\n disableRunloopPerformance,\n minimumRunloopQueueDuration,\n disableInstrumentComponents,\n minimumComponentRenderDuration,\n enableComponentDefinitions,\n disableInitialLoadInstrumentation,\n } = config;\n\n if (!disableRunloopPerformance) {\n _instrumentEmberRunloop({\n minimumRunloopQueueDuration,\n });\n }\n if (!disableInstrumentComponents) {\n _instrumentComponents({\n minimumComponentRenderDuration,\n enableComponentDefinitions,\n });\n }\n if (!disableInitialLoadInstrumentation) {\n _instrumentInitialLoad();\n }\n}\n\nfunction _instrumentEmberRunloop(config: { minimumRunloopQueueDuration?: number }): void {\n const { minimumRunloopQueueDuration } = config;\n let currentQueueStart: number | undefined;\n let currentQueueSpan: Span | undefined;\n const instrumentedEmberQueues = [\n 'actions',\n 'routerTransitions',\n 'render',\n 'afterRender',\n 'destroy',\n ] as EmberRunQueues[];\n\n getBackburner().on('begin', (_: unknown, previousInstance: unknown) => {\n if (previousInstance) {\n return;\n }\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n if (currentQueueSpan) {\n currentQueueSpan.end();\n }\n currentQueueStart = timestampInSeconds();\n\n const processQueue = (queue: EmberRunQueues): void => {\n // Process this queue using the end of the previous queue.\n if (currentQueueStart) {\n const now = timestampInSeconds();\n const minQueueDuration = minimumRunloopQueueDuration ?? 5;\n\n if ((now - currentQueueStart) * 1000 >= minQueueDuration) {\n startInactiveSpan({\n attributes: {\n [SENTRY_OP]: UI_TASK,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n 'ember.runloop.queue': queue,\n },\n name: 'runloop',\n startTime: currentQueueStart,\n onlyIfParent: true,\n })?.end(now);\n }\n currentQueueStart = undefined;\n }\n\n // Setup for next queue\n\n const stillActiveSpan = getActiveSpan();\n if (!stillActiveSpan) {\n return;\n }\n currentQueueStart = timestampInSeconds();\n };\n\n instrumentedEmberQueues.forEach(queue => {\n scheduleOnce(queue, null, processQueue, queue);\n });\n });\n getBackburner().on('end', (_: unknown, nextInstance: unknown) => {\n if (nextInstance) {\n return;\n }\n if (currentQueueSpan) {\n currentQueueSpan.end();\n currentQueueSpan = undefined;\n }\n });\n}\n\nexport function _processComponentRenderBefore(payload: Payload, beforeEntries: RenderEntries): void {\n beforeEntries.set(payload, { now: timestampInSeconds() });\n}\n\nexport function _processComponentRenderAfter(\n payload: Payload,\n beforeEntries: RenderEntries,\n op: string,\n minComponentDuration: number,\n): void {\n const begin = beforeEntries.get(payload);\n\n if (!begin) {\n return;\n }\n\n // A WeakMap entry cannot outlive its payload, but delete promptly anyway\n // so a long-lived payload doesn't keep the entry around between renders.\n beforeEntries.delete(payload);\n\n const now = timestampInSeconds();\n const componentRenderDuration = now - begin.now;\n\n const name = payload.containerKey || payload.object;\n\n if (componentRenderDuration * 1000 >= minComponentDuration) {\n startInactiveSpan({\n name,\n startTime: begin.now,\n attributes: {\n [SENTRY_OP]: op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n [UI_COMPONENT_NAME]: name,\n },\n onlyIfParent: true,\n })?.end(now);\n }\n}\n\nfunction _instrumentComponents(config: {\n minimumComponentRenderDuration?: number;\n enableComponentDefinitions?: boolean;\n}): void {\n const { minimumComponentRenderDuration, enableComponentDefinitions } = config;\n\n const minComponentDuration = minimumComponentRenderDuration ?? 2;\n\n const beforeEntries: RenderEntries = new WeakMap();\n const beforeComponentDefinitionEntries: RenderEntries = new WeakMap();\n\n function _subscribeToRenderEvents(): void {\n subscribe<void>('render.component', {\n before(_name: string, _timestamp: number, payload: object) {\n _processComponentRenderBefore(payload as Payload, beforeEntries);\n },\n\n after(_name: string, _timestamp: number, payload: object) {\n _processComponentRenderAfter(payload as Payload, beforeEntries, UI_RENDER, minComponentDuration);\n },\n });\n if (enableComponentDefinitions) {\n subscribe<void>('render.getComponentDefinition', {\n before(_name: string, _timestamp: number, payload: object) {\n _processComponentRenderBefore(payload as Payload, beforeComponentDefinitionEntries);\n },\n\n after(_name: string, _timestamp: number, payload: object) {\n _processComponentRenderAfter(payload as Payload, beforeComponentDefinitionEntries, FUNCTION, 0);\n },\n });\n }\n }\n _subscribeToRenderEvents();\n}\n\nfunction _instrumentInitialLoad(): void {\n const startName = '@sentry/ember:initial-load-start';\n const endName = '@sentry/ember:initial-load-end';\n\n const { HAS_PERFORMANCE, HAS_PERFORMANCE_TIMING } = _hasPerformanceSupport();\n\n if (!HAS_PERFORMANCE) {\n return;\n }\n\n const { performance } = window;\n\n const origin = browserPerformanceTimeOrigin();\n // Split performance check in two so clearMarks still happens even if timeOrigin isn't available.\n if (!HAS_PERFORMANCE_TIMING || origin === undefined) {\n return;\n }\n const measureName = '@sentry/ember:initial-load';\n\n const startMarkExists = performance.getEntriesByName(startName).length > 0;\n const endMarkExists = performance.getEntriesByName(endName).length > 0;\n if (!startMarkExists || !endMarkExists) {\n return;\n }\n\n performance.measure(measureName, startName, endName);\n const measures = performance.getEntriesByName(measureName);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const measure = measures[0]!;\n\n const startTime = (measure.startTime + origin) / 1000;\n const endTime = startTime + measure.duration / 1000;\n\n startInactiveSpan({\n name: 'init',\n attributes: {\n [SENTRY_OP]: UI_MOUNT,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',\n },\n startTime,\n onlyIfParent: true,\n })?.end(endTime);\n performance.clearMarks(startName);\n performance.clearMarks(endName);\n\n performance.clearMeasures(measureName);\n}\n\nfunction _hasPerformanceSupport(): { HAS_PERFORMANCE: boolean; HAS_PERFORMANCE_TIMING: boolean } {\n // TS says that all of these methods are always available, but some of them may not be supported in older browsers\n // So we \"pretend\" they are all optional in order to be able to check this properly without TS complaining\n const _performance = window.performance as {\n clearMarks?: Performance['clearMarks'];\n clearMeasures?: Performance['clearMeasures'];\n measure?: Performance['measure'];\n getEntriesByName?: Performance['getEntriesByName'];\n };\n const HAS_PERFORMANCE = Boolean(_performance?.clearMarks && _performance.clearMeasures);\n const HAS_PERFORMANCE_TIMING = Boolean(\n _performance.measure && _performance.getEntriesByName && browserPerformanceTimeOrigin !== undefined,\n );\n\n return {\n HAS_PERFORMANCE,\n HAS_PERFORMANCE_TIMING,\n };\n}\n","import {\n addIntegration,\n browserTracingIntegration as originalBrowserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n} from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type ApplicationInstance from '@ember/application/instance';\nimport { instrumentEmberAppInstanceForPerformance } from './instrumentEmberAppInstanceForPerformance.ts';\nimport { instrumentGlobalsForPerformance } from './instrumentEmberGlobals.ts';\nimport { isTesting, macroCondition } from '@embroider/macros';\n\ntype EmberBrowserTracingIntegrationOptions = Parameters<typeof originalBrowserTracingIntegration>[0] & {\n appInstance: ApplicationInstance;\n disableRunloopPerformance?: boolean;\n minimumRunloopQueueDuration?: number;\n disableInstrumentComponents?: boolean;\n minimumComponentRenderDuration?: number;\n enableComponentDefinitions?: boolean;\n disableInitialLoadInstrumentation?: boolean;\n};\n\nlet _initialized = false;\n\nexport function browserTracingIntegration(options: EmberBrowserTracingIntegrationOptions): Integration {\n const { appInstance } = options;\n\n const instrumentNavigation = options.instrumentNavigation ?? true;\n const instrumentPageLoad = options.instrumentPageLoad ?? true;\n\n const integration = originalBrowserTracingIntegration({\n ...options,\n instrumentNavigation: false,\n instrumentPageLoad: false,\n });\n\n const appInstancePerformanceConfig = {\n disableRunloopPerformance: options.disableRunloopPerformance ?? false,\n instrumentPageLoad,\n instrumentNavigation,\n };\n\n const globalsPerformanceConfig = {\n disableRunloopPerformance: options.disableRunloopPerformance ?? false,\n minimumRunloopQueueDuration: options.minimumRunloopQueueDuration,\n disableInstrumentComponents: options.disableInstrumentComponents ?? false,\n minimumComponentRenderDuration: options.minimumComponentRenderDuration,\n enableComponentDefinitions: options.enableComponentDefinitions ?? false,\n disableInitialLoadInstrumentation: options.disableInitialLoadInstrumentation ?? false,\n };\n\n return {\n ...integration,\n afterAllSetup(client) {\n integration.afterAllSetup(client);\n\n instrumentEmberAppInstanceForPerformance(\n client,\n appInstance,\n appInstancePerformanceConfig,\n startBrowserTracingPageLoadSpan,\n startBrowserTracingNavigationSpan,\n );\n\n // We only want to run this once in tests!\n if (macroCondition(isTesting())) {\n if (_initialized) {\n return;\n }\n }\n\n instrumentGlobalsForPerformance(globalsPerformanceConfig);\n _initialized = true;\n },\n };\n}\n\n/**\n * Utility to simplify adding the browser tracing integration to an app instance.\n */\nexport function instrumentAppInstancePerformance(\n appInstance: ApplicationInstance,\n options?: Partial<Parameters<typeof browserTracingIntegration>[0]>,\n): void {\n // Disable in FastBoot — we only want to run Sentry client-side\n const fastboot = appInstance.lookup('service:fastboot') as { isFastBoot: boolean } | undefined;\n if (fastboot?.isFastBoot) {\n return;\n }\n\n addIntegration(\n browserTracingIntegration({\n ...options,\n appInstance,\n }),\n );\n}\n"],"names":["init","config","initConfig","applySdkMetadata","Sentry","instrumentRoutePerformance","BaseRoute","instrumentFunction","hookName","name","fn","args","startSpan","attributes","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SENTRY_OP","FUNCTION","CODE_FUNCTION_NAME","onlyIfParent","routeName","beforeModel","fullRouteName","bind","model","afterModel","setupController","getBackburner","_backburner","run","backburner","on","off","instrumentEmberAppInstanceForPerformance","client","appInstance","startBrowserTracingPageLoadSpan","startBrowserTracingNavigationSpan","disableRunloopPerformance","instrumentPageLoad","instrumentNavigation","routerService","getRouterService","recognize","routerMain","getRouterMain","location","activeRootSpan","transitionSpan","url","_getLocationURL","routeInfo","undefined","hasSpanStreamingEnabled","PAGELOAD_SPAN_NAME_FALLBACK","WINDOW","pathname","SENTRY_SEGMENT_NAME_SOURCE","_getRouteUrlAttributes","params","toRoute","finishActiveTransaction","_","nextInstance","end","transition","fromRoute","getTransitionInformation","getCurrentScope","setTransactionName","transitionIsIntermediate","targetUrl","intent","urlAttributes","to","spanToJSON","updateName","setAttributes","startInactiveSpan","ROUTER","ROUTER_SPAN_NAME_FALLBACK","currentURL","fullUrl","lookup","externalRouter","router","from","currentRouteName","getUrlPathFromEmberLocation","withoutQuery","split","includes","hashPart","substring","indexOf","startsWith","buildUrlTemplate","path","template","paramEntries","Object","entries","filter","entry","length","sort","a","b","key","value","replace","URL_PATH","URL_FULL","filterCollectedUrl","getAbsoluteUrl","URL_TEMPLATE","getURL","formatURL","implementation","rootURL","isIntermediate","localName","instrumentGlobalsForPerformance","minimumRunloopQueueDuration","disableInstrumentComponents","minimumComponentRenderDuration","enableComponentDefinitions","disableInitialLoadInstrumentation","_instrumentEmberRunloop","_instrumentComponents","_instrumentInitialLoad","currentQueueStart","instrumentedEmberQueues","previousInstance","activeSpan","getActiveSpan","timestampInSeconds","processQueue","queue","now","minQueueDuration","UI_TASK","startTime","stillActiveSpan","forEach","scheduleOnce","_processComponentRenderBefore","payload","beforeEntries","set","_processComponentRenderAfter","op","minComponentDuration","begin","get","delete","componentRenderDuration","containerKey","object","UI_COMPONENT_NAME","WeakMap","beforeComponentDefinitionEntries","_subscribeToRenderEvents","subscribe","before","_name","_timestamp","after","UI_RENDER","startName","endName","HAS_PERFORMANCE","HAS_PERFORMANCE_TIMING","_hasPerformanceSupport","performance","window","origin","browserPerformanceTimeOrigin","measureName","startMarkExists","getEntriesByName","endMarkExists","measure","measures","endTime","duration","UI_MOUNT","clearMarks","clearMeasures","_performance","Boolean","_initialized","browserTracingIntegration","options","integration","originalBrowserTracingIntegration","appInstancePerformanceConfig","globalsPerformanceConfig","afterAllSetup","macroCondition","isTesting","instrumentAppInstancePerformance","fastboot","isFastBoot","addIntegration"],"mappings":";;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,IAAIA,CAACC,MAAuB,EAAsB;AAChE,EAAA,MAAMC,UAAU,GAAG;IAAE,GAAGD;GAAQ;AAEhCE,EAAAA,gBAAgB,CAACD,UAAU,EAAE,OAAO,CAAC;AAErC,EAAA,OAAOE,MAAM,CAACJ,IAAI,CAACE,UAAU,CAAC;AAChC;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,0BAA0BA,CAA6BC,SAAY,EAAK;EACtF,MAAMC,kBAAkB,GAAG,OACzBC,QAAgB,EAChBC,IAAY,EAEZC,EAA2B,EAC3BC,IAAe,KACM;AACrB,IAAA,OAAOC,SAAS,CACd;AACEC,MAAAA,UAAU,EAAE;QACV,CAACC,gCAAgC,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iC,EAAEkE,OAAO,CAAClE,iCAAiC,IAAI;GACjF;EAED,OAAO;AACL,IAAA,GAAGmE,WAAW;IACdI,aAAaA,CAACpK,MAAM,EAAE;AACpBgK,MAAAA,WAAW,CAACI,aAAa,CAACpK,MAAM,CAAC;MAEjCD,wCAAwC,CACtCC,MAAM,EACNC,WAAW,EACXiK,4BAA4B,EAC5BhK,+BAA+B,EAC/BC,iCACF,CAAC;;AAED;AACA,MAAA,IAAIkK,cAAc,CAACC,SAAS,EAAE,CAAC,EAAE;AAC/B,QAAA,IAAIT,YAAY,EAAE;AAChB,UAAA;AACF,QAAA;AACF,MAAA;MAEArE,+BAA+B,CAAC2E,wBAAwB,CAAC;AACzDN,MAAAA,YAAY,GAAG,IAAI;AACrB,IAAA;GACD;AACH;;AAEA;AACA;AACA;AACO,SAASU,gCAAgCA,CAC9CtK,WAAgC,EAChC8J,OAAkE,EAC5D;AACN;AACA,EAAA,MAAMS,QAAQ,GAAGvK,WAAW,CAACgD,MAAM,CAAC,kBAAkB,CAAwC;EAC9F,IAAIuH,QAAQ,EAAEC,UAAU,EAAE;AACxB,IAAA;AACF,EAAA;EAEAC,cAAc,CACZZ,yBAAyB,CAAC;AACxB,IAAA,GAAGC,OAAO;AACV9J,IAAAA;AACF,GAAC,CACH,CAAC;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/ember",
|
|
3
|
-
"version": "11.0.0-
|
|
3
|
+
"version": "11.0.0-beta.0",
|
|
4
4
|
"description": "Official Sentry SDK for Ember.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@embroider/addon-shim": "^1.10.2",
|
|
46
46
|
"@embroider/macros": "^1.20.2",
|
|
47
|
-
"@sentry/browser": "11.0.0-
|
|
47
|
+
"@sentry/browser": "11.0.0-beta.0",
|
|
48
48
|
"@sentry/conventions": "^0.20.0",
|
|
49
|
-
"@sentry/core": "11.0.0-
|
|
49
|
+
"@sentry/core": "11.0.0-beta.0",
|
|
50
50
|
"decorator-transforms": "^2.3.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
URL_PATH,
|
|
14
14
|
URL_TEMPLATE,
|
|
15
15
|
} from '@sentry/conventions/attributes';
|
|
16
|
+
import { ROUTER } from '@sentry/conventions/op';
|
|
16
17
|
import {
|
|
17
18
|
filterCollectedUrl,
|
|
18
19
|
getCurrentScope,
|
|
@@ -145,8 +146,7 @@ export function instrumentEmberAppInstanceForPerformance(
|
|
|
145
146
|
|
|
146
147
|
transitionSpan = startInactiveSpan({
|
|
147
148
|
attributes: {
|
|
148
|
-
|
|
149
|
-
[SENTRY_OP]: 'router',
|
|
149
|
+
[SENTRY_OP]: ROUTER,
|
|
150
150
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',
|
|
151
151
|
},
|
|
152
152
|
// With span streaming, span names have to be low cardinality, and Ember gives us no route
|