Automatic Instrumentation
The Symfony SDK offers integrations to support
If the vendors (DBAL, Cache, Twig, and HTTP client) are installed, enabled
will be set to true
, so it's likely that this configuration is the same in your app.
These integrations are hooking into critical paths of the framework and of the vendors. As a result, there may be a performance penalty. If you are updating from a previous version or installing the SDK, you may observe a degradation of your app performance, though it may not be noticeable. If you need to disable tracing, you can do so by setting enabled
to false
.
config/packages/sentry.yaml
sentry:
tracing:
enabled: true
dbal: # DB queries
enabled: true
cache: # cache pools
enabled: true
twig: # templating engine
enabled: true
http_client: # Symfony HTTP client
enabled: true
You can adjust the integrations to your needs if you want to disable a specific integration.
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
.
config/packages/sentry.yaml
sentry:
tracing:
dbal: # DB queries
enabled: false
Twig
This integration adds distributed
It is enabled by default. To disable it, set enabled
to false
.
config/packages/sentry.yaml
sentry:
tracing:
twig: # templating engine
enabled: false
Cache
This integration adds support for distributed
It is enabled by default. To disable it, set enabled
to false
.
config/packages/sentry.yaml
sentry:
tracing:
cache: # cache pools
enabled: false
HTTP Client
This integration adds support for distributed
It is enabled by default. To disable it, set enabled
to false
.
config/packages/sentry.yaml
sentry:
tracing:
http_client: # Symfony HTTP client
enabled: false
As the HTTP client tracing is based on Symfony's TraceableHttpClient, you must consider the following:
- Using HTTP client tracing will not execute your requests concurrently.
- To get correct span timings, don't assign the response of the request to a variable if you don't intend to use it.
// Correct way
$this->client->request('GET',
'https://example.com'
);
// Incorrect way
$response = $this->client->request('GET',
'https://example.com'
);
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
- Package:
- composer:sentry/sentry-symfony
- Version:
- 4.11.0
- Repository:
- https://github.com/getsentry/sentry-symfony