Skip to content

Commit 9643fa2

Browse files
committed
use sentry.op
1 parent 0942036 commit 9643fa2

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

packages/angular/src/tracing.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {
2121
startInactiveSpan,
2222
getAbsoluteUrl,
2323
} from '@sentry/browser';
24+
import { CODE_FUNCTION_NAME, SENTRY_OP, URL_FULL, URL_PATH, URL_TEMPLATE } from '@sentry/conventions/attributes';
25+
import { GENERAL_FUNCTION_SPAN_OP } from '@sentry/conventions/op';
2426
import type { Integration, Span } from '@sentry/core';
2527
import { debug, parseStringToURLObject, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/core';
2628
import type { Observable } from 'rxjs';
@@ -29,8 +31,6 @@ import { filter, tap } from 'rxjs/operators';
2931
import { ANGULAR_INIT_OP, ANGULAR_ROUTING_OP } from './constants';
3032
import { IS_DEBUG_BUILD } from './flags';
3133
import { runOutsideAngular } from './zone';
32-
import { CODE_FUNCTION_NAME, URL_FULL, URL_PATH, URL_TEMPLATE } from '@sentry/conventions/attributes';
33-
import { GENERAL_FUNCTION_SPAN_OP } from '@sentry/conventions/op';
3434

3535
let instrumentationInitialized: boolean;
3636

@@ -294,8 +294,10 @@ export class TraceDirective implements OnInit, AfterViewInit {
294294
this._tracingSpan = runOutsideAngular(() =>
295295
startInactiveSpan({
296296
name: `<${this.componentName}>`,
297-
op: ANGULAR_INIT_OP,
298-
attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive' },
297+
attributes: {
298+
[SENTRY_OP]: ANGULAR_INIT_OP,
299+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive',
300+
},
299301
}),
300302
);
301303
}
@@ -343,8 +345,8 @@ export function TraceClass(options?: TraceClassOptions): ClassDecorator {
343345
startInactiveSpan({
344346
onlyIfParent: true,
345347
name: `<${options?.name || 'unnamed'}>`,
346-
op: ANGULAR_INIT_OP,
347348
attributes: {
349+
[SENTRY_OP]: ANGULAR_INIT_OP,
348350
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_class_decorator',
349351
},
350352
}),
@@ -388,9 +390,9 @@ export function TraceMethod(options?: TraceMethodOptions): MethodDecorator {
388390
startInactiveSpan({
389391
onlyIfParent: true,
390392
name: `<${options?.name ? options.name : 'unnamed'}>`,
391-
op: GENERAL_FUNCTION_SPAN_OP,
392393
startTime: now,
393394
attributes: {
395+
[SENTRY_OP]: GENERAL_FUNCTION_SPAN_OP,
394396
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_method_decorator',
395397
[CODE_FUNCTION_NAME]: String(propertyKey),
396398
},

0 commit comments

Comments
 (0)