Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 17 additions & 26 deletions src/platforms/php/common/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,42 @@ redirect_from:

## Default Integrations

Default integrations are integrations enabled by default that integrate into the
standard library or the interpreter itself. They are documented so you can see
what they do and that they can be disabled if they cause issues. To disable
system integrations set `default_integrations => false` when calling `init()`.
These integrations are enabled by default and integrate into the
standard library or the interpreter itself. They are documented so you can be both aware of what they do and disable them if they cause issues.

To disable system integrations, set `default_integrations => false` when calling `init()`.

### ExceptionListenerIntegration

This integration catches all global uncaught exceptions and emits events when an error occurs.

To do that, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it
as an exception listener.
To do so, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it as an exception listener.

### ErrorListenerIntegration

This integration hooks into the global PHP `error_handler` and emits events when an error occurs.

To do that, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it
as an error listener. By default, the `ErrorHandler` reserves 10 kilobytes of memory to handle
fatal errors.
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 10 kilobytes of memory to handle fatal errors.

For some frameworks or projects, there are specific integrations provided both
officially and by third-party users that automatically register the error
handlers. In that case, please refer to their documentation.
For some frameworks or projects, specific integrations are provided both officially and by third-party users that automatically register the error handlers. Please refer to their documentation.

Also, by default `E_ALL` will be handled, you can change it by setting `error_types`
a different constant in `init()`.
Also, by default `E_ALL` will be handled. You can change it by setting `error_types` to a different constant in `init()`.

### FatalErrorListenerIntegration

This integration catches all fatal errors and emits the corresponding events.

To do that, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it
as a fatal error listener.
To do so, it ensures that Sentry's `ErrorHandler` is registered, and adds a callback to it as a fatal error listener.

### RequestIntegration

This integration adds to the event request data like:
This integration adds to the event request data:

- HTTP method
- URL (including the query string)
- Body (by default only if the body is 10Kb or less)

If the [`send_default_pii` option](../configuration/options/#send-default-pii) is enabled, it will also send PII information like:
If the [`send_default_pii` option](../configuration/options/#send-default-pii) is enabled, it will also send the following PII:

- IP address
- Cookies
Expand All @@ -68,12 +61,11 @@ This integration reads excerpts of code around the line that originated an error

This integration fills the event data with PHP runtime and server OS information.


## Optional Integrations

You can enable option integration by passing them to the `integrations` option when initializing the Sentry SDK.
You can enable these integrations by passing them to the `integrations` option when initializing the Sentry SDK.

In the example below we add the optional `ModulesIntegration`.
In this example, the optional `ModulesIntegration` is added:

```php
\Sentry\init([
Expand All @@ -90,14 +82,13 @@ This integration decides whether an event should not be captured according to a

### ModulesIntegration

This integration logs with the event details all the versions of the packages installed with Composer; the root project is included too.

This integration logs all the versions of the packages installed with Composer with the event details; the root project is also included.

## Customize Integrations
## Custom Integrations

It is also possible to customize the list of integration without disabling the default integration using the `integrations` option and passing a callable.
You can customize the list of integration without disabling the default integration using the `integrations` option and passing a callable.

In the example below we leave all integrations enabled exception for the `ExceptionListenerIntegration` and add the `ModulesIntegration`.
In the example below, all integrations are enabled except the `ExceptionListenerIntegration`. In addition, the `ModulesIntegration` is added.

```php
\Sentry\init([
Expand Down
6 changes: 6 additions & 0 deletions src/platforms/php/guides/symfony/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ SENTRY_DSN="___PUBLIC_DSN___"
###< sentry/sentry-symfony ###
```

<Note>

Performance monitoring integrations related to database, caching, and template rendering are enabled by default. To disable them, please see the [Integrations documentation](/platforms/php/guides/symfony/performance/pm-integrations/).

</Note>

If you **are not** using Symfony Flex, you'll also need to enable the bundle in `config/bundles.php`:

```php {filename:config/bundles.php}
Expand Down
62 changes: 62 additions & 0 deletions src/platforms/php/guides/symfony/performance/pm-integrations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: Performance Integrations
description: "Learn about the the integrations Sentry provides for performance monitoring and how to configure them."
sidebar_order: 500
---

The Symfony SDK offers integrations that support distributed tracing, including database queries, Twig template rendering, and cache pools. These integrations are enabled by default.

To use them, you need to use the latest version of the SDK. If the vendors (DBAL, Cache, and Twig) are installed, `enabled` will be set to `true`, so it's likely that this configuration is the same in your app.

```yaml {filename:config/packages/sentry.yaml}
sentry:
tracing:
enabled: true
dbal: # DB queries
enabled: true
cache:
enabled: true
twig: # templating engine
enabled: true
```

You can adjust the integrations to your needs if you want to disable a specific integrations.

### Dbal

This integration supports tracking database queries as Spans. Enabling this option will create Spans for your queries.

It is enabled by default. To disable tracking database queries, set `enabled` to `false`.

```yaml {filename:config/packages/sentry.yaml}
sentry:
tracing:
dbal: # DB queries
enabled: true
```

### Twig

This integration adds distributed tracing for Twig template rendering using Sentry.

It is enabled by default. To disable it, set `enabled` to `false`.

```yaml {filename:config/packages/sentry.yaml}
sentry:
tracing:
twig: # templating engine
enabled: true
```

### Cache

This integration adds support for distributed tracing of cache pools.

It is enabled by default. To disable it, set `enabled` to `false`.

```yaml {filename:config/packages/sentry.yaml}
sentry:
tracing:
cache: # cache pools
enabled: true
```