Skip to content

feat(tracing): Remove some more @sentry/tracing references #7570

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
Mar 22, 2023
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
5 changes: 1 addition & 4 deletions packages/nextjs/test/clientSdk.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { BaseClient, getCurrentHub } from '@sentry/core';
import * as SentryReact from '@sentry/react';
import { WINDOW } from '@sentry/react';
import { Integrations as TracingIntegrations } from '@sentry/tracing';
import { BrowserTracing, WINDOW } from '@sentry/react';
import type { Integration } from '@sentry/types';
import type { UserIntegrationsFunction } from '@sentry/utils';
import { logger } from '@sentry/utils';
import { JSDOM } from 'jsdom';

import { init, Integrations, nextRouterInstrumentation } from '../src/client';

const { BrowserTracing } = TracingIntegrations;

const reactInit = jest.spyOn(SentryReact, 'init');
const captureEvent = jest.spyOn(BaseClient.prototype, 'captureEvent');
const loggerLogSpy = jest.spyOn(logger, 'log');
Expand Down
5 changes: 5 additions & 0 deletions packages/nextjs/test/config/withSentry.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import * as hub from '@sentry/core';
import { addTracingExtensions } from '@sentry/core';
import * as Sentry from '@sentry/node';
import type { Client, ClientOptions } from '@sentry/types';
import type { NextApiRequest, NextApiResponse } from 'next';

import { withSentry } from '../../src/server';
import type { AugmentedNextApiResponse, NextApiHandler } from '../../src/server/types';

// The wrap* functions require the hub to have tracing extensions. This is normally called by the NodeClient
// constructor but the client isn't used in these tests.
addTracingExtensions();

const FLUSH_DURATION = 200;

async function sleep(ms: number): Promise<void> {
Expand Down
5 changes: 5 additions & 0 deletions packages/nextjs/test/edge/edgeWrapperUtils.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import * as coreSdk from '@sentry/core';
import { addTracingExtensions } from '@sentry/core';

import { withEdgeWrapping } from '../../src/edge/utils/edgeWrapperUtils';

// The wrap* functions require the hub to have tracing extensions. This is normally called by the EdgeClient
// constructor but the client isn't used in these tests.
addTracingExtensions();

// @ts-ignore Request does not exist on type Global
const origRequest = global.Request;
// @ts-ignore Response does not exist on type Global
Expand Down
1 change: 0 additions & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"tslib": "^1.9.3"
},
"devDependencies": {
"@sentry/tracing": "7.44.2",
"@types/cookie": "0.3.2",
"@types/express": "^4.17.14",
"@types/lru-cache": "^5.1.0",
Expand Down
1 change: 0 additions & 1 deletion packages/node/src/integrations/onuncaughtexception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export class OnUncaughtException implements Integration {
if (
// There are 3 listeners we ignore:
listener.name === 'domainUncaughtExceptionClear' || // as soon as we're using domains this listener is attached by node itself
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
(listener.tag && listener.tag === 'sentry_tracingErrorCallback') || // the handler we register for tracing
listener === this.handler // the handler we register in this integration
) {
Expand Down
11 changes: 5 additions & 6 deletions packages/node/test/integrations/http.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { Span, Transaction } from '@sentry/core';
import * as sentryCore from '@sentry/core';
import { Hub } from '@sentry/core';
import type { Span, Transaction } from '@sentry/tracing';
import { addExtensionMethods, TRACEPARENT_REGEXP } from '@sentry/tracing';
import { addTracingExtensions, Hub } from '@sentry/core';
import type { TransactionContext } from '@sentry/types';
import { logger, parseSemver } from '@sentry/utils';
import { logger, parseSemver, TRACEPARENT_REGEXP } from '@sentry/utils';
import * as http from 'http';
import * as https from 'https';
import * as HttpsProxyAgent from 'https-proxy-agent';
Expand Down Expand Up @@ -34,7 +33,7 @@ describe('tracing', () => {
...customOptions,
});
const hub = new Hub(new NodeClient(options));
addExtensionMethods();
addTracingExtensions();

hub.configureScope(scope =>
scope.setUser({
Expand Down Expand Up @@ -227,7 +226,7 @@ describe('tracing', () => {
}

function createTransactionAndPutOnScope(hub: Hub) {
addExtensionMethods();
addTracingExtensions();
const transaction = hub.startTransaction({ name: 'dogpark' });
hub.getScope()?.setSpan(transaction);
return transaction;
Expand Down