Skip to content

Commit 3c5a8d6

Browse files
committed
ref: Remove parentSpanId option
1 parent ef2f3d7 commit 3c5a8d6

File tree

3 files changed

+14
-38
lines changed

3 files changed

+14
-38
lines changed

packages/apm/src/integrations/tracing.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,15 +770,13 @@ export class Tracing implements Integration {
770770
* @param name Name of the activity, can be any string (Only used internally to identify the activity)
771771
* @param spanContext If provided a Span with the SpanContext will be created.
772772
* @param options _autoPopAfter_ | Time in ms, if provided the activity will be popped automatically after this timeout. This can be helpful in cases where you cannot gurantee your application knows the state and calls `popActivity` for sure.
773-
* @param options _parentSpanId_ | Set a custom parent span id for the activity's span.
774773
*/
775774
public static pushActivity(
776775
name: string,
777776
spanContext?: SpanContext,
778777
options?: {
779778
autoPopAfter?: number;
780-
parentSpanId?: string;
781-
},
779+
},
782780
): number {
783781
const activeTransaction = Tracing._activeTransaction;
784782

@@ -792,9 +790,6 @@ export class Tracing implements Integration {
792790
const hub = _getCurrentHub();
793791
if (hub) {
794792
const span = activeTransaction.startChild(spanContext);
795-
if (options && options.parentSpanId) {
796-
span.parentSpanId = options.parentSpanId;
797-
}
798793
Tracing._activities[Tracing._currentIndex] = {
799794
name,
800795
span,

packages/react/src/profiler.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,16 @@ function warnAboutTracing(name: string): void {
3636
* Is a no-op if Tracing integration is not valid
3737
* @param name displayName of component that started activity
3838
*/
39-
function pushActivity(
40-
name: string,
41-
op: string,
42-
options?: {
43-
autoPopAfter?: number;
44-
parentSpanId?: string;
45-
},
46-
): number | null {
39+
function pushActivity(name: string, op: string): number | null {
4740
if (globalTracingIntegration === null) {
4841
return null;
4942
}
5043

5144
// tslint:disable-next-line:no-unsafe-any
52-
return (globalTracingIntegration as any).constructor.pushActivity(
53-
name,
54-
{
55-
description: `<${name}>`,
56-
op: `react.${op}`,
57-
},
58-
options,
59-
);
45+
return (globalTracingIntegration as any).constructor.pushActivity(name, {
46+
description: `<${name}>`,
47+
op: `react.${op}`,
48+
});
6049
}
6150

6251
/**

packages/react/test/profiler.test.tsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,10 @@ describe('withProfiler', () => {
9898
render(<ProfiledComponent />);
9999

100100
expect(mockPushActivity).toHaveBeenCalledTimes(1);
101-
expect(mockPushActivity).toHaveBeenLastCalledWith(
102-
UNKNOWN_COMPONENT,
103-
{
104-
description: `<${UNKNOWN_COMPONENT}>`,
105-
op: 'react.mount',
106-
},
107-
undefined,
108-
);
101+
expect(mockPushActivity).toHaveBeenLastCalledWith(UNKNOWN_COMPONENT, {
102+
description: `<${UNKNOWN_COMPONENT}>`,
103+
op: 'react.mount',
104+
});
109105
expect(mockGetActivitySpan).toHaveBeenCalledTimes(1);
110106
expect(mockGetActivitySpan).toHaveBeenLastCalledWith(1);
111107

@@ -198,14 +194,10 @@ describe('useProfiler()', () => {
198194
renderHook(() => useProfiler('Example'));
199195

200196
expect(mockPushActivity).toHaveBeenCalledTimes(1);
201-
expect(mockPushActivity).toHaveBeenLastCalledWith(
202-
'Example',
203-
{
204-
description: '<Example>',
205-
op: 'react.mount',
206-
},
207-
undefined,
208-
);
197+
expect(mockPushActivity).toHaveBeenLastCalledWith('Example', {
198+
description: '<Example>',
199+
op: 'react.mount',
200+
});
209201
expect(mockGetActivitySpan).toHaveBeenCalledTimes(1);
210202
expect(mockGetActivitySpan).toHaveBeenLastCalledWith(1);
211203

0 commit comments

Comments
 (0)