@sentry/angular 8.0.0-alpha.2 → 8.0.0-alpha.3
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/README.md +25 -23
- package/bundles/sentry-angular.umd.js +49 -120
- package/bundles/sentry-angular.umd.js.map +1 -1
- package/bundles/sentry-angular.umd.min.js +1 -1
- package/bundles/sentry-angular.umd.min.js.map +1 -1
- package/esm2015/index.js +2 -9
- package/esm2015/tracing.js +40 -109
- package/fesm2015/sentry-angular.js +41 -109
- package/fesm2015/sentry-angular.js.map +1 -1
- package/index.d.ts +1 -3
- package/package.json +6 -6
- package/sentry-angular.metadata.json +1 -1
- package/tracing.d.ts +19 -20
package/README.md
CHANGED
|
@@ -17,11 +17,14 @@
|
|
|
17
17
|
|
|
18
18
|
## Angular Version Compatibility
|
|
19
19
|
|
|
20
|
-
**Important**: This package is not compatible with Angular 16 or newer. Please use
|
|
20
|
+
**Important**: This package is not compatible with Angular 16 or newer. Please use
|
|
21
|
+
[`@sentry/angular-ivy`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy) instead.
|
|
21
22
|
|
|
22
|
-
If you're using Angular 12 or newer, we recommend using `@sentry/angular-ivy` for native support with Angular's
|
|
23
|
+
If you're using Angular 12 or newer, we recommend using `@sentry/angular-ivy` for native support with Angular's
|
|
24
|
+
rendering engine Ivy.
|
|
23
25
|
|
|
24
|
-
This SDK still officially supports Angular 10-15. If you are using an older version of Angular and experience problems
|
|
26
|
+
This SDK still officially supports Angular 10-15. If you are using an older version of Angular and experience problems
|
|
27
|
+
with the Angular SDK, we recommend downgrading the SDK to version 6.x.
|
|
25
28
|
|
|
26
29
|
## General
|
|
27
30
|
|
|
@@ -80,26 +83,23 @@ see `ErrorHandlerOptions` interface in `src/errorhandler.ts`.
|
|
|
80
83
|
|
|
81
84
|
### Tracing
|
|
82
85
|
|
|
83
|
-
`@sentry/angular` exports a Trace Service, Directive and Decorators that leverage the tracing
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
`@sentry/angular` exports a Trace Service, Directive and Decorators that leverage the tracing features to add
|
|
87
|
+
Angular-related spans to transactions. If tracing is not enabled, this functionality will not work. The SDK's
|
|
88
|
+
`TraceService` itself tracks route changes and durations, while directive and decorators are tracking components
|
|
89
|
+
initializations.
|
|
87
90
|
|
|
88
91
|
#### Install
|
|
89
92
|
|
|
90
93
|
Registering a Trace Service is a 3-step process.
|
|
91
94
|
|
|
92
|
-
1. Register and configure the `BrowserTracing` integration, including custom Angular routing
|
|
93
|
-
instrumentation:
|
|
95
|
+
1. Register and configure the `BrowserTracing` integration, including custom Angular routing instrumentation:
|
|
94
96
|
|
|
95
97
|
```javascript
|
|
96
98
|
import { init, browserTracingIntegration } from '@sentry/angular';
|
|
97
99
|
|
|
98
100
|
init({
|
|
99
101
|
dsn: '__DSN__',
|
|
100
|
-
integrations: [
|
|
101
|
-
browserTracingIntegration(),
|
|
102
|
-
],
|
|
102
|
+
integrations: [browserTracingIntegration()],
|
|
103
103
|
tracePropagationTargets: ['localhost', 'https://yourserver.io/api'],
|
|
104
104
|
tracesSampleRate: 1,
|
|
105
105
|
});
|
|
@@ -181,39 +181,40 @@ Then, inside your component's template (keep in mind that the directive's name a
|
|
|
181
181
|
<app-footer trace="footer"></app-footer>
|
|
182
182
|
```
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
_TraceClass:_ used to track a duration between `OnInit` and `AfterViewInit` lifecycle hooks in components:
|
|
185
185
|
|
|
186
186
|
```javascript
|
|
187
187
|
import { Component } from '@angular/core';
|
|
188
|
-
import {
|
|
188
|
+
import { TraceClass } from '@sentry/angular';
|
|
189
189
|
|
|
190
190
|
@Component({
|
|
191
191
|
selector: 'layout-header',
|
|
192
192
|
templateUrl: './header.component.html',
|
|
193
193
|
})
|
|
194
|
-
@
|
|
194
|
+
@TraceClass()
|
|
195
195
|
export class HeaderComponent {
|
|
196
196
|
// ...
|
|
197
197
|
}
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
_TraceMethod:_ used to track a specific lifecycle hooks as point-in-time spans in components:
|
|
201
201
|
|
|
202
202
|
```javascript
|
|
203
203
|
import { Component, OnInit } from '@angular/core';
|
|
204
|
-
import {
|
|
204
|
+
import { TraceMethod } from '@sentry/angular';
|
|
205
205
|
|
|
206
206
|
@Component({
|
|
207
207
|
selector: 'app-footer',
|
|
208
208
|
templateUrl: './footer.component.html',
|
|
209
209
|
})
|
|
210
210
|
export class FooterComponent implements OnInit {
|
|
211
|
-
@
|
|
211
|
+
@TraceMethod()
|
|
212
212
|
ngOnInit() {}
|
|
213
213
|
}
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
You can also add your own custom spans via `startSpan()`. For example, if you'd like to track the duration of Angular
|
|
216
|
+
You can also add your own custom spans via `startSpan()`. For example, if you'd like to track the duration of Angular
|
|
217
|
+
boostraping process, you can do it as follows:
|
|
217
218
|
|
|
218
219
|
```javascript
|
|
219
220
|
import { enableProdMode } from '@angular/core';
|
|
@@ -223,12 +224,13 @@ import { init, startSpan } from '@sentry/angular';
|
|
|
223
224
|
import { AppModule } from './app/app.module';
|
|
224
225
|
|
|
225
226
|
// ...
|
|
226
|
-
startSpan(
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
startSpan(
|
|
228
|
+
{
|
|
229
|
+
name: 'platform-browser-dynamic',
|
|
230
|
+
op: 'ui.angular.bootstrap',
|
|
229
231
|
},
|
|
230
232
|
async () => {
|
|
231
233
|
await platformBrowserDynamic().bootstrapModule(AppModule);
|
|
232
|
-
}
|
|
234
|
+
},
|
|
233
235
|
);
|
|
234
236
|
```
|
|
@@ -216,39 +216,6 @@
|
|
|
216
216
|
var ANGULAR_OP = 'ui.angular';
|
|
217
217
|
|
|
218
218
|
var instrumentationInitialized;
|
|
219
|
-
var stashedStartTransaction;
|
|
220
|
-
var stashedStartTransactionOnLocationChange;
|
|
221
|
-
var hooksBasedInstrumentation = false;
|
|
222
|
-
/**
|
|
223
|
-
* Creates routing instrumentation for Angular Router.
|
|
224
|
-
*
|
|
225
|
-
* @deprecated Use `browserTracingIntegration()` instead, which includes Angular-specific instrumentation out of the box.
|
|
226
|
-
*/
|
|
227
|
-
function routingInstrumentation(customStartTransaction, startTransactionOnPageLoad, startTransactionOnLocationChange) {
|
|
228
|
-
var _a;
|
|
229
|
-
if (startTransactionOnPageLoad === void 0) { startTransactionOnPageLoad = true; }
|
|
230
|
-
if (startTransactionOnLocationChange === void 0) { startTransactionOnLocationChange = true; }
|
|
231
|
-
instrumentationInitialized = true;
|
|
232
|
-
stashedStartTransaction = customStartTransaction;
|
|
233
|
-
stashedStartTransactionOnLocationChange = startTransactionOnLocationChange;
|
|
234
|
-
if (startTransactionOnPageLoad && Sentry.WINDOW && Sentry.WINDOW.location) {
|
|
235
|
-
customStartTransaction({
|
|
236
|
-
name: Sentry.WINDOW.location.pathname,
|
|
237
|
-
op: 'pageload',
|
|
238
|
-
origin: 'auto.pageload.angular',
|
|
239
|
-
attributes: (_a = {},
|
|
240
|
-
_a[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'url',
|
|
241
|
-
_a),
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Creates routing instrumentation for Angular Router.
|
|
247
|
-
*
|
|
248
|
-
* @deprecated Use `browserTracingIntegration()` instead, which includes Angular-specific instrumentation out of the box.
|
|
249
|
-
*/
|
|
250
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
251
|
-
var instrumentAngularRouting = routingInstrumentation;
|
|
252
219
|
/**
|
|
253
220
|
* A custom browser tracing integration for Angular.
|
|
254
221
|
*
|
|
@@ -260,18 +227,19 @@
|
|
|
260
227
|
// That way, the TraceService will not actually do anything, functionally disabling this.
|
|
261
228
|
if (options.instrumentNavigation !== false) {
|
|
262
229
|
instrumentationInitialized = true;
|
|
263
|
-
hooksBasedInstrumentation = true;
|
|
264
230
|
}
|
|
265
231
|
return Sentry.browserTracingIntegration(Object.assign(Object.assign({}, options), { instrumentNavigation: false }));
|
|
266
232
|
}
|
|
267
233
|
/**
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.
|
|
234
|
+
* This function is extracted to make unit testing easier.
|
|
271
235
|
*/
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
|
|
236
|
+
function _updateSpanAttributesForParametrizedUrl(route, span) {
|
|
237
|
+
var attributes = (span && Sentry.spanToJSON(span).data) || {};
|
|
238
|
+
if (span && attributes[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'url') {
|
|
239
|
+
span.updateName(route);
|
|
240
|
+
span.setAttribute(Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');
|
|
241
|
+
span.setAttribute(Sentry.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto." + Sentry.spanToJSON(span).op + ".angular");
|
|
242
|
+
}
|
|
275
243
|
}
|
|
276
244
|
/**
|
|
277
245
|
* Angular's Service responsible for hooking into Angular Router and tracking current navigation process.
|
|
@@ -282,7 +250,7 @@
|
|
|
282
250
|
var _this = this;
|
|
283
251
|
this._router = _router;
|
|
284
252
|
this.navStart$ = this._router.events.pipe(operators.filter(function (event) { return event instanceof i1.NavigationStart; }), operators.tap(function (navigationEvent) {
|
|
285
|
-
var _a, _b
|
|
253
|
+
var _a, _b;
|
|
286
254
|
if (!instrumentationInitialized) {
|
|
287
255
|
IS_DEBUG_BUILD &&
|
|
288
256
|
utils.logger.error('Angular integration has tracing enabled, but Tracing integration is not configured');
|
|
@@ -292,9 +260,9 @@
|
|
|
292
260
|
_this._routingSpan.end();
|
|
293
261
|
_this._routingSpan = null;
|
|
294
262
|
}
|
|
295
|
-
var client =
|
|
263
|
+
var client = Sentry.getClient();
|
|
296
264
|
var strippedUrl = utils.stripUrlQueryAndFragment(navigationEvent.url);
|
|
297
|
-
if (client
|
|
265
|
+
if (client) {
|
|
298
266
|
// see comment in `_isPageloadOngoing` for rationale
|
|
299
267
|
if (!_this._isPageloadOngoing()) {
|
|
300
268
|
Sentry.startBrowserTracingNavigationSpan(client, {
|
|
@@ -312,7 +280,7 @@
|
|
|
312
280
|
_this._pageloadOngoing = false;
|
|
313
281
|
}
|
|
314
282
|
_this._routingSpan =
|
|
315
|
-
|
|
283
|
+
Sentry.startInactiveSpan({
|
|
316
284
|
name: "" + navigationEvent.url,
|
|
317
285
|
op: ANGULAR_ROUTING_OP,
|
|
318
286
|
attributes: Object.assign((_b = {}, _b[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.ui.angular', _b[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'url', _b.url = strippedUrl, _b), (navigationEvent.navigationTrigger && {
|
|
@@ -321,29 +289,6 @@
|
|
|
321
289
|
}) || null;
|
|
322
290
|
return;
|
|
323
291
|
}
|
|
324
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
325
|
-
var activeTransaction = getActiveTransaction();
|
|
326
|
-
if (!activeTransaction && stashedStartTransactionOnLocationChange) {
|
|
327
|
-
activeTransaction = stashedStartTransaction({
|
|
328
|
-
name: strippedUrl,
|
|
329
|
-
op: 'navigation',
|
|
330
|
-
origin: 'auto.navigation.angular',
|
|
331
|
-
attributes: (_c = {},
|
|
332
|
-
_c[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'url',
|
|
333
|
-
_c),
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
if (activeTransaction) {
|
|
337
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
338
|
-
_this._routingSpan = activeTransaction.startChild({
|
|
339
|
-
name: "" + navigationEvent.url,
|
|
340
|
-
op: ANGULAR_ROUTING_OP,
|
|
341
|
-
origin: 'auto.ui.angular',
|
|
342
|
-
attributes: Object.assign({ url: strippedUrl }, (navigationEvent.navigationTrigger && {
|
|
343
|
-
navigationTrigger: navigationEvent.navigationTrigger,
|
|
344
|
-
})),
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
292
|
}));
|
|
348
293
|
// The ResolveEnd event is fired when the Angular router has resolved the URL and
|
|
349
294
|
// the parameter<->value mapping. It holds the new resolved router state with
|
|
@@ -355,15 +300,12 @@
|
|
|
355
300
|
// a navigation.
|
|
356
301
|
this.resEnd$ = this._router.events.pipe(operators.filter(function (event) { return event instanceof i1.ResolveEnd; }), operators.tap(function (event) {
|
|
357
302
|
var route = getParameterizedRouteFromSnapshot(event.state.root);
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
// TODO (v8 / #5416): revisit the source condition. Do we want to make the parameterized route the default?
|
|
361
|
-
var attributes = (transaction && core.spanToJSON(transaction).data) || {};
|
|
362
|
-
if (transaction && attributes[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'url') {
|
|
363
|
-
transaction.updateName(route);
|
|
364
|
-
transaction.setAttribute(Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');
|
|
365
|
-
transaction.setAttribute(Sentry.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto." + core.spanToJSON(transaction).op + ".angular");
|
|
303
|
+
if (route) {
|
|
304
|
+
Sentry.getCurrentScope().setTransactionName(route);
|
|
366
305
|
}
|
|
306
|
+
var activeSpan = Sentry.getActiveSpan();
|
|
307
|
+
var rootSpan = activeSpan && Sentry.getRootSpan(activeSpan);
|
|
308
|
+
_updateSpanAttributesForParametrizedUrl(route, rootSpan);
|
|
367
309
|
}));
|
|
368
310
|
this.navEnd$ = this._router.events.pipe(operators.filter(function (event) { return event instanceof i1.NavigationEnd || event instanceof i1.NavigationCancel || event instanceof i1.NavigationError; }), operators.tap(function () {
|
|
369
311
|
if (_this._routingSpan) {
|
|
@@ -407,24 +349,20 @@
|
|
|
407
349
|
* - if `_pageloadOngoing` is already `false`, create a navigation root span
|
|
408
350
|
* - if there's no active/pageload root span, create a navigation root span
|
|
409
351
|
* - only if there's an ongoing pageload root span AND `_pageloadOngoing` is still `true,
|
|
410
|
-
*
|
|
352
|
+
* don't create a navigation root span
|
|
411
353
|
*/
|
|
412
354
|
TraceService.prototype._isPageloadOngoing = function () {
|
|
413
355
|
if (!this._pageloadOngoing) {
|
|
414
356
|
// pageload is already finished, no need to update
|
|
415
357
|
return false;
|
|
416
358
|
}
|
|
417
|
-
var activeSpan =
|
|
359
|
+
var activeSpan = Sentry.getActiveSpan();
|
|
418
360
|
if (!activeSpan) {
|
|
419
361
|
this._pageloadOngoing = false;
|
|
420
362
|
return false;
|
|
421
363
|
}
|
|
422
|
-
var rootSpan =
|
|
423
|
-
|
|
424
|
-
this._pageloadOngoing = false;
|
|
425
|
-
return false;
|
|
426
|
-
}
|
|
427
|
-
this._pageloadOngoing = core.spanToJSON(rootSpan).op === 'pageload';
|
|
364
|
+
var rootSpan = Sentry.getRootSpan(activeSpan);
|
|
365
|
+
this._pageloadOngoing = Sentry.spanToJSON(rootSpan).op === 'pageload';
|
|
428
366
|
return this._pageloadOngoing;
|
|
429
367
|
};
|
|
430
368
|
return TraceService;
|
|
@@ -448,17 +386,15 @@
|
|
|
448
386
|
* @inheritdoc
|
|
449
387
|
*/
|
|
450
388
|
TraceDirective.prototype.ngOnInit = function () {
|
|
389
|
+
var _a;
|
|
451
390
|
if (!this.componentName) {
|
|
452
391
|
this.componentName = UNKNOWN_COMPONENT;
|
|
453
392
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
if (activeTransaction) {
|
|
457
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
458
|
-
this._tracingSpan = activeTransaction.startChild({
|
|
393
|
+
if (Sentry.getActiveSpan()) {
|
|
394
|
+
this._tracingSpan = Sentry.startInactiveSpan({
|
|
459
395
|
name: "<" + this.componentName + ">",
|
|
460
396
|
op: ANGULAR_INIT_OP,
|
|
461
|
-
|
|
397
|
+
attributes: (_a = {}, _a[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.ui.angular.trace_directive', _a),
|
|
462
398
|
});
|
|
463
399
|
}
|
|
464
400
|
};
|
|
@@ -496,28 +432,26 @@
|
|
|
496
432
|
/**
|
|
497
433
|
* Decorator function that can be used to capture initialization lifecycle of the whole component.
|
|
498
434
|
*/
|
|
499
|
-
function
|
|
435
|
+
function TraceClass(options) {
|
|
500
436
|
var tracingSpan;
|
|
501
437
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
502
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
503
438
|
return function (target) {
|
|
504
439
|
var originalOnInit = target.prototype.ngOnInit;
|
|
505
440
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
506
441
|
target.prototype.ngOnInit = function () {
|
|
442
|
+
var _a;
|
|
507
443
|
var args = [];
|
|
508
444
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
509
445
|
args[_i] = arguments[_i];
|
|
510
446
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
});
|
|
520
|
-
}
|
|
447
|
+
tracingSpan = Sentry.startInactiveSpan({
|
|
448
|
+
onlyIfParent: true,
|
|
449
|
+
name: "<" + (options && options.name ? options.name : 'unnamed') + ">",
|
|
450
|
+
op: ANGULAR_INIT_OP,
|
|
451
|
+
attributes: (_a = {},
|
|
452
|
+
_a[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.ui.angular.trace_class_decorator',
|
|
453
|
+
_a),
|
|
454
|
+
});
|
|
521
455
|
if (originalOnInit) {
|
|
522
456
|
return originalOnInit.apply(this, args);
|
|
523
457
|
}
|
|
@@ -542,29 +476,27 @@
|
|
|
542
476
|
/**
|
|
543
477
|
* Decorator function that can be used to capture a single lifecycle methods of the component.
|
|
544
478
|
*/
|
|
545
|
-
function
|
|
546
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
479
|
+
function TraceMethod(options) {
|
|
480
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
547
481
|
return function (target, propertyKey, descriptor) {
|
|
548
482
|
var originalMethod = descriptor.value;
|
|
549
483
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
550
484
|
descriptor.value = function () {
|
|
485
|
+
var _a;
|
|
551
486
|
var args = [];
|
|
552
487
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
553
488
|
args[_i] = arguments[_i];
|
|
554
489
|
}
|
|
555
490
|
var now = utils.timestampInSeconds();
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
startTimestamp: now,
|
|
566
|
-
});
|
|
567
|
-
}
|
|
491
|
+
Sentry.startInactiveSpan({
|
|
492
|
+
onlyIfParent: true,
|
|
493
|
+
name: "<" + (options && options.name ? options.name : 'unnamed') + ">",
|
|
494
|
+
op: ANGULAR_OP + "." + String(propertyKey),
|
|
495
|
+
startTime: now,
|
|
496
|
+
attributes: (_a = {},
|
|
497
|
+
_a[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.ui.angular.trace_method_decorator',
|
|
498
|
+
_a),
|
|
499
|
+
}).end(now);
|
|
568
500
|
if (originalMethod) {
|
|
569
501
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
570
502
|
return originalMethod.apply(this, args);
|
|
@@ -602,17 +534,14 @@
|
|
|
602
534
|
*/
|
|
603
535
|
|
|
604
536
|
exports.SentryErrorHandler = SentryErrorHandler;
|
|
605
|
-
exports.
|
|
537
|
+
exports.TraceClass = TraceClass;
|
|
606
538
|
exports.TraceDirective = TraceDirective;
|
|
607
|
-
exports.
|
|
539
|
+
exports.TraceMethod = TraceMethod;
|
|
608
540
|
exports.TraceModule = TraceModule;
|
|
609
541
|
exports.TraceService = TraceService;
|
|
610
542
|
exports.browserTracingIntegration = browserTracingIntegration;
|
|
611
543
|
exports.createErrorHandler = createErrorHandler;
|
|
612
|
-
exports.getActiveTransaction = getActiveTransaction;
|
|
613
544
|
exports.init = init;
|
|
614
|
-
exports.instrumentAngularRouting = instrumentAngularRouting;
|
|
615
|
-
exports.routingInstrumentation = routingInstrumentation;
|
|
616
545
|
Object.keys(Sentry).forEach(function (k) {
|
|
617
546
|
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
618
547
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry-angular.umd.js","sources":["../../src/flags.ts","../../src/sdk.ts","../../src/zone.ts","../../src/errorhandler.ts","../../src/constants.ts","../../src/tracing.ts","../../src/sentry-angular.ts"],"sourcesContent":["/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * We define \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during our, or the user's\n * build process. Take care when introducing new flags - they must not throw if they are not replaced. See the Debug\n * Build Flags section in CONTRIBUTING.md.\n */\n\ndeclare const __SENTRY_DEBUG__: boolean;\n\n/** Flag that is true for debug builds, false otherwise. */\nexport const IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;\n","import { VERSION } from '@angular/core';\nimport type { BrowserOptions } from '@sentry/browser';\nimport { getDefaultIntegrations, init as browserInit, setContext } from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { IS_DEBUG_BUILD } from './flags';\n\n/**\n * Inits the Angular SDK\n */\nexport function init(options: BrowserOptions): void {\n const opts = {\n // Filter out BrowserApiErrors integration as it interferes with our Angular `ErrorHandler`:\n // BrowserApiErrors would catch certain errors before they reach the `ErrorHandler` and thus provide a\n // lower fidelity error than what `SentryErrorHandler` (see errorhandler.ts) would provide.\n // see:\n // - https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1453407097\n // - https://github.com/getsentry/sentry-javascript/issues/2744\n defaultIntegrations: getDefaultIntegrations(options).filter(integration => {\n return integration.name !== 'BrowserApiErrors';\n }),\n ...options,\n };\n\n applySdkMetadata(opts, 'angular');\n\n checkAndSetAngularVersion();\n browserInit(opts);\n}\n\nfunction checkAndSetAngularVersion(): void {\n const ANGULAR_MINIMUM_VERSION = 10;\n\n const angularVersion = VERSION && VERSION.major ? parseInt(VERSION.major, 10) : undefined;\n\n if (angularVersion) {\n if (angularVersion < ANGULAR_MINIMUM_VERSION) {\n IS_DEBUG_BUILD &&\n logger.warn(\n `The Sentry SDK does not officially support Angular ${angularVersion}.`,\n `This version of the Sentry SDK supports Angular ${ANGULAR_MINIMUM_VERSION} and above.`,\n 'Please consider upgrading your Angular version or downgrading the Sentry SDK.',\n );\n }\n setContext('angular', { version: angularVersion });\n }\n}\n","// That's the `global.Zone` exposed when the `zone.js` package is used.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const Zone: any;\n\n// There're 2 types of Angular applications:\n// 1) zone-full (by default)\n// 2) zone-less\n// The developer can avoid importing the `zone.js` package and tells Angular that\n// he is responsible for running the change detection by himself. This is done by\n// \"nooping\" the zone through `CompilerOptions` when bootstrapping the root module.\n// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\nconst isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.current;\n\n/**\n * The function that does the same job as `NgZone.runOutsideAngular`.\n */\nexport function runOutsideAngular<T>(callback: () => T): T {\n // The `Zone.root.run` basically will run the `callback` in the most parent zone.\n // Any asynchronous API used inside the `callback` won't catch Angular's zone\n // since `Zone.current` will reference `Zone.root`.\n // The Angular's zone is forked from the `Zone.root`. In this case, `zone.js` won't\n // trigger change detection, and `ApplicationRef.tick()` will not be run.\n // Caretaker note: we're using `Zone.root` except `NgZone.runOutsideAngular` since this\n // will require injecting the `NgZone` facade. That will create a breaking change for\n // projects already using the `@sentry/angular`.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return isNgZoneEnabled ? Zone.root.run(callback) : callback();\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport type { ErrorHandler as AngularErrorHandler } from '@angular/core';\nimport { Inject, Injectable } from '@angular/core';\nimport * as Sentry from '@sentry/browser';\nimport type { ReportDialogOptions } from '@sentry/browser';\nimport type { Event } from '@sentry/types';\nimport { isString } from '@sentry/utils';\n\nimport { runOutsideAngular } from './zone';\n\n/**\n * Options used to configure the behavior of the Angular ErrorHandler.\n */\nexport interface ErrorHandlerOptions {\n logErrors?: boolean;\n showDialog?: boolean;\n dialogOptions?: Omit<ReportDialogOptions, 'eventId'>;\n /**\n * Custom implementation of error extraction from the raw value captured by the Angular.\n * @param error Value captured by Angular's ErrorHandler provider\n * @param defaultExtractor Default implementation that can be used as the fallback in case of custom implementation\n */\n extractor?(error: unknown, defaultExtractor: (error: unknown) => unknown): unknown;\n}\n\n// https://github.com/angular/angular/blob/master/packages/core/src/util/errors.ts\nfunction tryToUnwrapZonejsError(error: unknown): unknown | Error {\n // TODO: once Angular14 is the minimum requirement ERROR_ORIGINAL_ERROR and\n // getOriginalError from error.ts can be used directly.\n return error && (error as { ngOriginalError: Error }).ngOriginalError\n ? (error as { ngOriginalError: Error }).ngOriginalError\n : error;\n}\n\nfunction extractHttpModuleError(error: HttpErrorResponse): string | Error {\n // The `error` property of http exception can be either an `Error` object, which we can use directly...\n if (isErrorOrErrorLikeObject(error.error)) {\n return error.error;\n }\n\n // ... or an`ErrorEvent`, which can provide us with the message but no stack...\n if (error.error instanceof ErrorEvent && error.error.message) {\n return error.error.message;\n }\n\n // ...or the request body itself, which we can use as a message instead.\n if (typeof error.error === 'string') {\n return `Server returned code ${error.status} with body \"${error.error}\"`;\n }\n\n // If we don't have any detailed information, fallback to the request message itself.\n return error.message;\n}\n\ntype ErrorCandidate = {\n name?: unknown;\n message?: unknown;\n stack?: unknown;\n};\n\nfunction isErrorOrErrorLikeObject(value: unknown): value is Error {\n if (value instanceof Error) {\n return true;\n }\n\n if (value === null || typeof value !== 'object') {\n return false;\n }\n\n const candidate = value as ErrorCandidate;\n\n return (\n isString(candidate.name) &&\n isString(candidate.message) &&\n (undefined === candidate.stack || isString(candidate.stack))\n );\n}\n\n/**\n * Implementation of Angular's ErrorHandler provider that can be used as a drop-in replacement for the stock one.\n */\n@Injectable({ providedIn: 'root' })\nclass SentryErrorHandler implements AngularErrorHandler {\n protected readonly _options: ErrorHandlerOptions;\n\n /* indicates if we already registered our the afterSendEvent handler */\n private _registeredAfterSendEventHandler;\n\n public constructor(@Inject('errorHandlerOptions') options?: ErrorHandlerOptions) {\n this._registeredAfterSendEventHandler = false;\n\n this._options = {\n logErrors: true,\n ...options,\n };\n }\n\n /**\n * Method called for every value captured through the ErrorHandler\n */\n public handleError(error: unknown): void {\n const extractedError = this._extractError(error) || 'Handled unknown error';\n\n // Capture handled exception and send it to Sentry.\n const eventId = runOutsideAngular(() =>\n Sentry.captureException(extractedError, {\n mechanism: { type: 'angular', handled: false },\n }),\n );\n\n // When in development mode, log the error to console for immediate feedback.\n if (this._options.logErrors) {\n // eslint-disable-next-line no-console\n console.error(extractedError);\n }\n\n // Optionally show user dialog to provide details on what happened.\n if (this._options.showDialog) {\n const client = Sentry.getClient();\n\n if (client && !this._registeredAfterSendEventHandler) {\n client.on('afterSendEvent', (event: Event) => {\n if (!event.type && event.event_id) {\n Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });\n }\n });\n\n // We only want to register this hook once in the lifetime of the error handler\n this._registeredAfterSendEventHandler = true;\n } else if (!client) {\n Sentry.showReportDialog({ ...this._options.dialogOptions, eventId });\n }\n }\n }\n\n /**\n * Used to pull a desired value that will be used to capture an event out of the raw value captured by ErrorHandler.\n */\n protected _extractError(error: unknown): unknown {\n // Allow custom overrides of extracting function\n if (this._options.extractor) {\n const defaultExtractor = this._defaultExtractor.bind(this);\n return this._options.extractor(error, defaultExtractor);\n }\n\n return this._defaultExtractor(error);\n }\n\n /**\n * Default implementation of error extraction that handles default error wrapping, HTTP responses, ErrorEvent and few other known cases.\n */\n protected _defaultExtractor(errorCandidate: unknown): unknown {\n const error = tryToUnwrapZonejsError(errorCandidate);\n\n // If it's http module error, extract as much information from it as we can.\n if (error instanceof HttpErrorResponse) {\n return extractHttpModuleError(error);\n }\n\n // We can handle messages and Error objects directly.\n if (typeof error === 'string' || isErrorOrErrorLikeObject(error)) {\n return error;\n }\n\n // Nothing was extracted, fallback to default error message.\n return null;\n }\n}\n\n/**\n * Factory function that creates an instance of a preconfigured ErrorHandler provider.\n */\nfunction createErrorHandler(config?: ErrorHandlerOptions): SentryErrorHandler {\n return new SentryErrorHandler(config);\n}\n\nexport { createErrorHandler, SentryErrorHandler };\n","export const ANGULAR_ROUTING_OP = 'ui.angular.routing';\n\nexport const ANGULAR_INIT_OP = 'ui.angular.init';\n\nexport const ANGULAR_OP = 'ui.angular';\n","/* eslint-disable max-lines */\nimport type { AfterViewInit, OnDestroy, OnInit } from '@angular/core';\nimport { Directive, Injectable, Input, NgModule } from '@angular/core';\nimport type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router';\n// Duplicated import to work around a TypeScript bug where it'd complain that `Router` isn't imported as a type.\n// We need to import it as a value to satisfy Angular dependency injection. So:\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { NavigationCancel, NavigationError, Router } from '@angular/router';\nimport { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n WINDOW,\n browserTracingIntegration as originalBrowserTracingIntegration,\n getCurrentScope,\n startBrowserTracingNavigationSpan,\n} from '@sentry/browser';\nimport { getActiveSpan, getClient, getRootSpan, spanToJSON, startInactiveSpan } from '@sentry/core';\nimport type { Integration, Span, Transaction, TransactionContext } from '@sentry/types';\nimport { logger, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/utils';\nimport type { Observable } from 'rxjs';\nimport { Subscription } from 'rxjs';\nimport { filter, tap } from 'rxjs/operators';\n\nimport { ANGULAR_INIT_OP, ANGULAR_OP, ANGULAR_ROUTING_OP } from './constants';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { runOutsideAngular } from './zone';\n\nlet instrumentationInitialized: boolean;\nlet stashedStartTransaction: (context: TransactionContext) => Transaction | undefined;\nlet stashedStartTransactionOnLocationChange: boolean;\n\nlet hooksBasedInstrumentation = false;\n\n/**\n * Creates routing instrumentation for Angular Router.\n *\n * @deprecated Use `browserTracingIntegration()` instead, which includes Angular-specific instrumentation out of the box.\n */\nexport function routingInstrumentation(\n customStartTransaction: (context: TransactionContext) => Transaction | undefined,\n startTransactionOnPageLoad: boolean = true,\n startTransactionOnLocationChange: boolean = true,\n): void {\n instrumentationInitialized = true;\n stashedStartTransaction = customStartTransaction;\n stashedStartTransactionOnLocationChange = startTransactionOnLocationChange;\n\n if (startTransactionOnPageLoad && WINDOW && WINDOW.location) {\n customStartTransaction({\n name: WINDOW.location.pathname,\n op: 'pageload',\n origin: 'auto.pageload.angular',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n });\n }\n}\n\n/**\n * Creates routing instrumentation for Angular Router.\n *\n * @deprecated Use `browserTracingIntegration()` instead, which includes Angular-specific instrumentation out of the box.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const instrumentAngularRouting = routingInstrumentation;\n\n/**\n * A custom browser tracing integration for Angular.\n *\n * Use this integration in combination with `TraceService`\n */\nexport function browserTracingIntegration(\n options: Parameters<typeof originalBrowserTracingIntegration>[0] = {},\n): Integration {\n // If the user opts out to set this up, we just don't initialize this.\n // That way, the TraceService will not actually do anything, functionally disabling this.\n if (options.instrumentNavigation !== false) {\n instrumentationInitialized = true;\n hooksBasedInstrumentation = true;\n }\n\n return originalBrowserTracingIntegration({\n ...options,\n instrumentNavigation: false,\n });\n}\n\n/**\n * Grabs active transaction off scope.\n *\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\nexport function getActiveTransaction(): Transaction | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getTransaction();\n}\n\n/**\n * Angular's Service responsible for hooking into Angular Router and tracking current navigation process.\n * Creates a new transaction for every route change and measures a duration of routing process.\n */\n@Injectable({ providedIn: 'root' })\nexport class TraceService implements OnDestroy {\n public navStart$: Observable<Event> = this._router.events.pipe(\n filter((event): event is NavigationStart => event instanceof NavigationStart),\n tap(navigationEvent => {\n if (!instrumentationInitialized) {\n IS_DEBUG_BUILD &&\n logger.error('Angular integration has tracing enabled, but Tracing integration is not configured');\n return;\n }\n\n if (this._routingSpan) {\n this._routingSpan.end();\n this._routingSpan = null;\n }\n\n const client = getClient();\n const strippedUrl = stripUrlQueryAndFragment(navigationEvent.url);\n\n if (client && hooksBasedInstrumentation) {\n // see comment in `_isPageloadOngoing` for rationale\n if (!this._isPageloadOngoing()) {\n startBrowserTracingNavigationSpan(client, {\n name: strippedUrl,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.angular',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n });\n } else {\n // The first time we end up here, we set the pageload flag to false\n // Subsequent navigations are going to get their own navigation root span\n // even if the pageload root span is still ongoing.\n this._pageloadOngoing = false;\n }\n\n this._routingSpan =\n startInactiveSpan({\n name: `${navigationEvent.url}`,\n op: ANGULAR_ROUTING_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n url: strippedUrl,\n ...(navigationEvent.navigationTrigger && {\n navigationTrigger: navigationEvent.navigationTrigger,\n }),\n },\n }) || null;\n\n return;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let activeTransaction = getActiveTransaction();\n\n if (!activeTransaction && stashedStartTransactionOnLocationChange) {\n activeTransaction = stashedStartTransaction({\n name: strippedUrl,\n op: 'navigation',\n origin: 'auto.navigation.angular',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n });\n }\n\n if (activeTransaction) {\n // eslint-disable-next-line deprecation/deprecation\n this._routingSpan = activeTransaction.startChild({\n name: `${navigationEvent.url}`,\n op: ANGULAR_ROUTING_OP,\n origin: 'auto.ui.angular',\n attributes: {\n url: strippedUrl,\n ...(navigationEvent.navigationTrigger && {\n navigationTrigger: navigationEvent.navigationTrigger,\n }),\n },\n });\n }\n }),\n );\n\n // The ResolveEnd event is fired when the Angular router has resolved the URL and\n // the parameter<->value mapping. It holds the new resolved router state with\n // the mapping and the new URL.\n // Only After this event, the route is activated, meaning that the transaction\n // can be updated with the parameterized route name before e.g. the route's root\n // component is initialized. This should be early enough before outgoing requests\n // are made from the new route, with the exceptions of requests being made during\n // a navigation.\n public resEnd$: Observable<Event> = this._router.events.pipe(\n filter((event): event is ResolveEnd => event instanceof ResolveEnd),\n tap(event => {\n const route = getParameterizedRouteFromSnapshot(\n (event.state as unknown as RouterState & { root: ActivatedRouteSnapshot }).root,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n const transaction = getActiveTransaction();\n // TODO (v8 / #5416): revisit the source condition. Do we want to make the parameterized route the default?\n const attributes = (transaction && spanToJSON(transaction).data) || {};\n if (transaction && attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'url') {\n transaction.updateName(route);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, `auto.${spanToJSON(transaction).op}.angular`);\n }\n }),\n );\n\n public navEnd$: Observable<Event> = this._router.events.pipe(\n filter(\n event => event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError,\n ),\n tap(() => {\n if (this._routingSpan) {\n runOutsideAngular(() => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this._routingSpan!.end();\n });\n this._routingSpan = null;\n }\n }),\n );\n\n private _routingSpan: Span | null;\n\n private _subscription: Subscription;\n\n /**\n * @see _isPageloadOngoing()\n */\n private _pageloadOngoing: boolean;\n\n public constructor(private readonly _router: Router) {\n this._routingSpan = null;\n this._pageloadOngoing = true;\n\n this._subscription = new Subscription();\n\n this._subscription.add(this.navStart$.subscribe());\n this._subscription.add(this.resEnd$.subscribe());\n this._subscription.add(this.navEnd$.subscribe());\n }\n\n /**\n * This is used to prevent memory leaks when the root view is created and destroyed multiple times,\n * since `subscribe` callbacks capture `this` and prevent many resources from being GC'd.\n */\n public ngOnDestroy(): void {\n this._subscription.unsubscribe();\n }\n\n /**\n * We only _avoid_ creating a navigation root span in one case:\n *\n * There is an ongoing pageload span AND the router didn't yet emit the first navigation start event\n *\n * The first navigation start event will create the child routing span\n * and update the pageload root span name on ResolveEnd.\n *\n * There's an edge case we need to avoid here: If the router fires the first navigation start event\n * _after_ the pageload root span finished. This is why we check for the pageload root span.\n * Possible real-world scenario: Angular application and/or router is bootstrapped after the pageload\n * idle root span finished\n *\n * The overall rationale is:\n * - if we already avoided creating a navigation root span once, we don't avoid it again\n * (i.e. set `_pageloadOngoing` to `false`)\n * - if `_pageloadOngoing` is already `false`, create a navigation root span\n * - if there's no active/pageload root span, create a navigation root span\n * - only if there's an ongoing pageload root span AND `_pageloadOngoing` is still `true,\n * con't create a navigation root span\n */\n private _isPageloadOngoing(): boolean {\n if (!this._pageloadOngoing) {\n // pageload is already finished, no need to update\n return false;\n }\n\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n this._pageloadOngoing = false;\n return false;\n }\n\n const rootSpan = getRootSpan(activeSpan);\n if (!rootSpan) {\n this._pageloadOngoing = false;\n return false;\n }\n\n this._pageloadOngoing = spanToJSON(rootSpan).op === 'pageload';\n return this._pageloadOngoing;\n }\n}\n\nconst UNKNOWN_COMPONENT = 'unknown';\n\n/**\n * A directive that can be used to capture initialization lifecycle of the whole component.\n */\n@Directive({ selector: '[trace]' })\nexport class TraceDirective implements OnInit, AfterViewInit {\n @Input('trace') public componentName?: string;\n\n private _tracingSpan?: Span;\n\n /**\n * Implementation of OnInit lifecycle method\n * @inheritdoc\n */\n public ngOnInit(): void {\n if (!this.componentName) {\n this.componentName = UNKNOWN_COMPONENT;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n // eslint-disable-next-line deprecation/deprecation\n this._tracingSpan = activeTransaction.startChild({\n name: `<${this.componentName}>`,\n op: ANGULAR_INIT_OP,\n origin: 'auto.ui.angular.trace_directive',\n });\n }\n }\n\n /**\n * Implementation of AfterViewInit lifecycle method\n * @inheritdoc\n */\n public ngAfterViewInit(): void {\n if (this._tracingSpan) {\n this._tracingSpan.end();\n }\n }\n}\n\n/**\n * A module serves as a single compilation unit for the `TraceDirective` and can be re-used by any other module.\n */\n@NgModule({\n declarations: [TraceDirective],\n exports: [TraceDirective],\n})\nexport class TraceModule {}\n\n/**\n * Decorator function that can be used to capture initialization lifecycle of the whole component.\n */\nexport function TraceClassDecorator(): ClassDecorator {\n let tracingSpan: Span;\n\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n return target => {\n const originalOnInit = target.prototype.ngOnInit;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target.prototype.ngOnInit = function (...args: any[]): ReturnType<typeof originalOnInit> {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n // eslint-disable-next-line deprecation/deprecation\n tracingSpan = activeTransaction.startChild({\n name: `<${target.name}>`,\n op: ANGULAR_INIT_OP,\n origin: 'auto.ui.angular.trace_class_decorator',\n });\n }\n if (originalOnInit) {\n return originalOnInit.apply(this, args);\n }\n };\n\n const originalAfterViewInit = target.prototype.ngAfterViewInit;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target.prototype.ngAfterViewInit = function (...args: any[]): ReturnType<typeof originalAfterViewInit> {\n if (tracingSpan) {\n tracingSpan.end();\n }\n if (originalAfterViewInit) {\n return originalAfterViewInit.apply(this, args);\n }\n };\n };\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n}\n\n/**\n * Decorator function that can be used to capture a single lifecycle methods of the component.\n */\nexport function TraceMethodDecorator(): MethodDecorator {\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/ban-types\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const originalMethod = descriptor.value;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n descriptor.value = function (...args: any[]): ReturnType<typeof originalMethod> {\n const now = timestampInSeconds();\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n // eslint-disable-next-line deprecation/deprecation\n activeTransaction.startChild({\n name: `<${target.constructor.name}>`,\n endTimestamp: now,\n op: `${ANGULAR_OP}.${String(propertyKey)}`,\n origin: 'auto.ui.angular.trace_method_decorator',\n startTimestamp: now,\n });\n }\n if (originalMethod) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalMethod.apply(this, args);\n }\n };\n return descriptor;\n };\n}\n\n/**\n * Takes the parameterized route from a given ActivatedRouteSnapshot and concatenates the snapshot's\n * child route with its parent to produce the complete parameterized URL of the activated route.\n * This happens recursively until the last child (i.e. the end of the URL) is reached.\n *\n * @param route the ActivatedRouteSnapshot of which its path and its child's path is concatenated\n *\n * @returns the concatenated parameterized route string\n */\nexport function getParameterizedRouteFromSnapshot(route?: ActivatedRouteSnapshot | null): string {\n const parts: string[] = [];\n\n let currentRoute = route && route.firstChild;\n while (currentRoute) {\n const path = currentRoute && currentRoute.routeConfig && currentRoute.routeConfig.path;\n if (path === null || path === undefined) {\n break;\n }\n\n parts.push(path);\n currentRoute = currentRoute.firstChild;\n }\n\n const fullPath = parts.filter(part => part).join('/');\n return fullPath ? `/${fullPath}/` : '/';\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["getDefaultIntegrations","applySdkMetadata","browserInit","VERSION","logger","setContext","isString","Sentry","HttpErrorResponse","Injectable","Inject","WINDOW","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","originalBrowserTracingIntegration","getCurrentScope","filter","NavigationStart","tap","getClient","stripUrlQueryAndFragment","startBrowserTracingNavigationSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","startInactiveSpan","ResolveEnd","spanToJSON","NavigationEnd","NavigationCancel","NavigationError","Subscription","getActiveSpan","getRootSpan","Router","Directive","Input","NgModule","timestampInSeconds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;IAOG;IAIH;IACO,IAAM,cAAc,GAAG,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,gBAAgB;;ICJ/F;;IAEG;IACG,SAAU,IAAI,CAAC,OAAuB,EAAA;IAC1C,IAAA,IAAM,IAAI,GAAA,MAAA,CAAA,MAAA,CAAA;;;;;;;YAOR,mBAAmB,EAAEA,6BAAsB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAA,WAAW,EAAA;IACrE,YAAA,OAAO,WAAW,CAAC,IAAI,KAAK,kBAAkB,CAAC;IACjD,SAAC,CAAC;SAAA,EACC,OAAO,CACX,CAAC;IAEF,IAAAC,qBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAElC,IAAA,yBAAyB,EAAE,CAAC;QAC5BC,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,SAAS,yBAAyB,GAAA;QAChC,IAAM,uBAAuB,GAAG,EAAE,CAAC;QAEnC,IAAM,cAAc,GAAGC,UAAO,IAAIA,UAAO,CAAC,KAAK,GAAG,QAAQ,CAACA,UAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC;IAE1F,IAAA,IAAI,cAAc,EAAE;YAClB,IAAI,cAAc,GAAG,uBAAuB,E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,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACzC,aAAA;IACH,SAAC,CAAC;IACF,QAAA,OAAO,UAAU,CAAC;IACpB,KAAC,CAAC;IACJ,CAAC;IAED;;;;;;;;IAQG;IACG,SAAU,iCAAiC,CAAC,KAAqC,EAAA;QACrF,IAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAA,IAAI,YAAY,GAAG,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC;IAC7C,IAAA,OAAO,YAAY,EAAE;IACnB,QAAA,IAAM,IAAI,GAAG,YAAY,IAAI,YAAY,CAAC,WAAW,IAAI,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC;IACvF,QAAA,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;gBACvC,MAAM;IACP,SAAA;IAED,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,QAAA,YAAY,GAAG,YAAY,CAAC,UAAU,CAAC;IACxC,KAAA;IAED,IAAA,IAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,UAAA,IAAI,EAAA,EAAI,OAAA,IAAI,CAAA,EAAA,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtD,OAAO,QAAQ,GAAG,GAAA,GAAI,QAAQ,GAAA,GAAG,GAAG,GAAG,CAAC;IAC1C;;IClcA;;IAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sentry-angular.umd.js","sources":["../../src/flags.ts","../../src/sdk.ts","../../src/zone.ts","../../src/errorhandler.ts","../../src/constants.ts","../../src/tracing.ts","../../src/sentry-angular.ts"],"sourcesContent":["/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * We define \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during our, or the user's\n * build process. Take care when introducing new flags - they must not throw if they are not replaced. See the Debug\n * Build Flags section in CONTRIBUTING.md.\n */\n\ndeclare const __SENTRY_DEBUG__: boolean;\n\n/** Flag that is true for debug builds, false otherwise. */\nexport const IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;\n","import { VERSION } from '@angular/core';\nimport type { BrowserOptions } from '@sentry/browser';\nimport { getDefaultIntegrations, init as browserInit, setContext } from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { IS_DEBUG_BUILD } from './flags';\n\n/**\n * Inits the Angular SDK\n */\nexport function init(options: BrowserOptions): void {\n const opts = {\n // Filter out BrowserApiErrors integration as it interferes with our Angular `ErrorHandler`:\n // BrowserApiErrors would catch certain errors before they reach the `ErrorHandler` and thus provide a\n // lower fidelity error than what `SentryErrorHandler` (see errorhandler.ts) would provide.\n // see:\n // - https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1453407097\n // - https://github.com/getsentry/sentry-javascript/issues/2744\n defaultIntegrations: getDefaultIntegrations(options).filter(integration => {\n return integration.name !== 'BrowserApiErrors';\n }),\n ...options,\n };\n\n applySdkMetadata(opts, 'angular');\n\n checkAndSetAngularVersion();\n browserInit(opts);\n}\n\nfunction checkAndSetAngularVersion(): void {\n const ANGULAR_MINIMUM_VERSION = 10;\n\n const angularVersion = VERSION && VERSION.major ? parseInt(VERSION.major, 10) : undefined;\n\n if (angularVersion) {\n if (angularVersion < ANGULAR_MINIMUM_VERSION) {\n IS_DEBUG_BUILD &&\n logger.warn(\n `The Sentry SDK does not officially support Angular ${angularVersion}.`,\n `This version of the Sentry SDK supports Angular ${ANGULAR_MINIMUM_VERSION} and above.`,\n 'Please consider upgrading your Angular version or downgrading the Sentry SDK.',\n );\n }\n setContext('angular', { version: angularVersion });\n }\n}\n","// That's the `global.Zone` exposed when the `zone.js` package is used.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const Zone: any;\n\n// There're 2 types of Angular applications:\n// 1) zone-full (by default)\n// 2) zone-less\n// The developer can avoid importing the `zone.js` package and tells Angular that\n// he is responsible for running the change detection by himself. This is done by\n// \"nooping\" the zone through `CompilerOptions` when bootstrapping the root module.\n// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\nconst isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.current;\n\n/**\n * The function that does the same job as `NgZone.runOutsideAngular`.\n */\nexport function runOutsideAngular<T>(callback: () => T): T {\n // The `Zone.root.run` basically will run the `callback` in the most parent zone.\n // Any asynchronous API used inside the `callback` won't catch Angular's zone\n // since `Zone.current` will reference `Zone.root`.\n // The Angular's zone is forked from the `Zone.root`. In this case, `zone.js` won't\n // trigger change detection, and `ApplicationRef.tick()` will not be run.\n // Caretaker note: we're using `Zone.root` except `NgZone.runOutsideAngular` since this\n // will require injecting the `NgZone` facade. That will create a breaking change for\n // projects already using the `@sentry/angular`.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return isNgZoneEnabled ? Zone.root.run(callback) : callback();\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport type { ErrorHandler as AngularErrorHandler } from '@angular/core';\nimport { Inject, Injectable } from '@angular/core';\nimport * as Sentry from '@sentry/browser';\nimport type { ReportDialogOptions } from '@sentry/browser';\nimport type { Event } from '@sentry/types';\nimport { isString } from '@sentry/utils';\n\nimport { runOutsideAngular } from './zone';\n\n/**\n * Options used to configure the behavior of the Angular ErrorHandler.\n */\nexport interface ErrorHandlerOptions {\n logErrors?: boolean;\n showDialog?: boolean;\n dialogOptions?: Omit<ReportDialogOptions, 'eventId'>;\n /**\n * Custom implementation of error extraction from the raw value captured by the Angular.\n * @param error Value captured by Angular's ErrorHandler provider\n * @param defaultExtractor Default implementation that can be used as the fallback in case of custom implementation\n */\n extractor?(error: unknown, defaultExtractor: (error: unknown) => unknown): unknown;\n}\n\n// https://github.com/angular/angular/blob/master/packages/core/src/util/errors.ts\nfunction tryToUnwrapZonejsError(error: unknown): unknown | Error {\n // TODO: once Angular14 is the minimum requirement ERROR_ORIGINAL_ERROR and\n // getOriginalError from error.ts can be used directly.\n return error && (error as { ngOriginalError: Error }).ngOriginalError\n ? (error as { ngOriginalError: Error }).ngOriginalError\n : error;\n}\n\nfunction extractHttpModuleError(error: HttpErrorResponse): string | Error {\n // The `error` property of http exception can be either an `Error` object, which we can use directly...\n if (isErrorOrErrorLikeObject(error.error)) {\n return error.error;\n }\n\n // ... or an`ErrorEvent`, which can provide us with the message but no stack...\n if (error.error instanceof ErrorEvent && error.error.message) {\n return error.error.message;\n }\n\n // ...or the request body itself, which we can use as a message instead.\n if (typeof error.error === 'string') {\n return `Server returned code ${error.status} with body \"${error.error}\"`;\n }\n\n // If we don't have any detailed information, fallback to the request message itself.\n return error.message;\n}\n\ntype ErrorCandidate = {\n name?: unknown;\n message?: unknown;\n stack?: unknown;\n};\n\nfunction isErrorOrErrorLikeObject(value: unknown): value is Error {\n if (value instanceof Error) {\n return true;\n }\n\n if (value === null || typeof value !== 'object') {\n return false;\n }\n\n const candidate = value as ErrorCandidate;\n\n return (\n isString(candidate.name) &&\n isString(candidate.message) &&\n (undefined === candidate.stack || isString(candidate.stack))\n );\n}\n\n/**\n * Implementation of Angular's ErrorHandler provider that can be used as a drop-in replacement for the stock one.\n */\n@Injectable({ providedIn: 'root' })\nclass SentryErrorHandler implements AngularErrorHandler {\n protected readonly _options: ErrorHandlerOptions;\n\n /* indicates if we already registered our the afterSendEvent handler */\n private _registeredAfterSendEventHandler;\n\n public constructor(@Inject('errorHandlerOptions') options?: ErrorHandlerOptions) {\n this._registeredAfterSendEventHandler = false;\n\n this._options = {\n logErrors: true,\n ...options,\n };\n }\n\n /**\n * Method called for every value captured through the ErrorHandler\n */\n public handleError(error: unknown): void {\n const extractedError = this._extractError(error) || 'Handled unknown error';\n\n // Capture handled exception and send it to Sentry.\n const eventId = runOutsideAngular(() =>\n Sentry.captureException(extractedError, {\n mechanism: { type: 'angular', handled: false },\n }),\n );\n\n // When in development mode, log the error to console for immediate feedback.\n if (this._options.logErrors) {\n // eslint-disable-next-line no-console\n console.error(extractedError);\n }\n\n // Optionally show user dialog to provide details on what happened.\n if (this._options.showDialog) {\n const client = Sentry.getClient();\n\n if (client && !this._registeredAfterSendEventHandler) {\n client.on('afterSendEvent', (event: Event) => {\n if (!event.type && event.event_id) {\n Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });\n }\n });\n\n // We only want to register this hook once in the lifetime of the error handler\n this._registeredAfterSendEventHandler = true;\n } else if (!client) {\n Sentry.showReportDialog({ ...this._options.dialogOptions, eventId });\n }\n }\n }\n\n /**\n * Used to pull a desired value that will be used to capture an event out of the raw value captured by ErrorHandler.\n */\n protected _extractError(error: unknown): unknown {\n // Allow custom overrides of extracting function\n if (this._options.extractor) {\n const defaultExtractor = this._defaultExtractor.bind(this);\n return this._options.extractor(error, defaultExtractor);\n }\n\n return this._defaultExtractor(error);\n }\n\n /**\n * Default implementation of error extraction that handles default error wrapping, HTTP responses, ErrorEvent and few other known cases.\n */\n protected _defaultExtractor(errorCandidate: unknown): unknown {\n const error = tryToUnwrapZonejsError(errorCandidate);\n\n // If it's http module error, extract as much information from it as we can.\n if (error instanceof HttpErrorResponse) {\n return extractHttpModuleError(error);\n }\n\n // We can handle messages and Error objects directly.\n if (typeof error === 'string' || isErrorOrErrorLikeObject(error)) {\n return error;\n }\n\n // Nothing was extracted, fallback to default error message.\n return null;\n }\n}\n\n/**\n * Factory function that creates an instance of a preconfigured ErrorHandler provider.\n */\nfunction createErrorHandler(config?: ErrorHandlerOptions): SentryErrorHandler {\n return new SentryErrorHandler(config);\n}\n\nexport { createErrorHandler, SentryErrorHandler };\n","export const ANGULAR_ROUTING_OP = 'ui.angular.routing';\n\nexport const ANGULAR_INIT_OP = 'ui.angular.init';\n\nexport const ANGULAR_OP = 'ui.angular';\n","import type { AfterViewInit, OnDestroy, OnInit } from '@angular/core';\nimport { Directive, Injectable, Input, NgModule } from '@angular/core';\nimport type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router';\n// Duplicated import to work around a TypeScript bug where it'd complain that `Router` isn't imported as a type.\n// We need to import it as a value to satisfy Angular dependency injection. So:\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { NavigationCancel, NavigationError, Router } from '@angular/router';\nimport { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n browserTracingIntegration as originalBrowserTracingIntegration,\n getActiveSpan,\n getClient,\n getCurrentScope,\n getRootSpan,\n spanToJSON,\n startBrowserTracingNavigationSpan,\n startInactiveSpan,\n} from '@sentry/browser';\nimport type { Integration, Span } from '@sentry/types';\nimport { logger, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/utils';\nimport type { Observable } from 'rxjs';\nimport { Subscription } from 'rxjs';\nimport { filter, tap } from 'rxjs/operators';\n\nimport { ANGULAR_INIT_OP, ANGULAR_OP, ANGULAR_ROUTING_OP } from './constants';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { runOutsideAngular } from './zone';\n\nlet instrumentationInitialized: boolean;\n\n/**\n * A custom browser tracing integration for Angular.\n *\n * Use this integration in combination with `TraceService`\n */\nexport function browserTracingIntegration(\n options: Parameters<typeof originalBrowserTracingIntegration>[0] = {},\n): Integration {\n // If the user opts out to set this up, we just don't initialize this.\n // That way, the TraceService will not actually do anything, functionally disabling this.\n if (options.instrumentNavigation !== false) {\n instrumentationInitialized = true;\n }\n\n return originalBrowserTracingIntegration({\n ...options,\n instrumentNavigation: false,\n });\n}\n\n/**\n * This function is extracted to make unit testing easier.\n */\nexport function _updateSpanAttributesForParametrizedUrl(route: string, span?: Span): void {\n const attributes = (span && spanToJSON(span).data) || {};\n\n if (span && attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'url') {\n span.updateName(route);\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, `auto.${spanToJSON(span).op}.angular`);\n }\n}\n\n/**\n * Angular's Service responsible for hooking into Angular Router and tracking current navigation process.\n * Creates a new transaction for every route change and measures a duration of routing process.\n */\n@Injectable({ providedIn: 'root' })\nexport class TraceService implements OnDestroy {\n public navStart$: Observable<Event> = this._router.events.pipe(\n filter((event): event is NavigationStart => event instanceof NavigationStart),\n tap(navigationEvent => {\n if (!instrumentationInitialized) {\n IS_DEBUG_BUILD &&\n logger.error('Angular integration has tracing enabled, but Tracing integration is not configured');\n return;\n }\n\n if (this._routingSpan) {\n this._routingSpan.end();\n this._routingSpan = null;\n }\n\n const client = getClient();\n const strippedUrl = stripUrlQueryAndFragment(navigationEvent.url);\n\n if (client) {\n // see comment in `_isPageloadOngoing` for rationale\n if (!this._isPageloadOngoing()) {\n startBrowserTracingNavigationSpan(client, {\n name: strippedUrl,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.angular',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n });\n } else {\n // The first time we end up here, we set the pageload flag to false\n // Subsequent navigations are going to get their own navigation root span\n // even if the pageload root span is still ongoing.\n this._pageloadOngoing = false;\n }\n\n this._routingSpan =\n startInactiveSpan({\n name: `${navigationEvent.url}`,\n op: ANGULAR_ROUTING_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n url: strippedUrl,\n ...(navigationEvent.navigationTrigger && {\n navigationTrigger: navigationEvent.navigationTrigger,\n }),\n },\n }) || null;\n\n return;\n }\n }),\n );\n\n // The ResolveEnd event is fired when the Angular router has resolved the URL and\n // the parameter<->value mapping. It holds the new resolved router state with\n // the mapping and the new URL.\n // Only After this event, the route is activated, meaning that the transaction\n // can be updated with the parameterized route name before e.g. the route's root\n // component is initialized. This should be early enough before outgoing requests\n // are made from the new route, with the exceptions of requests being made during\n // a navigation.\n public resEnd$: Observable<Event> = this._router.events.pipe(\n filter((event): event is ResolveEnd => event instanceof ResolveEnd),\n tap(event => {\n const route = getParameterizedRouteFromSnapshot(\n (event.state as unknown as RouterState & { root: ActivatedRouteSnapshot }).root,\n );\n\n if (route) {\n getCurrentScope().setTransactionName(route);\n }\n\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n\n _updateSpanAttributesForParametrizedUrl(route, rootSpan);\n }),\n );\n\n public navEnd$: Observable<Event> = this._router.events.pipe(\n filter(\n event => event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError,\n ),\n tap(() => {\n if (this._routingSpan) {\n runOutsideAngular(() => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this._routingSpan!.end();\n });\n this._routingSpan = null;\n }\n }),\n );\n\n private _routingSpan: Span | null;\n\n private _subscription: Subscription;\n\n /**\n * @see _isPageloadOngoing()\n */\n private _pageloadOngoing: boolean;\n\n public constructor(private readonly _router: Router) {\n this._routingSpan = null;\n this._pageloadOngoing = true;\n\n this._subscription = new Subscription();\n\n this._subscription.add(this.navStart$.subscribe());\n this._subscription.add(this.resEnd$.subscribe());\n this._subscription.add(this.navEnd$.subscribe());\n }\n\n /**\n * This is used to prevent memory leaks when the root view is created and destroyed multiple times,\n * since `subscribe` callbacks capture `this` and prevent many resources from being GC'd.\n */\n public ngOnDestroy(): void {\n this._subscription.unsubscribe();\n }\n\n /**\n * We only _avoid_ creating a navigation root span in one case:\n *\n * There is an ongoing pageload span AND the router didn't yet emit the first navigation start event\n *\n * The first navigation start event will create the child routing span\n * and update the pageload root span name on ResolveEnd.\n *\n * There's an edge case we need to avoid here: If the router fires the first navigation start event\n * _after_ the pageload root span finished. This is why we check for the pageload root span.\n * Possible real-world scenario: Angular application and/or router is bootstrapped after the pageload\n * idle root span finished\n *\n * The overall rationale is:\n * - if we already avoided creating a navigation root span once, we don't avoid it again\n * (i.e. set `_pageloadOngoing` to `false`)\n * - if `_pageloadOngoing` is already `false`, create a navigation root span\n * - if there's no active/pageload root span, create a navigation root span\n * - only if there's an ongoing pageload root span AND `_pageloadOngoing` is still `true,\n * don't create a navigation root span\n */\n private _isPageloadOngoing(): boolean {\n if (!this._pageloadOngoing) {\n // pageload is already finished, no need to update\n return false;\n }\n\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n this._pageloadOngoing = false;\n return false;\n }\n\n const rootSpan = getRootSpan(activeSpan);\n\n this._pageloadOngoing = spanToJSON(rootSpan).op === 'pageload';\n return this._pageloadOngoing;\n }\n}\n\nconst UNKNOWN_COMPONENT = 'unknown';\n\n/**\n * A directive that can be used to capture initialization lifecycle of the whole component.\n */\n@Directive({ selector: '[trace]' })\nexport class TraceDirective implements OnInit, AfterViewInit {\n @Input('trace') public componentName?: string;\n\n private _tracingSpan?: Span;\n\n /**\n * Implementation of OnInit lifecycle method\n * @inheritdoc\n */\n public ngOnInit(): void {\n if (!this.componentName) {\n this.componentName = UNKNOWN_COMPONENT;\n }\n\n if (getActiveSpan()) {\n this._tracingSpan = startInactiveSpan({\n name: `<${this.componentName}>`,\n op: ANGULAR_INIT_OP,\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive' },\n });\n }\n }\n\n /**\n * Implementation of AfterViewInit lifecycle method\n * @inheritdoc\n */\n public ngAfterViewInit(): void {\n if (this._tracingSpan) {\n this._tracingSpan.end();\n }\n }\n}\n\n/**\n * A module serves as a single compilation unit for the `TraceDirective` and can be re-used by any other module.\n */\n@NgModule({\n declarations: [TraceDirective],\n exports: [TraceDirective],\n})\nexport class TraceModule {}\n\ninterface TraceClassOptions {\n /**\n * Name of the class\n */\n name?: string;\n}\n\n/**\n * Decorator function that can be used to capture initialization lifecycle of the whole component.\n */\nexport function TraceClass(options?: TraceClassOptions): ClassDecorator {\n let tracingSpan: Span;\n\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n return target => {\n const originalOnInit = target.prototype.ngOnInit;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target.prototype.ngOnInit = function (...args: any[]): ReturnType<typeof originalOnInit> {\n tracingSpan = startInactiveSpan({\n onlyIfParent: true,\n name: `<${options && options.name ? options.name : 'unnamed'}>`,\n op: ANGULAR_INIT_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_class_decorator',\n },\n });\n\n if (originalOnInit) {\n return originalOnInit.apply(this, args);\n }\n };\n\n const originalAfterViewInit = target.prototype.ngAfterViewInit;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target.prototype.ngAfterViewInit = function (...args: any[]): ReturnType<typeof originalAfterViewInit> {\n if (tracingSpan) {\n tracingSpan.end();\n }\n if (originalAfterViewInit) {\n return originalAfterViewInit.apply(this, args);\n }\n };\n };\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n}\n\ninterface TraceMethodOptions {\n /**\n * Name of the method (is added to the tracing span)\n */\n name?: string;\n}\n\n/**\n * Decorator function that can be used to capture a single lifecycle methods of the component.\n */\nexport function TraceMethod(options?: TraceMethodOptions): MethodDecorator {\n // eslint-disable-next-line @typescript-eslint/ban-types\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const originalMethod = descriptor.value;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n descriptor.value = function (...args: any[]): ReturnType<typeof originalMethod> {\n const now = timestampInSeconds();\n\n startInactiveSpan({\n onlyIfParent: true,\n name: `<${options && options.name ? options.name : 'unnamed'}>`,\n op: `${ANGULAR_OP}.${String(propertyKey)}`,\n startTime: now,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_method_decorator',\n },\n }).end(now);\n\n if (originalMethod) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalMethod.apply(this, args);\n }\n };\n return descriptor;\n };\n}\n\n/**\n * Takes the parameterized route from a given ActivatedRouteSnapshot and concatenates the snapshot's\n * child route with its parent to produce the complete parameterized URL of the activated route.\n * This happens recursively until the last child (i.e. the end of the URL) is reached.\n *\n * @param route the ActivatedRouteSnapshot of which its path and its child's path is concatenated\n *\n * @returns the concatenated parameterized route string\n */\nexport function getParameterizedRouteFromSnapshot(route?: ActivatedRouteSnapshot | null): string {\n const parts: string[] = [];\n\n let currentRoute = route && route.firstChild;\n while (currentRoute) {\n const path = currentRoute && currentRoute.routeConfig && currentRoute.routeConfig.path;\n if (path === null || path === undefined) {\n break;\n }\n\n parts.push(path);\n currentRoute = currentRoute.firstChild;\n }\n\n const fullPath = parts.filter(part => part).join('/');\n return fullPath ? `/${fullPath}/` : '/';\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["getDefaultIntegrations","applySdkMetadata","browserInit","VERSION","logger","setContext","isString","Sentry","HttpErrorResponse","Injectable","Inject","originalBrowserTracingIntegration","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","filter","NavigationStart","tap","getClient","stripUrlQueryAndFragment","startBrowserTracingNavigationSpan","startInactiveSpan","ResolveEnd","getCurrentScope","getActiveSpan","getRootSpan","NavigationEnd","NavigationCancel","NavigationError","Subscription","Router","Directive","Input","NgModule","timestampInSeconds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;IAOG;IAIH;IACO,IAAM,cAAc,GAAG,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,gBAAgB;;ICJ/F;;IAEG;IACG,SAAU,IAAI,CAAC,OAAuB,EAAA;IAC1C,IAAA,IAAM,IAAI,GAAA,MAAA,CAAA,MAAA,CAAA;;;;;;;YAOR,mBAAmB,EAAEA,6BAAsB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAA,WAAW,EAAA;IACrE,YAAA,OAAO,WAAW,CAAC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