VigilmonHow to Monitor Your Symfony Application with Vigilmon Symfony is one of the most widely...
Symfony is one of the most widely used PHP frameworks for building web applications, APIs, and enterprise systems. Whether you're running a small Symfony app or a large multi-bundle monolith, uptime monitoring is essential.
This guide shows you how to set up uptime and performance monitoring for your Symfony application using Vigilmon.
Symfony apps can fail silently: a misconfigured bundle, a database timeout, or a failed queue worker may not produce an error page — they just degrade quietly. Monitoring catches these issues before your users do.
With Vigilmon, you can:
symfony/health-check-bundle)The fastest way is to add a lightweight health check controller:
<?php
// src/Controller/HealthController.php
namespace App\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
class HealthController
{
#[Route('/health', name: 'health_check')]
public function check(): JsonResponse
{
return new JsonResponse([
'status' => 'ok',
'timestamp' => time(),
]);
}
}
If you need database connectivity checks:
<?php
// src/Controller/HealthController.php
namespace App\Controller;
use Doctrine\DBAL\Connection;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
class HealthController
{
public function __construct(private Connection $db) {}
#[Route('/health', name: 'health_check')]
public function check(): JsonResponse
{
try {
$this->db->executeQuery('SELECT 1');
$dbStatus = 'ok';
} catch (\Exception $e) {
$dbStatus = 'error';
}
$status = $dbStatus === 'ok' ? 'ok' : 'degraded';
$code = $status === 'ok' ? 200 : 503;
return new JsonResponse([
'status' => $status,
'db' => $dbStatus,
'timestamp' => time(),
], $code);
}
}
For public health endpoints, keep them lightweight and return minimal info:
# config/packages/security.yaml
security:
access_control:
- { path: ^/health, roles: PUBLIC_ACCESS }
For internal metrics endpoints, restrict by IP or require an API key header.
https://yourapp.example.com/health
Symfony Messenger queue workers are critical but often unmonitored. Use a heartbeat monitor:
<?php
// src/MessageHandler/SomeMessageHandler.php
use Symfony\Contracts\HttpClient\HttpClientInterface;
class SomeMessageHandler
{
public function __construct(private HttpClientInterface $http) {}
public function __invoke(SomeMessage $message): void
{
// ... process message ...
// Ping Vigilmon heartbeat to confirm worker is alive
$this->http->request('GET', 'https://hb.vigilmon.online/your-heartbeat-id');
}
}
Vigilmon lets you create a public status page at status.vigilmon.online/your-slug showing real-time uptime for all your monitors.
Share this with your users so they can self-check before submitting support tickets.
| Endpoint | What it checks |
|---|---|
/health |
App is responding |
/health (with DB check) |
App + database |
/api/ping |
API layer |
| Queue worker heartbeat | Background jobs running |
| Redis/Memcache cache | Cache layer |
Vigilmon gives your Symfony application production-grade monitoring without the complexity of self-hosted solutions. Set up your first monitor in under 5 minutes and get alerted before your users notice a problem.
Start monitoring your Symfony app — free tier available at vigilmon.online