Skip to content

Releases: getsentry/sentry-php

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)

4.17.0

20 Oct 13:00

Choose a tag to compare

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

Bug Fixes

  • Empty strings will no longer display <encoding error> when serialized. (#1940)

Misc

  • Remove symfony/phpunit-bridge as a dev dependency. (#1930)
  • Update sentry.origin to be consistent with other SDKs. (#1938)

4.16.0

22 Sep 13:46

Choose a tag to compare

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

Features

  • Remove max_breadcrumbs limit. (#1890)
  • Implement __destruct in LogsHandler to make sure logs are always flushed. (#1916)

Bug Fixes

  • Use PSR log level when logging messages using the PSR-3 logger within the SDK. (#1907)
  • Remove @internal annotation from Sentry\Transport\Result. (#1904)

Misc

  • Add sentry.origin attribute to LogsHandler. (#1917)

4.15.2

03 Sep 07:26

Choose a tag to compare

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

Bug Fixes

  • Ensure the Monolog handler only processes records permitted by their log level. (#1888)

4.15.1

28 Aug 15:48

Choose a tag to compare

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

Bug Fixes

  • Do not send template attribute with logs when there are no template values (#1885)

4.15.0

20 Aug 14:29

Choose a tag to compare

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

Features

  • Add Monolog Sentry Logs handler (#1867)

    This new handler allows you to capture Monolog logs as Sentry logs. To use it, configure your Monolog logger:

    use Monolog\Logger; use Sentry\Monolog\LogsHandler; use Sentry\Logs\LogLevel; // Initialize Sentry SDK first (make sure 'enable_logs' is set to true) \Sentry\init([ 'dsn' => '__YOUR_DSN__', 'enable_logs' => true, ]); // Create a Monolog logger $logger = new Logger('my-app'); // Add the Sentry logs handler // Optional: specify minimum log level (defaults to LogLevel::debug()) $handler = new LogsHandler(LogLevel::info()); $logger->pushHandler($handler); // Now your logs will be sent to Sentry $logger->info('User logged in', ['user_id' => 123]); $logger->error('Payment failed', ['order_id' => 456]);

    Note: The handler will not collect logs for exceptions (they should be handled separately via captureException).

Bug Fixes

  • Fix non string indexed attributes passed as log attributes (#1882)
  • Use correct sample_rate key when deriving sampleRand (#1874)
  • Do not call Reflection*::setAccessible() in PHP >= 8.1 (#1872)