You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The continuous profiling API has been redesigned to give developers more explicit control over profiling sessions while maintaining ease of use. This guide outlines the key changes.
4
+
5
+
## New Profiling Modes
6
+
7
+
### profileLifecycle Option
8
+
9
+
We've introduced a new `profileLifecycle` option that allows you to explicitly set how profiling sessions are managed:
10
+
11
+
-`manual` (default) - You control profiling sessions using the API methods
12
+
-`trace` - Profiling sessions are automatically tied to traces
13
+
14
+
Previously, the profiling mode was implicitly determined by initialization options. Now you can clearly specify your intended behavior.
15
+
16
+
## New Sampling Controls
17
+
18
+
### profileSessionSampleRate
19
+
20
+
We've introduced `profileSessionSampleRate` to control what percentage of SDK instances will collect profiles. This is evaluated once during SDK initialization. This is particularly useful for:
21
+
22
+
- Controlling profiling costs across distributed services
23
+
- Managing profiling in serverless environments where you may only want to profile a subset of instances
24
+
25
+
### Deprecations
26
+
27
+
The `profilesSampleRate` option has been deprecated in favor of the new sampling controls.
28
+
The `profilesSampler` option hsa been deprecated in favor of manual profiler control.
// Below, we instrument the Node.js HTTP API three times. 2 times Sentry-specific, 1 time OTEL specific.
146
+
// Due to timing reasons, we sometimes need to apply Sentry instrumentation _before_ we apply the OTEL
147
+
// instrumentation (e.g. to flush on serverless platforms), and sometimes we need to apply Sentry instrumentation
148
+
// _after_ we apply OTEL instrumentation (e.g. for isolation scope handling and breadcrumbs).
149
+
150
+
// This is Sentry-specific instrumentation that is applied _before_ any OTEL instrumentation.
151
+
if(process.env.VERCEL){
152
+
// Currently this instrumentation only does something when deployed on Vercel, so to save some overhead, we short circuit adding it here only for Vercel.
153
+
// If it's functionality is extended in the future, feel free to remove the if statement and this comment.
0 commit comments