Skip to content

Commit ff39258

Browse files
author
Luca Forstner
committed
Promote important section and add code example
1 parent b40c1ed commit ff39258

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

docs/migration/v8-to-v9.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,33 @@ All exports and APIs of `@sentry/utils` and `@sentry/types` (except for the ones
204204

205205
The Sentry metrics beta has ended and the metrics API has been removed from the SDK. Learn more in the Sentry [help center docs](https://sentry.zendesk.com/hc/en-us/articles/26369339769883-Metrics-Beta-Ended-on-October-7th).
206206

207+
- The `transactionContext` property on the `samplingContext` argument passed to the `tracesSampler` and `profilesSampler` options has been removed.
208+
All object attributes are available in the top-level of `samplingContext`:
209+
210+
```diff
211+
Sentry.init({
212+
// Custom traces sampler
213+
tracesSampler: samplingContext => {
214+
- if (samplingContext.transactionContext.name === '/health-check') {
215+
+ if (samplingContext.name === '/health-check') {
216+
return 0;
217+
} else {
218+
return 0.5;
219+
}
220+
},
221+
222+
// Custom profiles sampler
223+
profilesSampler: samplingContext => {
224+
- if (samplingContext.transactionContext.name === '/health-check') {
225+
+ if (samplingContext.name === '/health-check') {
226+
return 0;
227+
} else {
228+
return 0.5;
229+
}
230+
},
231+
})
232+
```
233+
207234
- The `enableTracing` option was removed.
208235
Instead, set `tracesSampleRate: 1` or `tracesSampleRate: 0`.
209236

@@ -230,8 +257,6 @@ All exports and APIs of `@sentry/utils` and `@sentry/types` (except for the ones
230257
});
231258
```
232259

233-
- The `transactionContext` property on the `samplingContext` argument passed to the `tracesSampler` and `profilesSampler` options has been removed. All object attributes are available in the top-level of `samplingContext`.
234-
235260
- The `debugIntegration` has been removed. To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...).
236261

237262
- The `sessionTimingIntegration` has been removed. To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`).

0 commit comments

Comments
 (0)