From 7aaecad269db2a98a9022be7696b6c1e91d5f5ba Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 28 Aug 2023 09:38:08 +0200 Subject: [PATCH 1/6] deprecate BrowserTracing TPTs --- packages/tracing-internal/src/browser/request.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/tracing-internal/src/browser/request.ts b/packages/tracing-internal/src/browser/request.ts index e24c726ada5f..aca809488fe4 100644 --- a/packages/tracing-internal/src/browser/request.ts +++ b/packages/tracing-internal/src/browser/request.ts @@ -27,6 +27,9 @@ export interface RequestInstrumentationOptions { * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage` * headers attached. * + * @deprecated Use top-level `tracePropagationTargets` option in `Sentry.init` instead. + * This option will be removed in v8. + * * Default: ['localhost', /^\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS} */ tracePropagationTargets: Array; From bf90c0c693c76365cce24f9f5a7e5a6ebd95714d Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 28 Aug 2023 09:48:33 +0200 Subject: [PATCH 2/6] adjust wording in Node http integration --- packages/node/src/integrations/http.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/node/src/integrations/http.ts b/packages/node/src/integrations/http.ts index ded111673387..1102c0301095 100644 --- a/packages/node/src/integrations/http.ts +++ b/packages/node/src/integrations/http.ts @@ -34,6 +34,8 @@ interface TracingOptions { * array, and only attach tracing headers if a match was found. * * @deprecated Use top level `tracePropagationTargets` option instead. + * This option will be removed in v8. + * * ``` * Sentry.init({ * tracePropagationTargets: ['api.site.com'], From e1152128c0c2b7b116e5b9ec23ad9bb8bb17c4b4 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 28 Aug 2023 09:54:45 +0200 Subject: [PATCH 3/6] fix BT TPTs jsdoc --- packages/tracing-internal/src/browser/request.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tracing-internal/src/browser/request.ts b/packages/tracing-internal/src/browser/request.ts index aca809488fe4..e7f6a2615eea 100644 --- a/packages/tracing-internal/src/browser/request.ts +++ b/packages/tracing-internal/src/browser/request.ts @@ -30,7 +30,7 @@ export interface RequestInstrumentationOptions { * @deprecated Use top-level `tracePropagationTargets` option in `Sentry.init` instead. * This option will be removed in v8. * - * Default: ['localhost', /^\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS} + * Default: ['localhost', /^\//] @see {DEFAULT_TRACE_PROPAGATION_TARGETS} */ tracePropagationTargets: Array; From cdac544294cd49c9e94138f2d8f24004dd96cbcf Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 28 Aug 2023 10:07:17 +0200 Subject: [PATCH 4/6] Update packages/tracing-internal/src/browser/request.ts --- packages/tracing-internal/src/browser/request.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tracing-internal/src/browser/request.ts b/packages/tracing-internal/src/browser/request.ts index e7f6a2615eea..ecd1966f59d8 100644 --- a/packages/tracing-internal/src/browser/request.ts +++ b/packages/tracing-internal/src/browser/request.ts @@ -27,7 +27,7 @@ export interface RequestInstrumentationOptions { * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage` * headers attached. * - * @deprecated Use top-level `tracePropagationTargets` option in `Sentry.init` instead. + * @deprecated Use the top-level `tracePropagationTargets` option in `Sentry.init` instead. * This option will be removed in v8. * * Default: ['localhost', /^\//] @see {DEFAULT_TRACE_PROPAGATION_TARGETS} From 8a5bf44316502ba0840d2dbfcadfec73935808f6 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 28 Aug 2023 12:44:46 +0200 Subject: [PATCH 5/6] ignore deprecation lint error --- packages/tracing-internal/src/browser/browsertracing.ts | 1 + packages/tracing-internal/src/browser/request.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/tracing-internal/src/browser/browsertracing.ts b/packages/tracing-internal/src/browser/browsertracing.ts index aae66bee3358..d01c837d26c2 100644 --- a/packages/tracing-internal/src/browser/browsertracing.ts +++ b/packages/tracing-internal/src/browser/browsertracing.ts @@ -248,6 +248,7 @@ export class BrowserTracing implements Integration { // This is done as it minimizes bundle size (we don't have to have undefined checks). // // If both 1 and either one of 2 or 3 are set (from above), we log out a warning. + // eslint-disable-next-line deprecation/deprecation const tracePropagationTargets = clientOptionsTracePropagationTargets || this.options.tracePropagationTargets; if (__DEBUG_BUILD__ && this._hasSetTracePropagationTargets && clientOptionsTracePropagationTargets) { logger.warn( diff --git a/packages/tracing-internal/src/browser/request.ts b/packages/tracing-internal/src/browser/request.ts index ecd1966f59d8..3880abe90fd5 100644 --- a/packages/tracing-internal/src/browser/request.ts +++ b/packages/tracing-internal/src/browser/request.ts @@ -128,6 +128,7 @@ export function instrumentOutgoingRequests(_options?: Partial Date: Mon, 28 Aug 2023 13:17:22 +0200 Subject: [PATCH 6/6] fix test --- packages/sveltekit/test/client/sdk.test.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/sveltekit/test/client/sdk.test.ts b/packages/sveltekit/test/client/sdk.test.ts index a8353a73df3e..5ff3b9f9e846 100644 --- a/packages/sveltekit/test/client/sdk.test.ts +++ b/packages/sveltekit/test/client/sdk.test.ts @@ -109,9 +109,7 @@ describe('Sentry client SDK', () => { it('Merges a user-provided BrowserTracing integration with the automatically added one', () => { init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', - integrations: [ - new BrowserTracing({ tracePropagationTargets: ['myDomain.com'], startTransactionOnLocationChange: false }), - ], + integrations: [new BrowserTracing({ finalTimeout: 10, startTransactionOnLocationChange: false })], enableTracing: true, }); @@ -126,8 +124,7 @@ describe('Sentry client SDK', () => { expect(browserTracing).toBeDefined(); // This shows that the user-configured options are still here - expect(options.tracePropagationTargets).toEqual(['myDomain.com']); - expect(options.startTransactionOnLocationChange).toBe(false); + expect(options.finalTimeout).toEqual(10); // But we force the routing instrumentation to be ours expect(options.routingInstrumentation).toEqual(svelteKitRoutingInstrumentation);