PromPHP / prometheus_client_php

Prometheus instrumentation library for PHP applications
https://prometheus.io/docs/concepts/metric_types/
Apache License 2.0
423 stars 93 forks source link

More detailed access logs from php-fpm container #71

Closed thedeacon closed 2 years ago

thedeacon commented 2 years ago

Increases the level of detail in the php-fpm access log file. The updated access log format removes %u (the username associated with the request) and adds the following:

%p The PID of the process servicing the request %{micro}d The time taken to serve the request, in microseconds %C Total %CPU used to serve the request %M Peak memory allocated by PHP to serve the request, bytes %l Content-length of the request The resulting access log entry, formatted with %R %p [%t] \"%m %r\" %s %{micro}d %C %M %l, looks like this:

172.17.0.4 27 [27/Oct/2021:08:27:15 +0000] "GET /examples/some_counter.php" 200 181812 5.50 2097152 0

This is useful in determining execution-time and resource-usage of requests when doing performance testing or when tracking down blackbox testing anomalies. In most cases the access logs are never needed, but when they are this additional detail is nice to have compared to the default log format.

LKaemmerling commented 2 years ago

Good idea! Thank you