Symfony with AllStak
Add automatic error, request, and query monitoring to your Symfony 6.4/7 app. The bundle is zero-config with one API key.
- Source repository:
- AllStak/allstak-symfony
- Source README:
- README.md
- SDK version:
- 0.1.0
- Installation source:
- Packagist
- Last verified:
- 2026-05-31
Installation
Install via Composer (requires PHP >= 8.1, Symfony 6.4 or 7.x).
composer require allstak/sdk-symfonyConfiguration
Symfony Flex auto-registers the bundle. Set one environment variable; an optional config file customizes integrations.
# .env
ALLSTAK_API_KEY=allstak_live_xxxxxxxx
# optional: config/packages/allstak.yaml
allstak:
api_key: '%env(ALLSTAK_API_KEY)%'
environment: '%kernel.environment%'
service: 'my-symfony-app'
integrations:
kernel: true
doctrine: true
http_client: true
messenger: trueBasic example
Without Flex, register the bundle in config/bundles.php.
return [
// ...
AllStak\SymfonyBundle\AllStakBundle::class => ['all' => true],
];Capturing errors
Unhandled exceptions are captured automatically. Inject the AllStak service to capture handled ones.
use AllStak\AllStak;
final class CheckoutController
{
public function __construct(private AllStak $allstak) {}
public function pay(): Response
{
try {
// ...
} catch (\Throwable $e) {
$this->allstak->captureError($e);
throw $e;
}
}
}Tracking requests
The kernel integration opens an http.server span per request, records an inbound HTTP request, and captures exceptions with request context — buffers drain on kernel.terminate. Doctrine queries and outbound HttpClient calls are also captured automatically when their integrations are enabled.
Best practices
- Keep ALLSTAK_API_KEY in .env; the bundle is a safe no-op when it's empty.
- Toggle integrations (kernel/doctrine/http_client/messenger/monolog) in the config.
- Set service and release for clearer grouping.