Skip to content

Commit

Permalink
types(browser): Add browser profiling client options (#8565)
Browse files Browse the repository at this point in the history
Adds the profilesSampleRate type to browser client options.
  • Loading branch information
JonasBa committed Jul 19, 2023
1 parent 68c4491 commit 1ed3705
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/browser/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Scope } from '@sentry/core';
import { BaseClient, SDK_VERSION } from '@sentry/core';
import type {
BrowserClientProfilingOptions,
BrowserClientReplayOptions,
ClientOptions,
Event,
Expand All @@ -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<BrowserTransportOptions> & BrowserClientReplayOptions;
export type BrowserOptions = Options<BrowserTransportOptions> &
BrowserClientReplayOptions &
BrowserClientProfilingOptions;

/**
* Configuration options for the Sentry Browser SDK Client class
Expand Down
8 changes: 8 additions & 0 deletions packages/types/src/browseroptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
2 changes: 1 addition & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 1ed3705

Please sign in to comment.