「Nginx」- 监控 | 日志 | 追踪 | ……

日志

Nginx/Configuring Logging
Nginx/Module ngx_http_log_module

Nginx 的日志功能能是由 ngx_http_log_module 模块提供;

监控

Module ngx_http_stub_status_module | https://nginx.org/en/docs/http/ngx_http_stub_status_module.html
nginx-prometheus-exporter | https://github.com/nginxinc/nginx-prometheus-exporter
Grafana Dashboard | https://github.com/nginxinc/nginx-prometheus-exporter/tree/main/grafana

通过请求日志,来统计状态码 | prometheus-nginxlog-exporter

NGINX Performance Metrics with Prometheus

主页:https://github.com/martin-helmich/prometheus-nginxlog-exporter
文档:https://github.com/martin-helmich/prometheus-nginxlog-exporter
仓库:https://github.com/martin-helmich/prometheus-nginxlog-exporter

Grafana Dashboard:
https://grafana.com/grafana/dashboards/16155-ngnix-routes-exporter/
https://grafana.com/grafana/dashboards/15947-nginx-log-metrics-m/

HCL Configuration | https://developer.hashicorp.com/terraform/language/syntax/configuration

# 07/18/2024 | prometheus-nginxlog-exporter v1.11.0 | .deb | Ubuntu 18.04.4 LTS

systemctl edit prometheus-nginxlog-exporter.service,否则读取 Nginx 日志会返回 Permission Deined 错误。
https://github.com/martin-helmich/prometheus-nginxlog-exporter/issues/354

[Service]
CapabilityBoundingSet=~