@sentry/ember 7.45.0 → 7.47.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.
|
@@ -3,13 +3,14 @@ import { run, _backburner, scheduleOnce } from '@ember/runloop';
|
|
|
3
3
|
import { subscribe } from '@ember/instrumentation';
|
|
4
4
|
import * as Sentry from '@sentry/browser';
|
|
5
5
|
import { ExtendedBackburner } from '@sentry/ember/runloop';
|
|
6
|
-
import { Span, Transaction
|
|
6
|
+
import { Span, Transaction } from '@sentry/types';
|
|
7
7
|
import { EmberRunQueues } from '@ember/runloop/-private/types';
|
|
8
8
|
import { getActiveTransaction } from '..';
|
|
9
9
|
import { browserPerformanceTimeOrigin, GLOBAL_OBJ, timestampWithMs } from '@sentry/utils';
|
|
10
10
|
import { macroCondition, isTesting, getOwnConfig } from '@embroider/macros';
|
|
11
11
|
import { EmberSentryConfig, GlobalConfig, OwnConfig } from '../types';
|
|
12
12
|
import RouterService from '@ember/routing/router-service';
|
|
13
|
+
import type { BaseClient } from '@sentry/core';
|
|
13
14
|
|
|
14
15
|
function getSentryConfig() {
|
|
15
16
|
const _global = GLOBAL_OBJ as typeof GLOBAL_OBJ & GlobalConfig;
|
|
@@ -390,58 +391,49 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
|
|
|
390
391
|
|
|
391
392
|
const idleTimeout = config.transitionTimeout || 5000;
|
|
392
393
|
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
394
|
+
const browserTracing = new BrowserTracing({
|
|
395
|
+
routingInstrumentation: (customStartTransaction, startTransactionOnPageLoad) => {
|
|
396
|
+
const routerMain = appInstance.lookup('router:main');
|
|
397
|
+
let routerService = appInstance.lookup('service:router') as
|
|
398
|
+
| RouterService & { externalRouter?: RouterService; _hasMountedSentryPerformanceRouting?: boolean };
|
|
399
|
+
|
|
400
|
+
if (routerService.externalRouter) {
|
|
401
|
+
// Using ember-engines-router-service in an engine.
|
|
402
|
+
routerService = routerService.externalRouter;
|
|
403
|
+
}
|
|
404
|
+
if (routerService._hasMountedSentryPerformanceRouting) {
|
|
405
|
+
// Routing listens to route changes on the main router, and should not be initialized multiple times per page.
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
if (!routerService.recognize) {
|
|
409
|
+
// Router is missing critical functionality to limit cardinality of the transaction names.
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
routerService._hasMountedSentryPerformanceRouting = true;
|
|
413
|
+
_instrumentEmberRouter(routerService, routerMain, config, customStartTransaction, startTransactionOnPageLoad);
|
|
414
|
+
},
|
|
415
|
+
idleTimeout,
|
|
416
|
+
...browserTracingOptions,
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
if (macroCondition(isTesting())) {
|
|
420
|
+
const client = Sentry.getCurrentHub().getClient();
|
|
421
|
+
|
|
422
|
+
if (
|
|
423
|
+
client &&
|
|
424
|
+
(client as BaseClient<any>).getIntegrationById &&
|
|
425
|
+
(client as BaseClient<any>).getIntegrationById('BrowserTracing')
|
|
426
|
+
) {
|
|
427
|
+
// Initializers are called more than once in tests, causing the integrations to not be setup correctly.
|
|
428
|
+
return;
|
|
428
429
|
}
|
|
429
430
|
}
|
|
430
431
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
// This is a temporary hack because the BrowserTracing integration cannot have a static `id` field for tree
|
|
435
|
-
// shaking reasons. However, `getIntegration` needs that field.
|
|
436
|
-
FakeBrowserTracingClass,
|
|
437
|
-
)
|
|
438
|
-
) {
|
|
439
|
-
// Initializers are called more than once in tests, causing the integrations to not be setup correctly.
|
|
440
|
-
return;
|
|
432
|
+
const client = Sentry.getCurrentHub().getClient();
|
|
433
|
+
if (client && client.addIntegration) {
|
|
434
|
+
client.addIntegration(browserTracing);
|
|
441
435
|
}
|
|
442
436
|
|
|
443
|
-
Sentry.init(sentryConfig); // Call init again to rebind client with new integration list in addition to the defaults
|
|
444
|
-
|
|
445
437
|
_instrumentEmberRunloop(config);
|
|
446
438
|
_instrumentComponents(config);
|
|
447
439
|
_instrumentInitialLoad(config);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/ember",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.47.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",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@embroider/macros": "^1.9.0",
|
|
32
|
-
"@sentry/browser": "7.
|
|
33
|
-
"@sentry/types": "7.
|
|
34
|
-
"@sentry/utils": "7.
|
|
32
|
+
"@sentry/browser": "7.47.0",
|
|
33
|
+
"@sentry/types": "7.47.0",
|
|
34
|
+
"@sentry/utils": "7.47.0",
|
|
35
35
|
"ember-auto-import": "^1.12.1 || ^2.4.3",
|
|
36
36
|
"ember-cli-babel": "^7.26.11",
|
|
37
37
|
"ember-cli-htmlbars": "^6.1.1",
|