From 89d500b8e511513af2aa42776da987e8b91cd78c Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Mon, 7 Aug 2023 17:53:26 +0200 Subject: [PATCH 1/3] fix(jsdoc): `tracePropagationTargets` defaults are localhost and same origin --- packages/node/src/integrations/http.ts | 6 ++++-- packages/types/src/options.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/node/src/integrations/http.ts b/packages/node/src/integrations/http.ts index ded111673387..23a59dbc6e7e 100644 --- a/packages/node/src/integrations/http.ts +++ b/packages/node/src/integrations/http.ts @@ -28,8 +28,8 @@ interface TracingOptions { * List of strings/regex controlling to which outgoing requests * the SDK will attach tracing headers. * - * By default the SDK will attach those headers to all outgoing - * requests. If this option is provided, the SDK will match the + * By default the SDK will attach those headers to all requests to localhost + * and same origin. If this option is provided, the SDK will match the * request URL of outgoing requests against the items in this * array, and only attach tracing headers if a match was found. * @@ -38,6 +38,8 @@ interface TracingOptions { * Sentry.init({ * tracePropagationTargets: ['api.site.com'], * }) + * + * Default: ['localhost', /^\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS} */ tracePropagationTargets?: TracePropagationTargets; diff --git a/packages/types/src/options.ts b/packages/types/src/options.ts index 60d747136d90..74bcfad771f4 100644 --- a/packages/types/src/options.ts +++ b/packages/types/src/options.ts @@ -226,8 +226,8 @@ export interface ClientOptions Date: Wed, 9 Aug 2023 13:15:39 +0200 Subject: [PATCH 2/3] Fix node js doc --- packages/node/src/integrations/http.ts | 2 -- packages/node/src/types.ts | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/node/src/integrations/http.ts b/packages/node/src/integrations/http.ts index 23a59dbc6e7e..9f3d091879fb 100644 --- a/packages/node/src/integrations/http.ts +++ b/packages/node/src/integrations/http.ts @@ -38,8 +38,6 @@ interface TracingOptions { * Sentry.init({ * tracePropagationTargets: ['api.site.com'], * }) - * - * Default: ['localhost', /^\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS} */ tracePropagationTargets?: TracePropagationTargets; diff --git a/packages/node/src/types.ts b/packages/node/src/types.ts index fb128653870f..aa9d89a36153 100644 --- a/packages/node/src/types.ts +++ b/packages/node/src/types.ts @@ -1,9 +1,27 @@ -import type { ClientOptions, Options, SamplingContext } from '@sentry/types'; +import type { ClientOptions, Options, SamplingContext, TracePropagationTargets } from '@sentry/types'; import type { NodeClient } from './client'; import type { NodeTransportOptions } from './transports'; export interface BaseNodeOptions { + /** + * List of strings/regex controlling to which outgoing requests + * the SDK will attach tracing headers. + * + * By default the SDK will attach those headers to all requests to localhost + * and same origin. If this option is provided, the SDK will match the + * request URL of outgoing requests against the items in this + * array, and only attach tracing headers if a match was found. + * + * @example + * ```js + * Sentry.init({ + * tracePropagationTargets: ['api.site.com'], + * }); + * ``` + */ + tracePropagationTargets?: TracePropagationTargets; + /** * Sets profiling sample rate when @sentry/profiling-node is installed */ From eee291b8960d4cb290856ff36a1199599cd11f87 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Wed, 9 Aug 2023 13:17:25 +0200 Subject: [PATCH 3/3] Fix node --- packages/node/src/integrations/http.ts | 4 ++-- packages/node/src/types.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/node/src/integrations/http.ts b/packages/node/src/integrations/http.ts index 9f3d091879fb..ded111673387 100644 --- a/packages/node/src/integrations/http.ts +++ b/packages/node/src/integrations/http.ts @@ -28,8 +28,8 @@ interface TracingOptions { * List of strings/regex controlling to which outgoing requests * the SDK will attach tracing headers. * - * By default the SDK will attach those headers to all requests to localhost - * and same origin. If this option is provided, the SDK will match the + * By default the SDK will attach those headers to all outgoing + * requests. If this option is provided, the SDK will match the * request URL of outgoing requests against the items in this * array, and only attach tracing headers if a match was found. * diff --git a/packages/node/src/types.ts b/packages/node/src/types.ts index aa9d89a36153..b63c49e440e7 100644 --- a/packages/node/src/types.ts +++ b/packages/node/src/types.ts @@ -8,8 +8,8 @@ export interface BaseNodeOptions { * List of strings/regex controlling to which outgoing requests * the SDK will attach tracing headers. * - * By default the SDK will attach those headers to all requests to localhost - * and same origin. If this option is provided, the SDK will match the + * By default the SDK will attach those headers to all outgoing + * requests. If this option is provided, the SDK will match the * request URL of outgoing requests against the items in this * array, and only attach tracing headers if a match was found. *