Search code examples
laravelelasticsearchlogstashkibanaobservability

Observability in Laravel Applications


There are three main pillars of observability in applications; metrics, traces, and logs. I would want my laravel applications to be "observable" wrt to these.

Tools like Elastic, Logstash and Kibana seem to be industry standard but I cant seem to get good tutorials on how to integrate them with laravel and generally my understanding of them is hazy.

So, question is:

What observability tools do laravel developers generally use? If the option falls on the ELK stack, are there any great tutorials or guides on how to do this? Kibana guides are a bit too complex for a feeble mind like mine. But I am willing to get a few nosebleeds while at it - if thats the only way.


Solution

  • The first and easiest thing to do since you're running Laravel is to install and configure the APM agent for PHP which supports Laravel out of the box. This will take care of the "tracing" pillar.

    Regarding metrics, you can install Metricbeat with the system module and the PHP_FPM module. This will take care of the "metrics" pillar.

    Finally, for the "logs" pillar, you can install Filebeat with the nginx module to index your Nginx Laravel logs.

    Those three will allow you to observe your Laravel applications very easily.