You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Monitoring Nginx from Grafana with InfluxDB-Telegraf & Prometheus
InfluxDB for Time Database
Telegraf for Metrics Server Agent
Prometheus for Metrics Collector
Grafana for Metrics Visualizator
I just want to exploration about monitoring some metrcis Nginx with LoadBalancer Topology on Grafana.
This is an continous project from [https://gist.github.com/gilangvperdana/53a70f9a64d3f7becebfa5f3a3d54c1f]
Environment
Ubuntu Server 20.04 LTS
Docker
Nginx
InfluxDB
Telegraf
Prometheus
Grafana
the basic difference about "nginx-lbs-metrics" and "nginx-lbs" is the difference in enabling "/nginx_status".
this is the addition :
---
# ACCESS METRICS ON /nginx_status
server {
listen 80;
listen [::]:80;
server_name 172.19.0.10 172.19.0.10;
location /nginx_status {
stub_status on;
access_log off;
}
}
---
The difference lies in [[inputs.nginx]] , [[inputs.tail]] , [[outputs.prometheus_client]] , [[outputs.influxdb_v2]]
So, you must change "token" variable on [[outputs.influxdb_v2]]. You can define the variable with execute this on InfluxDB container :
$ influx auth list
then, copy token and define on telegraf container : /etc/telegraf/telegraf.conf. Define on "token" in [[outputs.influxdb_v2]].
docker run --name grafana --net nginxnet --ip 172.19.0.20 -d grafana/grafana:8.4.4
Access Grafana Dashboard, add Prometheus for Data Source with 172.19.0.50:9090 then save.
Import dashboard with code 14900 or https://grafana.com/grafana/dashboards/14900 then use Prometheus for Data Source, save.
Happy monitoring !
Access
This is defined on Container IP which is can't access on public env, but you can access with SOCKSv5 technique.
https://labs.com/ for Frontend
http://172.19.0.10/nginx_status for Nginx Metrics Exposed
http://172.19.0.2:8086 for InfluxDB
http://172.19.0.3:8125/metrics for Telegraf
http://172.19.0.50:9090/ for Prometheus
http://172.19.0.20:3000 for Grafana