Skip to content

Releases: getsentry/sentry-php

4.29.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 29 Jun 14:53

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

Features

  • Scrub Proxy-Authorization request headers by default. (#2126)
  • Send gen_ai spans using the span v2 protocol. (#2141)

Bug Fixes

  • Reset fatal error handler state when starting a new runtime context. (#2128)

4.28.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 11 Jun 12:28

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

Features

  • Add SentryPropagator to inject and extract sentry-trace headers in OpenTelemetry contexts. (#2105)

Bug Fixes

  • Keep feature flag values serialized as a JSON list when a flag is updated multiple times. (#2104)

4.27.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 06 May 14:39

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

Features

  • Add profiles_sampler option. (#2082)

Bug Fixes

  • Preserve manually configured user attributes on logs and metrics when send_default_pii is disabled. (#2083)

Misc

  • Add Mago static analysis to CI. (#2020)

4.26.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 05 May 08:49

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

Features

  • Add AgentClient and AgentClientBuilder to hand off envelopes to a local Sentry agent. (#2062)
  • Add fallback HTTP delivery for AgentClient when the local Sentry agent is unavailable. (#2072)
  • Add LogToSentryIssueHandler Monolog handler to capture log messages as Sentry issues. (#2075)

Bug Fixes

  • Respect send_default_pii before attaching user attributes to Sentry logs. (#2076)
  • Ignore invalid propagated sentry-sample_rand baggage values and generate a valid sample random value instead. (#2077)

4.25.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 23 Apr 13:02

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

Features

  • Add ExceptionToSentryIssueHandler Monolog handler that only captures exceptions as Sentry issues without converting log messages to errors. (#2061)
  • Add metric_flush_threshold option to automatically flush buffered metrics after a configured number of metric records. (#2059)
\Sentry\init([
    'dsn' => '__YOUR_DSN__',
    'metric_flush_threshold' => 50,
]);

Bug Fixes

  • Prevent PHP warnings when trying to increase the memory limit for out-of-memory error handling. (#2063)

Misc

  • Use a RingBuffer for log storage when log_flush_threshold is not set to prevent unbounded memory growth, with a hard cap of 1000 records. (#2058)
  • Add ext-excimer as a Composer suggestion to surface its requirement for profiling. (#2057)

4.24.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 01 Apr 14:39

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

Bug Fixes

  • Serialize native PHP enums as readable enum strings, including backed enum values, instead of opaque Object strings. (#2038)
  • Exclude AGENTS.md and CLAUDE.md from distribution archives. (#2046)

Misc

  • Deprecate Sentry\Monolog\Handler in favor of Sentry\Monolog\LogsHandler with the enable_logs SDK option. (#2051)

4.23.1

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 30 Mar 07:40

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

Bug Fixes

  • Use server.address log attribute instead of sentry.server.address. (#2040)

4.23.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 23 Mar 13:20

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

Features

  • Add OTLPIntegration support to interoperate with OpenTelemetry traces. (#2030)
\Sentry\init([
    'dsn' => '__YOUR_DSN__',
    'integrations' => [
        new \Sentry\Integration\OTLPIntegration(),
    ],
]);
  • Add log_flush_threshold to automatically flush buffered logs after a configured number of log records. (#2032)
\Sentry\init([
    'dsn' => '__YOUR_DSN__',
    'enable_logs' => true,
    'log_flush_threshold' => 20,
]);

4.22.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 16 Mar 14:09

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

Features

  • Add support for the client report protocol without collecting client reports yet. (#1978)
  • Add strict_trace_continuation support to only continue incoming traces when the upstream baggage org_id matches the SDK org ID. (#2016)

Example:

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

Bug Fixes

  • Preserve sub-second timestamps for Monolog breadcrumbs. (#2018)

4.21.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 24 Feb 15:42

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.