DevOps

Observability for Magento: Logs, Metrics and Alerts That Matter

10 min read·249 words
Observability for Magento: Logs, Metrics and Alerts That Matter

You can't fix what you can't see. We share our monitoring stack — Datadog, Grafana, and custom Magento log parsers — and the alerts that have saved us from major incidents.

Most Magento stores are flying blind. They know the site is down when customers stop ordering, not when the first error appears. A proper observability stack gives you the signals to catch problems before customers do. Here's what we monitor and how.

Critical Metrics to Monitor

  • Order rate per minute — sudden drops indicate checkout problems
  • PHP-FPM queue depth — approaching the limit means you need more capacity
  • MySQL query time p99 — slow queries impact all concurrent requests
  • Redis memory usage — approaching maxmemory triggers evictions
  • Varnish cache hit rate — dropping below 85% means more load on PHP
  • Magento cron execution time — stuck cron jobs delay email and order processing
  • Error rate from exception.log — spikes indicate new bugs or infrastructure problems

Log Aggregation

Magento writes logs to var/log/. Forward these to a centralized log platform (ELK stack, Datadog Logs, or Grafana Loki) using a log agent (Filebeat, Fluentd). Structure your log parsing to extract severity, exception class, and store context. Build a dashboard showing error rate over time with links to log entries for quick debugging.

Alerting Strategy

Alert on symptoms, not causes. Page your on-call engineer when the order rate drops 50% below baseline for 5 minutes — don't alert on individual PHP errors (too noisy). Create tiered alerts: PagerDuty for revenue-impacting issues, Slack for anomalies that need investigation, email digest for trends. Every alert must have a runbook link — your on-call engineer shouldn't have to figure out what to do at 3am.

#magento#ecommerce#adobe-commerce#devops#ci/cd#docker#kubernetes#deployment