From 1ed3705797866b95a38369e6bfcae88028b1a25f Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 19 Jul 2023 09:22:07 -0400 Subject: [PATCH] types(browser): Add browser profiling client options (#8565) Adds the profilesSampleRate type to browser client options. --- packages/browser/src/client.ts | 5 ++++- packages/types/src/browseroptions.ts | 8 ++++++++ packages/types/src/index.ts | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/browser/src/client.ts b/packages/browser/src/client.ts index ab877a782efa..fba5dfc008e6 100644 --- a/packages/browser/src/client.ts +++ b/packages/browser/src/client.ts @@ -1,6 +1,7 @@ import type { Scope } from '@sentry/core'; import { BaseClient, SDK_VERSION } from '@sentry/core'; import type { + BrowserClientProfilingOptions, BrowserClientReplayOptions, ClientOptions, Event, @@ -23,7 +24,9 @@ import { createUserFeedbackEnvelope } from './userfeedback'; * Configuration options for the Sentry Browser SDK. * @see @sentry/types Options for more information. */ -export type BrowserOptions = Options & BrowserClientReplayOptions; +export type BrowserOptions = Options & + BrowserClientReplayOptions & + BrowserClientProfilingOptions; /** * Configuration options for the Sentry Browser SDK Client class diff --git a/packages/types/src/browseroptions.ts b/packages/types/src/browseroptions.ts index 9eeea6350728..63341322ff56 100644 --- a/packages/types/src/browseroptions.ts +++ b/packages/types/src/browseroptions.ts @@ -16,3 +16,11 @@ export type BrowserClientReplayOptions = { */ replaysOnErrorSampleRate?: number; }; + +export type BrowserClientProfilingOptions = { + /** + * The sample rate for profiling + * 1.0 will profile all transactions and 0 will profile none. + */ + profilesSampleRate?: number; +}; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index d9b55aeef077..5ce2e1fe6ce5 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -115,5 +115,5 @@ export type { WrappedFunction } from './wrappedfunction'; export type { Instrumenter } from './instrumenter'; export type { HandlerDataFetch, HandlerDataXhr, SentryXhrData, SentryWrappedXMLHttpRequest } from './instrument'; -export type { BrowserClientReplayOptions } from './browseroptions'; +export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './browseroptions'; export type { CheckIn, MonitorConfig, SerializedCheckIn } from './checkin';