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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,36 @@
1
1
# CHANGELOG
2
2
3
+
## 4.21.0
4
+
5
+
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.21.0.
6
+
7
+
### Features
8
+
9
+
- Add `RuntimeContext` and context lifecycle helpers for long-lived runtimes such as FrankenPHP and RoadRunner. [(#2011)](https://github.com/getsentry/sentry-php/pull/2011)
10
+
11
+
Long-lived worker runtimes keep process memory between requests, which can cause scope data to leak from one request to the next.
12
+
`RuntimeContext` isolates SDK state per request and flushes buffered telemetry when the request context ends.
13
+
Data configured before a runtime context is started is copied into each new context as baseline scope data.
14
+
15
+
Example:
16
+
17
+
```php
18
+
\Sentry\init([
19
+
'dsn' => '__YOUR_DSN__',
20
+
]);
21
+
22
+
$handler = static function (): void {
23
+
\Sentry\withContext(static function (): void {
24
+
// Handle one request.
25
+
});
26
+
};
27
+
28
+
while (frankenphp_handle_request($handler)) {}
29
+
```
30
+
31
+
When using a runtime context, manual `\Sentry\flush()` calls are not needed for request teardown.
32
+
It is still necessary to finish transactions explicitly.
33
+
3
34
## 4.20.0
4
35
5
36
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.20.0.
0 commit comments