-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update options + symfony specific integrations doc #14891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 36.87kB (0.16%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
view changes for bundle: sentry-docs-server-cjsAssets Changed:
|
|
||
This integration catches all global uncaught exceptions and emits events when an error occurs. | ||
|
||
To do so, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it as an exception listener. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do so, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it as an exception listener. | |
It does this by ensuring that Sentry's `ErrorHandler` is registered, and adds a callback to it as an exception listener. |
|
||
This integration hooks into the global PHP `error_handler` and emits events when an error occurs. | ||
|
||
To do so, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it as an error listener. By default, the `ErrorHandler` reserves 16 KiB of memory to handle fatal errors. When handling out of memory errors, the `ErrorHandler` additionally increases the [`memory_limit`](https://www.php.net/manual/en/ini.core.php#ini.memory-limit) by an additional 5 MiB to have enough room to send the out of memory event to Sentry. This change is only done once and only affects the handling of the out of memory error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do so, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it as an error listener. By default, the `ErrorHandler` reserves 16 KiB of memory to handle fatal errors. When handling out of memory errors, the `ErrorHandler` additionally increases the [`memory_limit`](https://www.php.net/manual/en/ini.core.php#ini.memory-limit) by an additional 5 MiB to have enough room to send the out of memory event to Sentry. This change is only done once and only affects the handling of the out of memory error. | |
It does this by ensuring that Sentry's `ErrorHandler` is registered, and adds a callback to it as an error listener. By default, the `ErrorHandler` reserves 16 KiB of memory to handle fatal errors. When handling out of memory errors, the `ErrorHandler` additionally increases the [`memory_limit`](https://www.php.net/manual/en/ini.core.php#ini.memory-limit) by an additional 5 MiB to have enough room to send the out of memory event to Sentry. This change is only done once and only affects the handling of the out of memory error. |
To change the amount of memory reserved for fatal error handling or the amount the `memory_limit` is increased when handling an out of memory error, you can register the fatal error handler yourself before calling `\Sentry\init(...)`: | ||
|
||
```php | ||
// The amount of reserved memory every request (in bytes), this has to be a positive integer amount of bytes. Defaults to 16 KiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The amount of reserved memory every request (in bytes), this has to be a positive integer amount of bytes. Defaults to 16 KiB | |
// The amount of reserved memory for every request (in bytes), this has to be a positive integer in bytes. Defaults to 16 KiB |
```php | ||
// The amount of reserved memory every request (in bytes), this has to be a positive integer amount of bytes. Defaults to 16 KiB | ||
$errorHandler = \Sentry\ErrorHandler::registerOnceFatalErrorHandler(16 * 1024); | ||
// The amount of memory in bytes to increase the `memory_limit` to when handling a out of memory error, can also be set to `null` to disable increasing the `memory_limit`. Defaults to 5 MiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The amount of memory in bytes to increase the `memory_limit` to when handling a out of memory error, can also be set to `null` to disable increasing the `memory_limit`. Defaults to 5 MiB | |
// The amount of memory in bytes to increase the `memory_limit` to when handling an out of memory error. It can also be set to `null` to disable increasing the `memory_limit`. Defaults to 5 MiB |
|
||
This integration catches all fatal errors and emits the corresponding events. | ||
|
||
To do so, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it as a fatal error listener. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do so, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it as a fatal error listener. | |
It does this by ensuring that Sentry's `ErrorHandler` is registered, and adds a callback to it as a fatal error listener. |
|
||
- HTTP method | ||
- URL (including the query string) | ||
- Body (by default only if the body is 10Kb or less) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Body (by default only if the body is 10Kb or less) | |
- Body (only if the body is 10Kb or less) |
|
||
### Use a Callback to Customize Integrations | ||
|
||
For advanced cases, you can provide a callback (service) instead of a fixed list to customize integrations. See how to reference callables in Symfony configuration here: <PlatformLink to="/platforms/php/guides/symfony/configuration/symfony-options/#callables">Callables in Symfony Options</PlatformLink>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link does not exist. The closest I could find was this: /platforms/php/guides/symfony/configuration/options/
, however I could not find the #callables
option. Is that in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good! The last link is broken (see comment), and there are a few typos/phrases to clean up.
@sfanahata Thanks for the review. I updated the broken link, it now points correctly to https://docs.sentry.io/platforms/php/guides/symfony/configuration/symfony-options/#callables |
…rations
DESCRIBE YOUR PR
Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES