Skip to content

Commit 4e60cfe

Browse files
authored
Prepare 4.21.0 (#2015)
1 parent 10d2347 commit 4e60cfe

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# CHANGELOG
22

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+
334
## 4.20.0
435

536
The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v4.20.0.

0 commit comments

Comments
 (0)