Sylius Monitoring with Vigilmon
Sylius is an open-source PHP/Symfony e-commerce framework built for enterprises that need a highly customizable commerce platform rather than an off-the-shelf solution. Unlike PrestaShop or OpenCart, Sylius is headless and API-first — built on Symfony with a REST API, Admin UI, and full event-driven architecture. It's the platform of choice for engineering teams building custom commerce applications: B2B portals, multi-channel storefronts, and marketplace platforms.
Because Sylius is API-first, its monitoring surface differs from traditional PHP storefronts. Both the Shop API and Admin API are critical infrastructure — and Symfony Messenger workers run the background processing that keeps orders, carts, and email notifications flowing. This guide covers how to monitor Sylius with Vigilmon.
What to Monitor in a Sylius Application
| Layer | URL Pattern | What Failure Means |
|-------|-------------|-------------------|
| Storefront homepage | https://yourstore.com/ | Customer-facing UI broken |
| Shop API | https://yourstore.com/api/v2/shop/products | Headless frontend and mobile apps broken |
| Admin API | https://yourstore.com/api/v2/admin/products | Admin UI and back-office integrations broken |
| SSL certificate | HTTPS on your domain | Browser warnings; API client trust broken |
| Messenger worker heartbeat | Symfony Messenger | Order email, cart clearing, digest delivery backing up |
| Task scheduler heartbeat | Symfony task scheduler | Order expiration and cleanup tasks failing silently |
Prerequisites
- A running Sylius installation (1.12.x or later) accessible over HTTPS
- A Vigilmon account
- Sylius Admin API credentials (for Admin API monitoring — created in your Sylius admin panel)
- SSH access to your server (for worker heartbeat monitoring)
Monitoring the Storefront
Step 1: Homepage Availability Monitor
- Log in to Vigilmon → Monitors → New Monitor
- Type: HTTP
- Method: GET
- URL:
https://yourstore.com/ - Interval: 1 minute
- Keyword check: your store name or a visible heading on the Sylius Twig storefront
Sylius's Twig-rendered storefront can return a 200 with a Symfony error page when the database or service container fails. A keyword check catches these silent failures.
Monitoring the Sylius Shop API
The Sylius Shop API is the public-facing REST API used by headless frontends, mobile applications, and customer-facing integrations. It requires no authentication for read operations on public resources.
Step 2: Shop Products Endpoint Monitor
- Type: HTTP
- Method: GET
- URL:
https://yourstore.com/api/v2/shop/products - Expected status: 200
- Keyword check:
"hydra:member"(Sylius uses the JSON-LD/Hydra format; collections are wrapped in ahydra:memberarray)
A healthy response:
{
"@context": "/api/v2/contexts/Product",
"@id": "/api/v2/shop/products",
"@type": "hydra:Collection",
"hydra:member": [...],
"hydra:totalItems": 42
}
If you want to verify a specific product is accessible, append its slug:
GET https://yourstore.com/api/v2/shop/products/my-product-slug
Add a keyword check for "hydra:member" or a field from your product schema.
Step 3: Shop Cart Endpoint Monitor
The cart endpoint is used by every add-to-cart operation. Monitor it to detect checkout-path failures:
POST https://yourstore.com/api/v2/shop/orders
Content-Type: application/json
{}
Configure Vigilmon:
- Method: POST
- Body:
{} - Expected status: 201
- Keyword check:
"tokenValue"(Sylius returns a cart token on creation)
Monitoring the Sylius Admin API
The Admin API powers the Sylius admin panel and any back-office integrations (ERP sync, order management systems). It requires Bearer token authentication.
Step 4: Admin API Authentication and Endpoint Monitor
First, configure a monitor to verify the Admin API authentication endpoint is functional:
POST https://yourstore.com/api/v2/admin/administrators/token
Content-Type: application/json
{
"email": "your-monitoring-user@example.com",
"password": "your-monitoring-password"
}
Configure Vigilmon:
- Method: POST
- URL:
https://yourstore.com/api/v2/admin/administrators/token - Headers:
Content-Type: application/json - Body:
{"email":"your-monitoring-user@example.com","password":"your-monitoring-password"} - Expected status: 200
- Keyword check:
"token"(a successful response contains a JWT)
Create a dedicated low-privilege monitoring user in Sylius Admin → Configuration → Admin Users with read-only access. Never use your primary admin credentials in a monitor configuration.
Step 5: Admin Products Endpoint Monitor
Once authentication is confirmed, monitor the Admin products listing — a lightweight read operation that exercises the full API stack:
- Type: HTTP
- Method: GET
- URL:
https://yourstore.com/api/v2/admin/products - Headers:
Authorization: Bearer YOUR_STATIC_TOKEN - Expected status: 200
- Keyword check:
"hydra:member"
For a static token approach, generate a long-lived API token in Sylius and use it directly in the Authorization header. Rotate this token periodically and update your monitor configuration when you do.
SSL Certificate Monitoring
Sylius API clients (headless frontends, mobile apps, ERP systems) enforce certificate validity. A lapsed SSL certificate breaks not only the customer-facing storefront but every automated integration that calls the API.
Step 6: SSL Certificate Alert
- In Vigilmon, open your storefront homepage monitor
- Navigate to SSL Certificate → Enable SSL monitoring
- Warn at: 30 days before expiry
- Critical at: 14 days before expiry
Heartbeat Monitoring for Sylius Background Workers
Sylius relies on Symfony Messenger and the Symfony task scheduler for critical background processing:
Symfony Messenger workers (bin/console messenger:consume) handle:
- Order expiration processing — expiring orders that weren't confirmed within the timeout window
- Email digest delivery — sending transactional emails queued through Mailer
- Payment state machine transitions — async processing of payment notifications
Symfony Scheduler (via bin/console messenger:consume scheduler_default or scheduled-task:run):
- Cart clearing — removing expired guest carts to reclaim inventory
- Order state cleanup — processing order cancellation and expiry workflows
When Messenger workers stop — due to a PHP OOM crash, a deployment without worker restart, or a failed supervisor process — all queued messages back up silently. No error surfaces until a merchant notices missing emails or customers report un-cancelled orders.
Step 7: Create Heartbeat Monitors
Create two heartbeat monitors:
Messenger Worker Heartbeat:
- In Vigilmon → Monitors → New Monitor
- Type: Heartbeat
- Name: Sylius Messenger Worker
- Interval: 5 minutes
Scheduler Heartbeat:
- Type: Heartbeat
- Name: Sylius Task Scheduler
- Interval: 60 minutes
Copy both generated heartbeat URLs.
Step 8: Ping Heartbeats from Your Workers
Monitoring the Messenger worker via cron (check that the worker process is alive every 5 minutes):
*/5 * * * * pgrep -f "messenger:consume" > /dev/null && curl -fsS --retry 3 https://vigilmon.online/api/heartbeat/your-messenger-token > /dev/null
For supervisor-managed workers, create a wrapper:
[program:sylius-worker]
command=/usr/bin/php /var/www/sylius/bin/console messenger:consume async --time-limit=3600
autostart=true
autorestart=true
Then add the heartbeat check as a cron that watches supervisor's reported state:
*/5 * * * * supervisorctl status sylius-worker | grep -q RUNNING && curl -fsS --retry 3 https://vigilmon.online/api/heartbeat/your-messenger-token > /dev/null
For the Symfony Scheduler (run as a cron job):
# Run the Symfony scheduler every hour
0 * * * * /usr/bin/php /var/www/sylius/bin/console messenger:consume scheduler_default --limit=100 >> /var/log/sylius-scheduler.log 2>&1 && curl -fsS --retry 3 https://vigilmon.online/api/heartbeat/your-scheduler-token > /dev/null
Alerting Configuration
Alert Routing
- Storefront down: alert after 1 failed check — customers can't browse
- Shop API down: alert after 1 failed check — headless frontend and mobile apps broken
- Admin API down: alert after 2 failed checks — back-office integrations failing
- Messenger worker heartbeat missing: alert after 10 minutes — queued messages backing up
- Scheduler heartbeat missing: alert after 90 minutes — cleanup and expiry tasks failing
Sample Alert (Messenger Worker Down)
🔴 DOWN: Sylius Messenger Worker
Monitor: Messenger Worker Heartbeat
Last ping: 18 minutes ago (expected every 5 minutes)
→ Check supervisor: supervisorctl status sylius-worker
→ Check for OOM: dmesg | grep -i "killed process"
→ Restart: supervisorctl restart sylius-worker
Summary
| Monitor | URL | Check | Alert Threshold |
|---------|-----|-------|-----------------|
| Storefront homepage | / | Store keyword | 1 failed check |
| Shop API products | /api/v2/shop/products | "hydra:member" | 1 failed check |
| Shop cart creation | /api/v2/shop/orders | "tokenValue" | 1 failed check |
| Admin API auth | /api/v2/admin/administrators/token | "token" | 2 failed checks |
| Admin API products | /api/v2/admin/products | "hydra:member" | 2 failed checks |
| SSL certificate | HTTPS domain | Expiry threshold | 30 days warning |
| Messenger worker | Vigilmon heartbeat URL | Ping every 5 min | 10 min without ping |
| Task scheduler | Vigilmon heartbeat URL | Ping every hour | 90 min without ping |
With these monitors in place, you'll detect Sylius API failures, storefront outages, and silently stopped background workers before they cascade into delayed order processing, backed-up email queues, or uncleared expired carts.