@sentry/ember 7.112.1 → 7.113.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.
package/addon/index.ts CHANGED
@@ -5,7 +5,7 @@ import { getOwnConfig, isDevelopingApp, macroCondition } from '@embroider/macros
5
5
  import { startSpan } from '@sentry/browser';
6
6
  import type { BrowserOptions } from '@sentry/browser';
7
7
  import * as Sentry from '@sentry/browser';
8
- import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, applySdkMetadata } from '@sentry/core';
8
+ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, applySdkMetadata } from '@sentry/core';
9
9
  import { GLOBAL_OBJ } from '@sentry/utils';
10
10
  import Ember from 'ember';
11
11
 
@@ -83,10 +83,12 @@ export const instrumentRoutePerformance = <T extends RouteConstructor>(BaseRoute
83
83
  return startSpan(
84
84
  {
85
85
  attributes: {
86
- [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'ember',
86
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom',
87
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.ember',
87
88
  },
88
89
  op,
89
90
  name: description,
91
+ onlyIfParent: true,
90
92
  },
91
93
  () => {
92
94
  return fn(...args);
@@ -155,6 +155,12 @@ export function _instrumentEmberRouter(
155
155
 
156
156
  routerService.on('routeWillChange', (transition: Transition) => {
157
157
  const { fromRoute, toRoute } = getTransitionInformation(transition, routerService);
158
+
159
+ // We want to ignore loading && error routes
160
+ if (transitionIsIntermediate(transition)) {
161
+ return;
162
+ }
163
+
158
164
  activeRootSpan?.end();
159
165
 
160
166
  activeRootSpan = startBrowserTracingNavigationSpan(client, {
@@ -180,8 +186,8 @@ export function _instrumentEmberRouter(
180
186
  });
181
187
  });
182
188
 
183
- routerService.on('routeDidChange', () => {
184
- if (!transitionSpan || !activeRootSpan) {
189
+ routerService.on('routeDidChange', transition => {
190
+ if (!transitionSpan || !activeRootSpan || transitionIsIntermediate(transition)) {
185
191
  return;
186
192
  }
187
193
  transitionSpan.end();
@@ -503,3 +509,18 @@ function _instrumentNavigation(
503
509
  export default {
504
510
  initialize,
505
511
  };
512
+
513
+ function transitionIsIntermediate(transition: Transition): boolean {
514
+ // We want to use ignore, as this may actually be defined on new versions
515
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
516
+ // @ts-ignore This actually exists on newer versions
517
+ const isIntermediate: boolean | undefined = transition.isIntermediate;
518
+
519
+ if (typeof isIntermediate === 'boolean') {
520
+ return isIntermediate;
521
+ }
522
+
523
+ // For versions without this, we look if the route is a `.loading` or `.error` route
524
+ // This is not perfect and may false-positive in some cases, but it's the best we can do
525
+ return transition.to?.localName === 'loading' || transition.to?.localName === 'error';
526
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/ember",
3
- "version": "7.112.1",
3
+ "version": "7.113.0",
4
4
  "description": "Official Sentry SDK for Ember.js",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/ember",
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@embroider/macros": "^1.9.0",
35
- "@sentry/browser": "7.112.1",
36
- "@sentry/core": "7.112.1",
37
- "@sentry/types": "7.112.1",
38
- "@sentry/utils": "7.112.1",
35
+ "@sentry/browser": "7.113.0",
36
+ "@sentry/core": "7.113.0",
37
+ "@sentry/types": "7.113.0",
38
+ "@sentry/utils": "7.113.0",
39
39
  "ember-auto-import": "^1.12.1 || ^2.4.3",
40
40
  "ember-cli-babel": "^7.26.11",
41
41
  "ember-cli-htmlbars": "^6.1.1",