Skip to content

Instantly share code, notes, and snippets.

@pwhelan
Created October 14, 2021 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwhelan/4cd257ef075defbd5abaca5d9472323b to your computer and use it in GitHub Desktop.
Save pwhelan/4cd257ef075defbd5abaca5d9472323b to your computer and use it in GitHub Desktop.
Fluent Bit Nginx Exporter Metrics instructions
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;
}
}
# 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