Skip to content

Commit acbafce

Browse files
committed
meta(changelog): Update Changelog for 7.50.0
1 parent a5b9284 commit acbafce

File tree

2 files changed

+99
-6
lines changed

2 files changed

+99
-6
lines changed

CHANGELOG.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,86 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 7.50.0
8+
9+
### Important Changes
10+
11+
- **feat(replay): Allow to configure URLs to capture network bodies/headers (#7953)**
12+
13+
You can now capture request/response bodies & headers of network requests in Replay.
14+
You have to define an allowlist of URLs you want to capture additional information for:
15+
16+
```js
17+
new Replay({
18+
networkDetailAllowUrls: ['https://sentry.io/api'],
19+
});
20+
```
21+
22+
By default, we will capture request/response bodies, as well as the request/response headers `content-type`, `content-length` and `accept`.
23+
You can configure this with some additional configuration:
24+
25+
```js
26+
new Replay({
27+
networkDetailAllowUrls: ['https://sentry.io/api'],
28+
// opt-out of capturing bodies
29+
networkCaptureBodies: false,
30+
// These headers are captured _in addition to_ the default headers
31+
networkRequestHeaders: ['X-Custom-Header'],
32+
networkResponseHeaders: ['X-Custom-Header', 'X-Custom-Header-2']
33+
});
34+
```
35+
36+
Note that bodies will be truncated to a max length of ~150k characters.
37+
38+
**- feat(replay): Changes of sampling behavior & public API**
39+
- feat(replay): Change the behavior of error-based sampling (#7768)
40+
- feat(replay): Change `flush()` API to record current event buffer (#7743)
41+
- feat(replay): Change `stop()` to flush and remove current session (#7741)
42+
43+
We have changed the behavior of error-based sampling, as well as adding & adjusting APIs a bit to be more aligned with expectations.
44+
See [Sampling](./packages/replay/README.md#sampling) for details.
45+
46+
We've also revamped some public APIs in order to be better aligned with expectations. See [Stoping & Starting Replays manually](./packages/replay/README.md#stopping--starting-replays-manually) for details.
47+
48+
- **feat(core): Add multiplexed transport (#7926)**
49+
50+
We added a new transport to support multiplexing.
51+
With this, you can configure Sentry to send events to different DSNs, depending of a logic of your choosing:
52+
53+
```js
54+
import { makeMultiplexedTransport } from '@sentry/core';
55+
import { init, captureException, makeFetchTransport } from '@sentry/browser';
56+
57+
function dsnFromFeature({ getEvent }) {
58+
const event = getEvent();
59+
switch(event?.tags?.feature) {
60+
case 'cart':
61+
return ['__CART_DSN__'];
62+
case 'gallery':
63+
return ['__GALLERY_DSN__'];
64+
}
65+
return []
66+
}
67+
68+
init({
69+
dsn: '__FALLBACK_DSN__',
70+
transport: makeMultiplexedTransport(makeFetchTransport, dsnFromFeature)
71+
});
72+
```
73+
74+
### Additional Features and Fixes
75+
76+
- feat(nextjs): Add `disableLogger` option that automatically tree shakes logger statements (#7908)
77+
- feat(node): Make Undici a default integration. (#7967)
78+
- feat(replay): Extend session idle time until expire to 15min (#7955)
79+
- feat(tracing): Add `db.system` span data to DB spans (#7952)
80+
- fix(core): Avoid crash when Function.prototype is frozen (#7899)
81+
- fix(nextjs): Fix inject logic for Next.js 13.3.1 canary (#7921)
82+
- fix(replay): Ensure console breadcrumb args are truncated (#7917)
83+
- fix(replay): Ensure we do not set replayId on dsc if replay is disabled (#7939)
84+
- fix(replay): Ensure we still truncate large bodies if they are failed JSON (#7923)
85+
- fix(utils): default normalize() to a max. of 100 levels deep instead of Inifnity (#7957)
86+
787
## 7.49.0
888
989
### Important Changes

packages/replay/README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ import * as Sentry from "@sentry/browser";
8686
Sentry.setUser({ email: "[email protected]" });
8787
```
8888
89-
### Stopping & re-starting replays
89+
### Stopping & starting Replays manually
9090
91-
Replay recording only starts when it is included in the `integrations` array when calling `Sentry.init` or calling `addIntegration` from the a Sentry client instance. To stop recording you can call the `stop()`.
91+
Replay recording only starts when it is included in the `integrations` array when calling `Sentry.init` or calling `addIntegration` from the a Sentry client instance. To stop recording you can call `stop()`.
9292
9393
```js
9494
import * as Sentry from "@sentry/react";
@@ -109,6 +109,16 @@ client?.addIntegration(replay);
109109
replay.stop();
110110
```
111111
112+
When both `replaysSessionSampleRate` and `replaysOnErrorSampleRate` are `0`, recording will _not_ start.
113+
In this case, you can manually start recording:
114+
115+
```js
116+
replay.start(); // Will start a session in "session" mode, regardless of sample rates
117+
replay.startBuffering(); // Will start a session in "buffer" mode, regardless of sample rates
118+
```
119+
120+
121+
112122
## Loading Replay as a CDN Bundle
113123
114124
As an alternative to the NPM package, you can use Replay as a CDN bundle.
@@ -154,8 +164,11 @@ Sampling allows you to control how much of your website's traffic will result in
154164
- `replaysSessionSampleRate` - The sample rate for replays that begin recording immediately and last the entirety of the user's session.
155165
- `replaysOnErrorSampleRate` - The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends.
156166
157-
Sampling occurs when the session is first started. `replaysSessionSampleRate` is evaluated first. If it is sampled, then the replay recording begins. Otherwise, `replaysOnErrorSampleRate` is evaluated and if it is sampled, the integration will begin buffering the replay and will only upload a replay to Sentry when an error occurs. The remainder of the replay will behave similarly to a whole-session replay.
158-
167+
When Replay is initialized, we check the `replaysSessionSampleRate`.
168+
If it is sampled, then we start recording & sending Replay data immediately.
169+
Else, if `replaysOnErrorSampleRate > 0`, we'll start recording in buffering mode.
170+
In this mode, whenever an error occurs we'll check `replaysOnErrorSampleRate`.
171+
If it is sampled, when we'll upload the Replay to Sentry and continue recording normally.
159172
160173
## Configuration
161174
@@ -234,5 +247,5 @@ This should not happen to often, but be aware that it is theoretically possible.
234247
## Manually sending replay data
235248
236249
You can use `replay.flush()` to immediately send all currently captured replay data.
237-
This can be combined with `replaysOnErrorSampleRate: 1`
238-
in order to be able to send the last 60 seconds of replay data on-demand.
250+
When Replay is currently in buffering mode, this will send up to the last 60 seconds of replay data,
251+
and also continue sending afterwards, similar to when an error happens & is recorded.

0 commit comments

Comments
 (0)