Skip to content

Commit 9c6ba2e

Browse files
committed
update types
1 parent 23abc85 commit 9c6ba2e

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

packages/core/src/types-hoist/browseroptions.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,31 @@ export type BrowserClientReplayOptions = {
1818
};
1919

2020
export type BrowserClientProfilingOptions = {
21+
// todo: add deprecation warning for profilesSampleRate: @deprecated Use `profileSessionSampleRate` and `profileLifecycle` instead.
2122
/**
2223
* The sample rate for profiling
2324
* 1.0 will profile all transactions and 0 will profile none.
2425
*/
2526
profilesSampleRate?: number;
27+
28+
/**
29+
* Sets profiling session sample rate for the entire profiling session.
30+
*
31+
* A profiling session corresponds to a user session, so this rate determines what percentage of user sessions will have profiling enabled.
32+
*
33+
* @default 0
34+
*/
35+
profileSessionSampleRate?: number;
36+
37+
/**
38+
* Set the lifecycle mode of the profiler.
39+
* - **manual**: The profiler will be manually started and stopped via `startProfiler`/`stopProfiler`.
40+
* If a session is sampled, is dependent on the `profileSessionSampleRate`.
41+
* - **trace**: The profiler will be automatically started when a root span exists and stopped when there are no
42+
* more sampled root spans. Whether a session is sampled, is dependent on the `profileSessionSampleRate` and the
43+
* existing sampling configuration for tracing (`tracesSampleRate`/`tracesSampler`).
44+
*
45+
* @default 'manual'
46+
*/
47+
profileLifecycle?: 'manual' | 'trace';
2648
};

packages/node/src/types.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,19 @@ export interface BaseNodeOptions {
4646
profilesSampler?: (samplingContext: SamplingContext) => number | boolean;
4747

4848
/**
49-
* Sets profiling session sample rate - only evaluated once per SDK initialization.
49+
* Sets profiling session sample rate for the entire profiling session (evaluated once per SDK initialization).
50+
*
5051
* @default 0
5152
*/
5253
profileSessionSampleRate?: number;
5354

5455
/**
55-
* Set the lifecycle of the profiler.
56-
*
57-
* - `manual`: The profiler will be manually started and stopped.
58-
* - `trace`: The profiler will be automatically started when when a span is sampled and stopped when there are no more sampled spans.
56+
* Set the lifecycle mode of the profiler.
57+
* - **manual**: The profiler will be manually started and stopped via `startProfiler`/`stopProfiler`.
58+
* If a session is sampled, is dependent on the `profileSessionSampleRate`.
59+
* - **trace**: The profiler will be automatically started when a root span exists and stopped when there are no
60+
* more sampled root spans. Whether a session is sampled, is dependent on the `profileSessionSampleRate` and the
61+
* existing sampling configuration for tracing (`tracesSampleRate`/`tracesSampler`).
5962
*
6063
* @default 'manual'
6164
*/

0 commit comments

Comments
 (0)