Skip to content

Commit 4fc1d2e

Browse files
committed
fix(react): Use ui category for operations
1 parent 9e44d45 commit 4fc1d2e

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

packages/react/src/constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const REACT_RENDER_OP = 'ui.react.render';
2+
3+
export const REACT_UPDATE_OP = 'ui.react.update';
4+
5+
export const REACT_MOUNT_OP = 'ui.react.mount';
6+
7+
export const REACT_OP = 'ui.react';

packages/react/src/profiler.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { timestampWithMs } from '@sentry/utils';
66
import hoistNonReactStatics from 'hoist-non-react-statics';
77
import * as React from 'react';
88

9+
import { REACT_MOUNT_OP, REACT_OP, REACT_RENDER_OP, REACT_UPDATE_OP } from './constants';
10+
911
export const UNKNOWN_COMPONENT = 'unknown';
1012

1113
const TRACING_GETTER = ({
@@ -36,7 +38,7 @@ function pushActivity(name: string, op: string): number | null {
3638

3739
return (globalTracingIntegration as any).constructor.pushActivity(name, {
3840
description: `<${name}>`,
39-
op: `react.${op}`,
41+
op: `${REACT_OP}.${op}`,
4042
});
4143
}
4244

@@ -121,7 +123,7 @@ class Profiler extends React.Component<ProfilerProps> {
121123
if (activeTransaction) {
122124
this._mountSpan = activeTransaction.startChild({
123125
description: `<${name}>`,
124-
op: 'react.mount',
126+
op: REACT_MOUNT_OP,
125127
});
126128
}
127129
}
@@ -158,7 +160,7 @@ class Profiler extends React.Component<ProfilerProps> {
158160
},
159161
description: `<${this.props.name}>`,
160162
endTimestamp: now,
161-
op: `react.update`,
163+
op: REACT_UPDATE_OP,
162164
startTimestamp: now,
163165
});
164166
}
@@ -176,7 +178,7 @@ class Profiler extends React.Component<ProfilerProps> {
176178
this._mountSpan.startChild({
177179
description: `<${name}>`,
178180
endTimestamp: timestampWithMs(),
179-
op: `react.render`,
181+
op: REACT_RENDER_OP,
180182
startTimestamp: this._mountSpan.endTimestamp,
181183
});
182184
}
@@ -240,7 +242,7 @@ function useProfiler(
240242
if (activeTransaction) {
241243
return activeTransaction.startChild({
242244
description: `<${name}>`,
243-
op: 'react.mount',
245+
op: REACT_MOUNT_OP,
244246
});
245247
}
246248

@@ -257,7 +259,7 @@ function useProfiler(
257259
mountSpan.startChild({
258260
description: `<${name}>`,
259261
endTimestamp: timestampWithMs(),
260-
op: `react.render`,
262+
op: REACT_RENDER_OP,
261263
startTimestamp: mountSpan.endTimestamp,
262264
});
263265
}

0 commit comments

Comments
 (0)