Google Stackdriver has various plugins for metrics on third-party applications. Looking for an integration with php-fpm, I came across this thread: https://groups.google.com/g/google-stackdriver-discussion/c/_okXG7SYqGg
While there was a mention of success, there was no description, example or explanation. I set out to find a solution myself and want to share that here.
The end-result is basically a combination of a CollectD example for php-fpm with the example in the Stackdriver documents for custom metrics using Nginx
Note: in order for the stackdriver-agent to gather stats on your php-fpm installation, the path needs to be exposed by the webserver. I used Apache2 (example attached), but something similar can be easily achieved with Nginx as well.