Skip to content

Commit

Permalink
feat: add nginx and apache Prometheus metrics exporters
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Cervello authored Sep 24, 2021
2 parents 8d7a37b + ce10d7a commit 91f24fe
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/container-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
echo "COMPOSE_HTTP_TIMEOUT=120" >> .env
echo "COMPOSE_PROJECT_NAME=po" >> .env
echo "COMPOSE_PATH_SEPARATOR=;" >> .env
echo "COMPOSE_FILE=docker-compose.yml;docker/prod.yml;docker/geolite2.yml" >> .env
echo "COMPOSE_FILE=docker-compose.yml;docker/prod.yml;docker/geolite2.yml;docker/monitor.yml" >> .env
# Set App variables
echo "TAG=sha-${{ github.sha }}" >> .env
Expand Down
13 changes: 8 additions & 5 deletions conf/apache.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Apache 2.4 + mod_perl handles only the dynamic HTML generated pages
# and CGI scripts.
# Static files are served directly by the NGINX reverse proxy.

LoadModule perl_module modules/mod_perl.so
# LoadModule perl_module modules/mod_perl.so

ServerAdmin contact@${PRODUCT_OPENER_DOMAIN}
ServerName ${PRODUCT_OPENER_DOMAIN}

PerlSwitches -I/opt/product-opener/lib -I/opt/perl/local/lib/perl5

Expand Down Expand Up @@ -46,6 +43,12 @@ PerlRequire /opt/product-opener/lib/startup_apache2.pl
# log the X-Forwarded-For IP address (the client ip) in access_log
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy

ExtendedStatus On
<Location /server-status>
SetHandler server-status
Require all granted
</Location>

<Location /cgi>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
Expand Down
22 changes: 22 additions & 0 deletions docker/monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3.7"
services:
apache_exporter:
image: solsson/prometheus-exporter-apache:latest
networks:
- webnet
command:
- --scrape_uri=http://backend/server-status?auto
ports:
- 9117:9117
depends_on:
- backend
nginx_exporter:
image: nginx/nginx-prometheus-exporter:0.9.0
networks:
- webnet
command:
- '-nginx.scrape-uri=http://frontend/nginx_status'
ports:
- 9113:9113
depends_on:
- frontend

0 comments on commit 91f24fe

Please sign in to comment.