Skip to content

Commit 6ea7aeb

Browse files
committed
types: add startProfilerSession and stopProfilerSession
1 parent 47f95e5 commit 6ea7aeb

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

packages/core/src/profiling.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function isProfilingIntegrationWithProfiler(
1818
* Starts the Sentry continuous profiler.
1919
* This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value.
2020
* In continuous profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application.
21+
* @deprecated Use `startProfilerSession()` instead.
2122
*/
2223
function startProfiler(): void {
2324
const client = getClient();
@@ -44,6 +45,7 @@ function startProfiler(): void {
4445
/**
4546
* Stops the Sentry continuous profiler.
4647
* Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.
48+
* @deprecated Use `stopProfilerSession()` instead.
4749
*/
4850
function stopProfiler(): void {
4951
const client = getClient();

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,27 @@ export interface ProfilingIntegration<T extends Client> extends Integration {
1414
}
1515

1616
export interface Profiler {
17+
/**
18+
* Starts the profiler.
19+
* @deprecated Use `startProfilerSession()` instead.
20+
*/
1721
startProfiler(): void;
22+
23+
/**
24+
* Stops the profiler.
25+
* @deprecated Use `stopProfilerSession()` instead.
26+
*/
1827
stopProfiler(): void;
28+
29+
/**
30+
* Starts a new profiler session.
31+
*/
32+
startProfilerSession(): void;
33+
34+
/**
35+
* Stops the current profiler session.
36+
*/
37+
stopProfilerSession(): void;
1938
}
2039

2140
export type ThreadId = string;

packages/profiling-node/src/integration.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ function setupAutomatedSpanProfiling(client: NodeClient): void {
140140

141141
profilesToAddToEnvelope.push(profile);
142142

143-
// @ts-expect-error profile does not inherit from Event
144143
client.emit('preprocessEvent', profile, {
145144
event_id: profiledTransaction.event_id,
146145
});

0 commit comments

Comments
 (0)