|
1 |
| -# Changelog |
2 |
| - |
3 | 1 | ## 5.0.0
|
4 | 2 |
|
5 |
| -The Sentry SDK team is happy to announce the immediate availability of Sentry Symfony SDK v5.0.0. |
| 3 | +The Sentry SDK team is thrilled to announce the immediate availability of Sentry Symfony SDK v5.0.0. |
| 4 | + |
| 5 | +### Breaking Change |
| 6 | + |
| 7 | +Please refer to the [UPGRADE-5.0.md](https://github.com/getsentry/sentry-symfony/blob/master/UPGRADE-5.0.md) guide for a complete list of breaking changes. |
| 8 | + |
| 9 | +This version adds support for the underlying [Sentry PHP SDK v4.0](https://github.com/getsentry/sentry-php). |
| 10 | +Please refer to the PHP SDK [sentry-php/UPGRADE-4.0.md](https://github.com/getsentry/sentry-php/blob/master/UPGRADE-4.0.md) guide for a complete list of breaking changes. |
| 11 | + |
| 12 | +- This version exclusively uses the [envelope endpoint](https://develop.sentry.dev/sdk/envelopes/) to send event data to Sentry. |
| 13 | + |
| 14 | + If you are using [sentry.io](https://sentry.io), no action is needed. |
| 15 | + If you are using an on-premise/self-hosted installation of Sentry, the minimum requirement is now version `>= v20.6.0`. |
| 16 | + |
| 17 | +- You need to have `ext-curl` installed to use the SDK. |
6 | 18 |
|
7 |
| -### Breaking Changes |
| 19 | +- The `IgnoreErrorsIntegration` integration was removed. Use the `ignore_exceptions` option instead. |
| 20 | + Previously, both `Symfony\Component\ErrorHandler\Error\FatalError` and `Symfony\Component\Debug\Exception\FatalErrorException` were ignored by default. |
| 21 | + To continue ignoring these exceptions, make the following changes to the config file: |
| 22 | + |
| 23 | + ```yaml |
| 24 | + // config/packages/sentry.yaml |
| 25 | + |
| 26 | + sentry: |
| 27 | + options: |
| 28 | + ignore_exceptions: |
| 29 | + - 'Symfony\Component\ErrorHandler\Error\FatalError' |
| 30 | + - 'Symfony\Component\Debug\Exception\FatalErrorException' |
| 31 | + ``` |
| 32 | +
|
| 33 | + This option performs an [`is_a`](https://www.php.net/manual/en/function.is-a.php) check now, so you can also ignore more generic exceptions. |
8 | 34 |
|
9 | 35 | ### Features
|
10 | 36 |
|
11 |
| -### Bug Fixes |
| 37 | +- Add support for Sentry Developer Metrics [(#1619)](https://github.com/getsentry/sentry-php/pull/1619) |
| 38 | + |
| 39 | + ```php |
| 40 | + use function Sentry\metrics; |
| 41 | +
|
| 42 | + // Add 4 to a counter named hits |
| 43 | + metrics()->increment(key: 'hits', value: 4); |
| 44 | +
|
| 45 | + // Add 25 to a distribution named response_time with unit milliseconds |
| 46 | + metrics()->distribution(key: 'response_time', value: 25, unit: MetricsUnit::millisecond()); |
| 47 | +
|
| 48 | + // Add 2 to gauge named parallel_requests, tagged with type: "a" |
| 49 | + metrics()->gauge(key: 'parallel_requests', value: 2, tags: ['type': 'a']); |
| 50 | +
|
| 51 | + // Add a user's email to a set named users.sessions, tagged with role: "admin" |
| 52 | + metrics()->set('users.sessions', '[email protected]', null, ['role' => User::admin()]); |
| 53 | + ``` |
| 54 | + |
| 55 | + Metrics are automatically sent to Sentry at the end of a request, hooking into Symfony's `kernel.terminate` event. |
| 56 | + |
| 57 | +- Add new fluent APIs [(#1601)](https://github.com/getsentry/sentry-php/pull/1601) |
| 58 | + |
| 59 | + ```php |
| 60 | + // Before |
| 61 | + $transactionContext = new TransactionContext(); |
| 62 | + $transactionContext->setName('GET /example'); |
| 63 | + $transactionContext->setOp('http.server'); |
| 64 | +
|
| 65 | + // After |
| 66 | + $transactionContext = (new TransactionContext()) |
| 67 | + ->setName('GET /example'); |
| 68 | + ->setOp('http.server'); |
| 69 | + ``` |
| 70 | + |
| 71 | +- Simplify the breadcrumb API [(#1603)](https://github.com/getsentry/sentry-php/pull/1603) |
| 72 | + |
| 73 | + ```php |
| 74 | + // Before |
| 75 | + \Sentry\addBreadcrumb( |
| 76 | + new \Sentry\Breadcrumb( |
| 77 | + \Sentry\Breadcrumb::LEVEL_INFO, |
| 78 | + \Sentry\Breadcrumb::TYPE_DEFAULT, |
| 79 | + 'auth', // category |
| 80 | + 'User authenticated', // message (optional) |
| 81 | + ['user_id' => $userId] // data (optional) |
| 82 | + ) |
| 83 | + ); |
| 84 | +
|
| 85 | + // After |
| 86 | + \Sentry\addBreadcrumb( |
| 87 | + category: 'auth', |
| 88 | + message: 'User authenticated', // optional |
| 89 | + metadata: ['user_id' => $userId], // optional |
| 90 | + level: Breadcrumb::LEVEL_INFO, // set by default |
| 91 | + type: Breadcrumb::TYPE_DEFAULT, // set by default |
| 92 | + ); |
| 93 | + ``` |
| 94 | + |
| 95 | +- New default cURL HTTP client [(#1589)](https://github.com/getsentry/sentry-php/pull/1589) |
| 96 | + |
| 97 | + The SDK now ships with its own HTTP client based on cURL. A few new options were added. |
| 98 | + |
| 99 | + ```yaml |
| 100 | + // config/packages/sentry.yaml |
| 101 | +
|
| 102 | + sentry: |
| 103 | + options: |
| 104 | + - http_proxy_authentication: 'username:password' // user name and password to use for proxy authentication |
| 105 | + - http_ssl_verify_peer: false // default true, verify the peer's SSL certificate |
| 106 | + - http_compression: false // default true, http request body compression |
| 107 | + ``` |
| 108 | + |
| 109 | + To use a different client, you may use the `http_client` option. |
| 110 | + To use a different transport, you may use the `transport` option. A custom transport must implement the `TransportInterface`. |
| 111 | + If you use the `transport` option, the `http_client` option has no effect. |
12 | 112 |
|
13 | 113 | ### Misc
|
| 114 | + |
| 115 | +- The abandoned package `php-http/message-factory` was removed. |
0 commit comments