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?
Asked
Active
Viewed 1,087 times
1 Answers
1
To monitor nginx status page metrics:
- Your server need to be google cloud instance or an AWS instance.
- Yes. You need to install the agent on your server/instance/docker
- You need to add nginx plugin configuration.
- You have to modify your Nginx configuration to allow Stackdriver agent to access the status page.
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

Peycho Dimitrov
- 1,317
- 1
- 7
- 6