为了使用stackdriver监视nginx(作为应用程序),只需将loggin直接导向gcploggin驱动程序还是必须安装监视代理程序就足够了?
答案 0 :(得分:1)
监控nginx状态页面指标:
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;
}
示例Nginx插件配置: on MSDN
您可以修改stackdriver nginx插件配置以读取nginx状态指标,如下所示:
LoadPlugin nginx
<Plugin "nginx">
URL "http://localhost/nginx-status"
</Plugin>