Skip to content

Commit d17f049

Browse files
authored
fix(angular): Use ui category for span operations (#4222)
As per the new spec in https://develop.sentry.dev/sdk/performance/span-operations/#js-frameworks, we now want to prefix our angular spans operations with `ui`.
1 parent 9e44d45 commit d17f049

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

packages/angular/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ const boostrapSpan =
222222
activeTransaction &&
223223
activeTransaction.startChild({
224224
description: 'platform-browser-dynamic',
225-
op: 'angular.bootstrap',
225+
op: 'ui.angular.bootstrap',
226226
});
227227

228228
platformBrowserDynamic()

packages/angular/src/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const ANGULAR_ROUTING_OP = 'ui.angular.routing';
2+
3+
export const ANGULAR_INIT_OP = 'ui.angular.init';
4+
5+
export const ANGULAR_OP = 'ui.angular';

packages/angular/src/tracing.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { getGlobalObject, logger, stripUrlQueryAndFragment, timestampWithMs } fr
66
import { Observable, Subscription } from 'rxjs';
77
import { filter, tap } from 'rxjs/operators';
88

9+
import { ANGULAR_INIT_OP, ANGULAR_OP, ANGULAR_ROUTING_OP } from './constants';
910
import { runOutsideAngular } from './zone';
1011

1112
let instrumentationInitialized: boolean;
@@ -83,7 +84,7 @@ export class TraceService implements OnDestroy {
8384
}
8485
this._routingSpan = activeTransaction.startChild({
8586
description: `${navigationEvent.url}`,
86-
op: `angular.routing`,
87+
op: ANGULAR_ROUTING_OP,
8788
tags: {
8889
'routing.instrumentation': '@sentry/angular',
8990
url: strippedUrl,
@@ -146,7 +147,7 @@ export class TraceDirective implements OnInit, AfterViewInit {
146147
if (activeTransaction) {
147148
this._tracingSpan = activeTransaction.startChild({
148149
description: `<${this.componentName}>`,
149-
op: `angular.initialize`,
150+
op: ANGULAR_INIT_OP,
150151
});
151152
}
152153
}
@@ -187,7 +188,7 @@ export function TraceClassDecorator(): ClassDecorator {
187188
if (activeTransaction) {
188189
tracingSpan = activeTransaction.startChild({
189190
description: `<${target.name}>`,
190-
op: `angular.initialize`,
191+
op: ANGULAR_INIT_OP,
191192
});
192193
}
193194
if (originalOnInit) {
@@ -224,7 +225,7 @@ export function TraceMethodDecorator(): MethodDecorator {
224225
activeTransaction.startChild({
225226
description: `<${target.constructor.name}>`,
226227
endTimestamp: now,
227-
op: `angular.${String(propertyKey)}`,
228+
op: `${ANGULAR_OP}.${String(propertyKey)}`,
228229
startTimestamp: now,
229230
});
230231
}

0 commit comments

Comments
 (0)