nginxinc/docker-nginx-amplify

Unable to collect metrics for PHP-FPM running in a separate container without nginx

Opened this issue · 0 comments

I'm running two docker containers, one for nginx (as a reverse proxy) and another with just php-fpm.

I am running the amplify agent in both containers but php-fpm metrics are not available in the php-fpm container.

amplify_missing_metrics

I'm assuming it has something to do with needing the presence of an nginx process as evidenced by these logs.

2020-09-04 10:16:48,061 [290200] supervisor phpfpm objects ['5d42ce21f39c859f69769bb01ce4f54324ec5e469c4e8237c40d4b8f503b38a1']
2020-09-04 10:16:48,062 [290200] supervisor phpfpm_pool objects: []
2020-09-04 10:16:49,388 [290200] phpfpm_metrics 5d42ce21f39c859f69769bb01ce4f54324ec5e469c4e8237c40d4b8f503b38a1 collect in 0.000
2020-09-04 10:16:50,196 [290200] sys_metrics f746575ef89e9f0229cad256576d0bbf88420a26f07ddf868b431dd2c722e509 collect in 0.007
2020-09-04 10:16:53,064 [290200] supervisor system objects: ['f746575ef89e9f0229cad256576d0bbf88420a26f07ddf868b431dd2c722e509']
2020-09-04 10:16:53,072 [290200] supervisor failed to find running nginx via ps xao pid,ppid,command | grep 'nginx[:]'
2020-09-04 10:16:53,073 [290200] supervisor additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/amplify/agent/managers/nginx.py", line 218, in _find_all
    ps, _ = subp.call(ps_cmd)
  File "/usr/lib/python2.7/dist-packages/amplify/agent/common/util/subp.py", line 32, in call
    raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode, error=raw_err))

Is there a way to collect PHP-FPM metrics when it's running in a separate container from nginx?