Skip to content

Conversation

Litarnus
Copy link
Contributor

…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.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

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

Copy link

vercel bot commented Sep 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sentry-docs Ready Ready Preview Comment Sep 18, 2025 0:06am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
develop-docs Ignored Ignored Preview Sep 18, 2025 0:06am

Copy link

codecov bot commented Sep 11, 2025

Bundle Report

Changes will increase total bundle size by 36.87kB (0.16%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 9.91MB -290 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.65MB 37.16kB (0.29%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
static/media/7c239973d8aef789-*.woff2 (New) 32.56kB 32.56kB 100.0% 🚀
static/media/32c80fb7588b7a2e-*.woff2 (New) 32.48kB 32.48kB 100.0% 🚀
static/media/a5d9f2ead0568494-*.woff2 (New) 21.08kB 21.08kB 100.0% 🚀
static/media/5b25d60b4670300e-*.woff2 (New) 19.29kB 19.29kB 100.0% 🚀
static/media/fc5b975a09123a00-*.woff2 (New) 9.75kB 9.75kB 100.0% 🚀
static/media/99e31c27a1524300-*.woff2 (New) 9.35kB 9.35kB 100.0% 🚀
static/jLXQ-*.js (New) 684 bytes 684 bytes 100.0% 🚀
static/jLXQ-*.js (New) 77 bytes 77 bytes 100.0% 🚀
static/media/4fca85807f6c09f6-*.woff2 (Deleted) -32.6kB 0 bytes -100.0% 🗑️
static/media/d695df15e3ff125c-*.woff2 (Deleted) -32.58kB 0 bytes -100.0% 🗑️
static/media/acdf4f392b58827a-*.woff2 (Deleted) -21.13kB 0 bytes -100.0% 🗑️
static/media/501d9eeee6e2b0cc-*.woff2 (Deleted) -19.41kB 0 bytes -100.0% 🗑️
static/media/a72efd2c2476ebb2-*.woff2 (Deleted) -9.7kB 0 bytes -100.0% 🗑️
static/media/9d7436bc73437f75-*.woff2 (Deleted) -9.36kB 0 bytes -100.0% 🗑️
static/R6YBbfGl7RFPxIMnDgaaL/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/R6YBbfGl7RFPxIMnDgaaL/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.78MB -0.0%
../instrumentation.js -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
../app/[[...path]]/page.js.nft.json 12.39kB 818.04kB 1.54%
../app/platform-redirect/page.js.nft.json 12.39kB 817.96kB 1.54%
../app/sitemap.xml/route.js.nft.json 12.39kB 815.43kB 1.54%


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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>.
Copy link
Contributor

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?

Copy link
Contributor

@sfanahata sfanahata left a 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.

@Litarnus
Copy link
Contributor Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants