Created
October 14, 2021 15:59
-
-
Save pwhelan/4cd257ef075defbd5abaca5d9472323b to your computer and use it in GitHub Desktop.
Fluent Bit Nginx Exporter Metrics instructions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name localhost; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
} | |
location /status { | |
stub_status; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /usr/share/nginx/html; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run docker with the nginx configuration | |
docker run --name nginx -d -v $PWD/nginx.conf:/etc/nginx.conf nginx | |
# the host line just extracts the IP address of the docker instance | |
fluent-bit \ | |
-i nginx_metrics \ | |
-p host=$(docker inspect nginx | jq -r '.[0].NetworkSettings.Networks.bridge.IPAddress') \ | |
-o stdout \ | |
-p match=* \ | |
-o prometheus_exporter \ | |
-p match=* \ | |
-p port=8090 -f 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment