Skip to content

chore(tracing): Clean-up work from removing startSpan #3075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions packages/tracing/test/span.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,35 +229,6 @@ describe('Span', () => {
expect(spy).not.toHaveBeenCalled();
});

test('mixing hub.startSpan(transaction) + span.startChild + maxSpans', () => {
const _hub = new Hub(
new BrowserClient({
_experiments: { maxSpans: 2 },
tracesSampleRate: 1,
}),
);
const spy = jest.spyOn(_hub as any, 'captureEvent') as any;

const transaction = _hub.startTransaction({ name: 'test' });
const childSpanOne = transaction.startChild({ op: '1' });
childSpanOne.finish();

_hub.configureScope(scope => {
scope.setSpan(transaction);
});

const spanTwo = transaction.startChild({ op: '2' });
spanTwo.finish();

const spanThree = transaction.startChild({ op: '3' });
spanThree.finish();

transaction.finish();

expect(spy).toHaveBeenCalled();
expect(spy.mock.calls[0][0].spans).toHaveLength(2);
});

test('tree structure of spans should be correct when mixing it with span on scope', () => {
const spy = jest.spyOn(hub as any, 'captureEvent') as any;

Expand Down
5 changes: 1 addition & 4 deletions packages/types/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,7 @@ export interface Hub {
traceHeaders(): { [key: string]: string };

/**
* Starts a new `Span` and returns it. If there is a `Span` on the `Scope`,
* the new `Span` will be a child of the existing `Span`.
*
* @param context Properties of the new `Span`.
* @deprecated No longer does anything. Use use {@link Transaction.startChild} instead.
*/
startSpan(context: SpanContext): Span;

Expand Down