sensu-plugins / sensu-plugins-php-fpm

Sensu Php-fpm Plugins
http://sensu-plugins.io
MIT License
1 stars 11 forks source link

Empty slow_requests #5

Open 11mariom opened 8 years ago

11mariom commented 8 years ago

Hi,

metrics gives empty slow_requests field:

[root@test ~]# /opt/sensu/embedded/bin/metrics-php-fpm.rb -s test -u http://127.0.0.1:61708/status
test.start_since 47439 1452163187
test.accepted_conn 16939 1452163187
test.listen_queue 0 1452163187
test.max_listen_queue 0 1452163187
test.listen_queue_len 0 1452163187
test.idle_processes 6 1452163187
test.active_processes 2 1452163187
test.total_processes 8 1452163187
test.max_active_processes 8 1452163187
test.max_children_reached 1 1452163187
test.slow_requests

[root@test ~]#

which causes influxdb error:

[2016/01/07 11:28:19 CET] [EROR] (github.com/influxdb/influxdb/api/graphite.(*Server).handleClient:261) GraphiteServer:%!(EXTRA *errors.errorString=Received 'test.php_fpm.slow_requests' which doesn't have three fields)
[2016/01/07 11:28:19 CET] [EROR] (github.com/influxdb/influxdb/api/graphite.(*Server).handleClient:261) GraphiteServer:%!(EXTRA *errors.errorString=Received '' which doesn't have three fields)

Maybe check if stats['status'][name] is not empty and then call output?

eheydrick commented 8 years ago

Does the php-fpm-status output not contain slow_requests? I think checking for empty is reasonable.

11mariom commented 8 years ago

Yeah, it does not contain this string:

[root@test ~]# curl http://127.0.0.1:61708/status
pool:                 www
process manager:      dynamic
start time:           08/Jan/2016:09:52:31 +0100
start since:          4114
accepted conn:        1592
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       20
active processes:     1
total processes:      21
max active processes: 16
max children reached: 0
[root@test ~]#
majormoses commented 6 years ago

Sounds like we need an option to ignore specific keys. To follow established patterns this should be a comma separated list of regexes.