@sentry/angular 7.107.0 → 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 +99 -126
- 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/errorhandler.d.ts +2 -2
- package/esm2015/errorhandler.js +4 -5
- package/esm2015/index.js +2 -9
- package/esm2015/sdk.js +4 -4
- package/esm2015/tracing.js +87 -111
- package/fesm2015/sentry-angular.js +94 -118
- package/fesm2015/sentry-angular.js.map +1 -1
- package/index.d.ts +1 -3
- package/package.json +12 -6
- package/sentry-angular.metadata.json +1 -1
- package/tracing.d.ts +45 -20
package/tracing.d.ts
CHANGED
|
@@ -2,32 +2,18 @@ import type { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
|
|
|
2
2
|
import type { ActivatedRouteSnapshot, Event } from '@angular/router';
|
|
3
3
|
import { Router } from '@angular/router';
|
|
4
4
|
import { browserTracingIntegration as originalBrowserTracingIntegration } from '@sentry/browser';
|
|
5
|
-
import type { Integration,
|
|
5
|
+
import type { Integration, Span } from '@sentry/types';
|
|
6
6
|
import type { Observable } from 'rxjs';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @deprecated Use `browserTracingIntegration()` instead, which includes Angular-specific instrumentation out of the box.
|
|
11
|
-
*/
|
|
12
|
-
export declare function routingInstrumentation(customStartTransaction: (context: TransactionContext) => Transaction | undefined, startTransactionOnPageLoad?: boolean, startTransactionOnLocationChange?: boolean): void;
|
|
13
|
-
/**
|
|
14
|
-
* Creates routing instrumentation for Angular Router.
|
|
15
|
-
*
|
|
16
|
-
* @deprecated Use `browserTracingIntegration()` instead, which includes Angular-specific instrumentation out of the box.
|
|
17
|
-
*/
|
|
18
|
-
export declare const instrumentAngularRouting: typeof routingInstrumentation;
|
|
19
|
-
/**
|
|
20
|
-
* A custom BrowserTracing integration for Angular.
|
|
8
|
+
* A custom browser tracing integration for Angular.
|
|
21
9
|
*
|
|
22
10
|
* Use this integration in combination with `TraceService`
|
|
23
11
|
*/
|
|
24
12
|
export declare function browserTracingIntegration(options?: Parameters<typeof originalBrowserTracingIntegration>[0]): Integration;
|
|
25
13
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.
|
|
14
|
+
* This function is extracted to make unit testing easier.
|
|
29
15
|
*/
|
|
30
|
-
export declare function
|
|
16
|
+
export declare function _updateSpanAttributesForParametrizedUrl(route: string, span?: Span): void;
|
|
31
17
|
/**
|
|
32
18
|
* Angular's Service responsible for hooking into Angular Router and tracking current navigation process.
|
|
33
19
|
* Creates a new transaction for every route change and measures a duration of routing process.
|
|
@@ -39,12 +25,38 @@ export declare class TraceService implements OnDestroy {
|
|
|
39
25
|
navEnd$: Observable<Event>;
|
|
40
26
|
private _routingSpan;
|
|
41
27
|
private _subscription;
|
|
28
|
+
/**
|
|
29
|
+
* @see _isPageloadOngoing()
|
|
30
|
+
*/
|
|
31
|
+
private _pageloadOngoing;
|
|
42
32
|
constructor(_router: Router);
|
|
43
33
|
/**
|
|
44
34
|
* This is used to prevent memory leaks when the root view is created and destroyed multiple times,
|
|
45
35
|
* since `subscribe` callbacks capture `this` and prevent many resources from being GC'd.
|
|
46
36
|
*/
|
|
47
37
|
ngOnDestroy(): void;
|
|
38
|
+
/**
|
|
39
|
+
* We only _avoid_ creating a navigation root span in one case:
|
|
40
|
+
*
|
|
41
|
+
* There is an ongoing pageload span AND the router didn't yet emit the first navigation start event
|
|
42
|
+
*
|
|
43
|
+
* The first navigation start event will create the child routing span
|
|
44
|
+
* and update the pageload root span name on ResolveEnd.
|
|
45
|
+
*
|
|
46
|
+
* There's an edge case we need to avoid here: If the router fires the first navigation start event
|
|
47
|
+
* _after_ the pageload root span finished. This is why we check for the pageload root span.
|
|
48
|
+
* Possible real-world scenario: Angular application and/or router is bootstrapped after the pageload
|
|
49
|
+
* idle root span finished
|
|
50
|
+
*
|
|
51
|
+
* The overall rationale is:
|
|
52
|
+
* - if we already avoided creating a navigation root span once, we don't avoid it again
|
|
53
|
+
* (i.e. set `_pageloadOngoing` to `false`)
|
|
54
|
+
* - if `_pageloadOngoing` is already `false`, create a navigation root span
|
|
55
|
+
* - if there's no active/pageload root span, create a navigation root span
|
|
56
|
+
* - only if there's an ongoing pageload root span AND `_pageloadOngoing` is still `true,
|
|
57
|
+
* don't create a navigation root span
|
|
58
|
+
*/
|
|
59
|
+
private _isPageloadOngoing;
|
|
48
60
|
}
|
|
49
61
|
/**
|
|
50
62
|
* A directive that can be used to capture initialization lifecycle of the whole component.
|
|
@@ -68,14 +80,26 @@ export declare class TraceDirective implements OnInit, AfterViewInit {
|
|
|
68
80
|
*/
|
|
69
81
|
export declare class TraceModule {
|
|
70
82
|
}
|
|
83
|
+
interface TraceClassOptions {
|
|
84
|
+
/**
|
|
85
|
+
* Name of the class
|
|
86
|
+
*/
|
|
87
|
+
name?: string;
|
|
88
|
+
}
|
|
71
89
|
/**
|
|
72
90
|
* Decorator function that can be used to capture initialization lifecycle of the whole component.
|
|
73
91
|
*/
|
|
74
|
-
export declare function
|
|
92
|
+
export declare function TraceClass(options?: TraceClassOptions): ClassDecorator;
|
|
93
|
+
interface TraceMethodOptions {
|
|
94
|
+
/**
|
|
95
|
+
* Name of the method (is added to the tracing span)
|
|
96
|
+
*/
|
|
97
|
+
name?: string;
|
|
98
|
+
}
|
|
75
99
|
/**
|
|
76
100
|
* Decorator function that can be used to capture a single lifecycle methods of the component.
|
|
77
101
|
*/
|
|
78
|
-
export declare function
|
|
102
|
+
export declare function TraceMethod(options?: TraceMethodOptions): MethodDecorator;
|
|
79
103
|
/**
|
|
80
104
|
* Takes the parameterized route from a given ActivatedRouteSnapshot and concatenates the snapshot's
|
|
81
105
|
* child route with its parent to produce the complete parameterized URL of the activated route.
|
|
@@ -86,3 +110,4 @@ export declare function TraceMethodDecorator(): MethodDecorator;
|
|
|
86
110
|
* @returns the concatenated parameterized route string
|
|
87
111
|
*/
|
|
88
112
|
export declare function getParameterizedRouteFromSnapshot(route?: ActivatedRouteSnapshot | null): string;
|
|
113
|
+
export {};
|