Skip to content

Releases: getsentry/sentry-php

4.23.1

30 Mar 07:40

Choose a tag to compare

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

23 Mar 13:20

Choose a tag to compare

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

16 Mar 14:09

Choose a tag to compare

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

24 Feb 15:42

Choose a tag to compare

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.

4.20.0

16 Feb 13:55

Choose a tag to compare

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

Features

  • Add a high-level flush() helper that flushes all buffered telemetry resources (logs and trace metrics). (#1989)
  • Add share handles to cURL (persistent for PHP >= 8.5, non-persistent otherwise). (#1996)
  • Handle HTTP 413 responses explicitly with a dedicated content_too_large status. (#2008)

Bug Fixes

  • Normalize Spotlight URLs to optionally allow trailing /stream. (#1984)
  • Monolog messages are now filtered by their original Monolog level before being mapped to Sentry log levels. (#1992)
  • Handle bracketed IPv6 addresses (such as [::1]). (#2007)
  • Ignore propagated baggage sample_rate when no sentry-trace header is present. (#2002)

Misc

  • Add the traceMetrics() helper and deprecate trace_metrics(). (#1995)

4.19.1

02 Dec 16:00

Choose a tag to compare

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

Bug Fixes

  • Don't cast metrics value to float in constructor, drop invalid metrics instead. (#1981)

4.19.0

27 Nov 14:59

Choose a tag to compare

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

Features

// Counter metric
\Sentry\trace_metrics()->count('test-counter', 10, ['my-attribute' => 'foo']);

// Gauge metric
\Sentry\trace_metrics()->gauge('test-gauge', 50.0, ['my-attribute' => 'foo'], \Sentry\Unit::millisecond());

// Distribution metric
\Sentry\trace_metrics()->distribution('test-distribution', 20.0, ['my-attribute' => 'foo'], \Sentry\Unit::kilobyte());

// Flush metrics
\Sentry\trace_metrics()->flush();

Bug Fixes

  • Add rate limiting for profiles and cron check-ins. (#1970)
  • Fix Spotlight so it always registers the error integrations and emits transport logs even when no DSN is configured. (#1964)

4.18.1

11 Nov 09:52

Choose a tag to compare

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

Misc

  • Add addFeatureFlag helper function. (#1960)
\Sentry\addFeatureFlag("my.feature.enabled", true);

4.18.0

05 Nov 14:48

Choose a tag to compare

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

Features

  • Add support for feature flags. (#1951)
\Sentry\SentrySdk::getCurrentHub()->configureScope(function (\Sentry\State\Scope $scope) {
    $scope->addFeatureFlag("my.feature.enabled", true);
});
  • Add more representations for log attributes instead of dropping them. (#1950)

Misc

  • Merge log attributes in a separate method. (#1931)

4.17.1

23 Oct 15:42

Choose a tag to compare

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

Misc

  • Call curl_close only on PHP version 7.4 and below to prevent deprecation warnings. (#1947)