Skip to content

Releases: getsentry/sentry-php

3.22.1

13 Nov 11:53
8859631
Compare
Choose a tag to compare

The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v3.22.1.

Bug Fixes

  • Fix capturing out-of-memory errors when memory-constrained (#1633)

4.0.0

06 Nov 10:19
Compare
Choose a tag to compare

The Sentry SDK team is thrilled to announce the immediate availability of Sentry PHP SDK v4.0.0.

Breaking Change

Please refer to the UPGRADE-4.0.md guide for a complete list of breaking changes.

  • This version exclusively uses the envelope endpoint to send event data to Sentry.

    If you are using sentry.io, no action is needed.
    If you are using an on-premise/self-hosted installation of Sentry, the minimum requirement is now version >= v20.6.0.

  • You need to have ext-curl installed to use the SDK.

  • The IgnoreErrorsIntegration integration was removed. Use the ignore_exceptions option instead.

    Sentry\init([
        'ignore_exceptions' => [BadThingsHappenedException::class],
    ]);

    This option performs an is_a check now, so you can also ignore more generic exceptions.

Features

  • Add new fluent APIs (#1601)

    // Before
    $transactionContext = new TransactionContext();
    $transactionContext->setName('GET /example');
    $transactionContext->setOp('http.server');
    
    // After
    $transactionContext = (new TransactionContext())
        ->setName('GET /example');
        ->setOp('http.server');
  • Simplify the breadcrumb API (#1603)

    // Before
    \Sentry\addBreadcrumb(
        new \Sentry\Breadcrumb(
            \Sentry\Breadcrumb::LEVEL_INFO,
            \Sentry\Breadcrumb::TYPE_DEFAULT,
            'auth',                // category
            'User authenticated',  // message (optional)
            ['user_id' => $userId] // data (optional)
        )
    );
    
    // After
    \Sentry\addBreadcrumb(
        category: 'auth', 
        message: 'User authenticated', // optional
        metadata: ['user_id' => $userId], // optional
        level: Breadcrumb::LEVEL_INFO, // set by default
        type: Breadcrumb::TYPE_DEFAULT, // set by default
    );
  • New logger option (#1625)

    To make it easier to debug the internals of the SDK, the logger option now accepts a Psr\Log\LoggerInterface instance.
    We do provide two implementations, Sentry\Logger\DebugFileLogger and Sentry\Logger\DebugStdOutLogger.

    // This logs messages to the provided file path
    Sentry\init([
        'logger' => new DebugFileLogger(filePath: ROOT . DS . 'sentry.log'),
    ]);
    
    // This logs messages to stdout
    Sentry\init([
        'logger' => new DebugStdOutLogger(),
    ]);
  • New default cURL HTTP client (#1589)

    The SDK now ships with its own HTTP client based on cURL. A few new options were added.

    Sentry\init([
        'http_proxy_authentication' => 'username:password', // user name and password to use for proxy authentication
        'http_ssl_verify_peer' => false, // default true, verify the peer's SSL certificate
        'http_compression' => false, // default true, http request body compression
    ]);

    To use a different client, you may use the http_client option.

    use Sentry\Client;
    use Sentry\HttpClient\HttpClientInterface;
    use Sentry\HttpClient\Request;
    use Sentry\HttpClient\Response;
    use Sentry\Options;
    
    $httpClient = new class() implements HttpClientInterface {
        public function sendRequest(Request $request, Options $options): Response
        {
    
            // your custom implementation
    
            return new Response($response->getStatusCode(), $response->getHeaders(), '');
        }
    };
    
    Sentry\init([
        'http_client' => $httpClient,
    ]);

    To use a different transport, you may use the transport option. A custom transport must implement the TransportInterface.
    If you use the transport option, the http_client option has no effect.

Misc

  • The abandoned package php-http/message-factory was removed.

3.22.0

24 Oct 07:43
Compare
Choose a tag to compare

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

Features

  • Adopt Starfish HTTP attributes in spans and breadcrumbs (#1581)

Bug Fixes

  • Don't add empty HTTP fragment or query strings to breadcrumb data (#1588)

Misc

  • Remove obsolete tags option depreaction (#1588)
  • Run CI on PHP 8.3 (1591)
  • Add support for symfony/options-resolver: ^7.0 (1597)

3.21.0

31 Jul 15:43
Compare
Choose a tag to compare

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

Features

  • Add Sentry::captureCheckIn() (#1573)

    Sending check-ins from the SDK is now simplified.

    $checkInId = Sentry\captureCheckIn(
        slug: 'monitor-slug',
        status: CheckInStatus::inProgress()
    );
    
    
    // do something
    
    Sentry\captureCheckIn(
        checkInId: $checkInId,
        slug: 'monitor-slug',
        status: CheckInStatus::ok()
    );

    You can also pass in a monitorConfig object as well as the duration.

  • Undeprecate the tags option (#1561)

    You can now set tags that are applied to each event when calling Sentry::init().

    Sentry\init([
        'tags' => [
            'foo' => 'bar',
        ],
    ])
  • Apply the prefixesoption to profiling frames (#1568)

    If you added the prefixes option when calling Sentry::init(), this option will now also apply to profile frames.

    Sentry\init([
        'prefixes' => ['/var/www/html'],
    ])

Misc

  • Deduplicate profile stacks and frames (#1570)

    This will decrease the payload size of the profile event payload.

  • Add the transaction's sampling decision to the trace envelope header (#1562)

3.20.1

26 Jun 11:35
Compare
Choose a tag to compare

The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v3.20.1.

Bug Fixes

  • Use the result of isTracingEnabled() to determine the behaviour of getBaggage() and getTraceparent() (#1555)

Misc

  • Always return a TransactionContext from continueTrace() (#1556)

3.20.0

22 Jun 12:16
Compare
Choose a tag to compare

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

Features

  • Tracing without Performance (#1516)

    You can now set up distributed tracing without the need to use the performance APIs.
    This allows you to connect your errors that hail from other Sentry instrumented applications to errors in your PHP application.

    To continue a trace, fetch the incoming Sentry tracing headers and call \Sentry\continueTrace() as early as possible in the request cycle.

    $sentryTraceHeader = $request->getHeaderLine('sentry-trace');
    $baggageHeader = $request->getHeaderLine('baggage');
    
    continueTrace($sentryTraceHeader, $baggageHeader);

    To continue a trace outward, you may attach the Sentry tracing headers to any HTTP client request.
    You can fetch the required header values by calling \Sentry\getBaggage() and \Sentry\getTraceparent().

  • Upserting Cron Monitors (#1511)

    You can now create and update your Cron Monitors programmatically with code.
    Read more about this in our docs.

3.19.1

25 May 06:29
Compare
Choose a tag to compare

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

Bug Fixes

  • Use HTTP/1.1 when compression is enabled (#1542)

3.19.0

23 May 12:11
Compare
Choose a tag to compare

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

Misc

  • Add support for guzzlehttp/promises v2 (#1536)

3.18.2

17 May 11:00
Compare
Choose a tag to compare

The Sentry SDK team is happy to announce the immediate availability of Sentry PHP SDK v3.18.2.

Bug Fixes

  • Require php-http/message-factory (#1534)

3.18.1

16 May 09:41
Compare
Choose a tag to compare

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

Bug Fixes

  • Guard against empty profiles (#1528)
  • Ignore empty context values (#1529)