SnapShooter Backups Server, Database, Application and Laravel Backups - Get fully protected with SnapShooter

Monitoring a PHP application

After months and months of development, our PHP application is finally live and running. What is going to happen next?

In an imaginary world, we sit and relax. We watch our application get popular and users flood in. And the application will just handle itself nicely because we have done all the testing. Right? Unfortunately, that is not the truth.

As users come in, errors start happening. No matter how many tests we have done. It is impossible to cover all the edge cases caused by real users.

Monitoring is the next step after development. It is the next thing we need to do after our application goes live.

In this tutorial, we discuss what things to monitor and their related services we have used.

Request monitoring

For each web request, we want to monitor its metrics such as its URI, request method, response time, status code, and so on.

From the metrics above, we can derive average response time, error rates, and so on.

Related services:

  • Datadog: https://www.datadoghq.com/
  • Amazon CloudWatch: https://aws.amazon.com/cloudwatch/

Exception monitoring

Exceptions from our codebase typically indicate some critical errors or edge cases in our system. We want to fix them before users get affected by their occurrence.

Related services:

  • Raygun: https://raygun.com/languages/php
  • Rollbar: https://rollbar.com/error-tracking/php/
  • Bugsnag: https://www.bugsnag.com/platforms/php

Log monitoring

When it comes to debugging and troubleshooting. Logs are essential. They contain information we need to fix errors and trace user behaviors.

Related service:

  • Loggly: https://www.loggly.com/
  • Papertrailapp: https://papertrailapp.com/

Dependencies monitoring

Modern PHP applications use external services(dependencies) such as MySQL, Elasticsearch, Redis, and so on. We need to monitor their performance to ensure the whole application's health.

Related tool:

  • Solarwinds: https://www.solarwinds.com/server-application-monitor/use-cases/mysql-monitor

End

What other information do you monitor and what tools do you use? Please leave a comment to let us know.