Skip to content

publish: getsentry/sentry-php@4.21.0 #7256

@sentry-release-bot

Description

@sentry-release-bot

Requested by: @stayallive

Merge target: master

Quick links:

Assign the accepted label to this issue to approve the release.

Targets

  • github
  • registry

Checked targets will be skipped (either already published or user-requested skip). Uncheck to retry a target.


📋 Changelog

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

Features

  • Add RuntimeContext and context lifecycle helpers for long-lived runtimes such as FrankenPHP and RoadRunner. (#2011)

Long-lived worker runtimes keep process memory between requests, which can cause scope data to leak from one request to the next.
RuntimeContext isolates SDK state per request and flushes buffered telemetry when the request context ends.
Data configured before a runtime context is started is copied into each new context as baseline scope data.

Example:

\Sentry\init([
    'dsn' => '__YOUR_DSN__',
]);

$handler = static function (): void {
    \Sentry\withContext(static function (): void {
        // Handle one request.
    });
};

while (frankenphp_handle_request($handler)) {}

When using a runtime context, manual \Sentry\flush() calls are not needed for request teardown.
It is still necessary to finish transactions explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedAdd to approve the deploy
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions