Reputation: 31
In order to monitor nginx (as an application) using stackdriver, is it sufficient to simply direct loggin to gcploggin driver or does one have to install the monitoring agent as well?
Upvotes: 0
Views: 1136
Reputation: 1407
To monitor nginx status page metrics:
Nginx:
# Enable nginx-status for better monitoring with Stackdriver module.
location = /nginx-status {
# Turn on nginx stats
stub_status on;
# I do not need logs for stats
access_log off;
# Security: Only allow access from localhost
allow 127.0.0.1;
# Send rest of the world to /dev/null
deny all;
}
Example Nginx plugin Configuration: https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/nginx.conf
You can modify the stackdriver nginx plugin config to read nginx status metrics like this:
LoadPlugin nginx
<Plugin "nginx">
URL "http://localhost/nginx-status"
</Plugin>
More plugin configurations: https://github.com/Stackdriver/stackdriver-agent-service-configs/tree/master/etc/collectd.d
Upvotes: 1