Packages

@sentry/tracing

7.120.4 · 29 Jul 2025MIT1.8M / weekRepositoryHomepagenpmAtom feed

Your version

7.50.0

27 Apr 2023Where it was published

7.120.4 is the newest release of 7.x.

In short

1 breaking9 new6 fixed1 internal

  • breaking

    The final breaking change is that sentryHandle is now a function.

Release note

Important Changes

With this release, the Sveltekit SDK (@sentry/sveltekit) is promoted to Beta.
This means that we do not expect any more breaking changes.

The final breaking change is that sentryHandle is now a function.
So in order to update to 7.50.0, you have to update your hooks.server.js file:

// hooks.server.js

// Old:
export const handle = sentryHandle;
// New:
export const handle = sentryHandle();
  • replay: Allow to configure URLs to capture network bodies/headers

You can now capture request/response bodies & headers of network requests in Replay.
You have to define an allowlist of URLs you want to capture additional information for:

new Replay({
  networkDetailAllowUrls: ['https://sentry.io/api'],
});

By default, we will capture request/response bodies, as well as the request/response headers content-type, content-length and accept.
You can configure this with some additional configuration:

new Replay({
  networkDetailAllowUrls: ['https://sentry.io/api'],
  // opt-out of capturing bodies
  networkCaptureBodies: false,
  // These headers are captured _in addition to_ the default headers
  networkRequestHeaders: ['X-Custom-Header'],
  networkResponseHeaders: ['X-Custom-Header', 'X-Custom-Header-2']
});

Note that bodies will be truncated to a max length of ~150k characters.

- feat(replay): Changes of sampling behavior & public API

  • replay: Change the behavior of error-based sampling

  • replay: Change flush() API to record current event buffer

  • replay: Change stop() to flush and remove current session

We have changed the behavior of error-based sampling, as well as adding & adjusting APIs a bit to be more aligned with expectations.
See Sampling for details.

We've also revamped some public APIs in order to be better aligned with expectations. See Stoping & Starting Replays manually for details.

  • core: Add multiplexed transport

We added a new transport to support multiplexing.
With this, you can configure Sentry to send events to different DSNs, depending on a logic of your choosing:

import { makeMultiplexedTransport } from '@sentry/core';
import { init, captureException, makeFetchTransport } from '@sentry/browser';

function dsnFromFeature({ getEvent }) {
  const event = getEvent();
  switch(event?.tags?.feature) {
    case 'cart':
      return ['__CART_DSN__'];
    case 'gallery':
      return ['__GALLERY_DSN__'];
  }
  return []
}

init({
  dsn: '__FALLBACK_DSN__',
  transport: makeMultiplexedTransport(makeFetchTransport, dsnFromFeature)
});

Additional Features and Fixes

  • nextjs: Add disableLogger option that automatically tree shakes logger statements

  • node: Make Undici a default integration.

  • replay: Extend session idle time until expire to 15min

  • tracing: Add db.system span data to DB spans

  • core: Avoid crash when Function.prototype is frozen

  • nextjs: Fix inject logic for Next.js 13.3.1 canary

  • replay: Ensure console breadcrumb args are truncated

  • replay: Ensure we do not set replayId on dsc if replay is disabled

  • replay: Ensure we still truncate large bodies if they are failed JSON

  • utils: Default normalize() to a max. of 100 levels deep instead of Inifnity

Work in this release contributed by @Jack-Works. Thank you for your contribution!

Bundle size

PathSize
@sentry/browser - ES5 CDN Bundle (gzipped + minified)21.02 KB
@sentry/browser - ES5 CDN Bundle (minified)65.66 KB
@sentry/browser - ES6 CDN Bundle (gzipped + minified)19.56 KB
@sentry/browser - ES6 CDN Bundle (minified)58.12 KB
@sentry/browser - Webpack (gzipped + minified)21.17 KB
@sentry/browser - Webpack (minified)69.07 KB
@sentry/react - Webpack (gzipped + minified)21.19 KB
@sentry/nextjs Client - Webpack (gzipped + minified)49.03 KB
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)28.59 KB
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)26.82 KB
@sentry/replay ES6 CDN Bundle (gzipped + minified)46.81 KB
@sentry/replay - Webpack (gzipped + minified)40.59 KB
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified)65.62 KB
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified)58.57 KB