Skip to content

Commit

Permalink
Update vulnrelay to write metrics to node-exporter
Browse files Browse the repository at this point in the history
We modified the compose.yml files to link the vulnrelay metrics directory to a text file collector on node-exporter.
  • Loading branch information
João Leão committed Jan 10, 2025
1 parent fc11fc8 commit 156a2bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ services:
pid: host
volumes:
- /:/host:ro,rslave
- nodeexporter_collectors:/textfile_collectors
command:
- '--path.rootfs=/host'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
{% if cookiecutter.vulnerabilities_scanning == 'y' %}
- '--collector.textfile.directory=textfile_collectors'
{% endif %}
logging: &exporter_logging
driver: journald
options:
Expand Down Expand Up @@ -107,8 +111,11 @@ services:
container_name: vulnrelay
restart: unless-stopped
env_file: ./.vuln.env
environment:
- METRICS_DIR=/app/metrics
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- nodeexporter_collectors:/app/metrics
logging:
driver: awslogs
options:
Expand All @@ -134,3 +141,4 @@ services:
volumes:
backend-static:
gunicorn-socket:
nodeexporter_collectors:
9 changes: 9 additions & 0 deletions {{cookiecutter.repostory_name}}/envs/prod/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,14 @@ services:
pid: host
volumes:
- /:/host:ro,rslave
- nodeexporter_collectors:/textfile_collectors

command:
- '--path.rootfs=/host'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc|run|boot|var/.+)($$|/)'
{% if cookiecutter.vulnerabilities_scanning == 'y' %}
- '--collector.textfile.directory=textfile_collectors'
{% endif %}
{% if cookiecutter.monitor_tcpstat == 'y' %}
- '--collector.tcpstat'
{% endif %}
Expand Down Expand Up @@ -222,8 +227,11 @@ services:
container_name: vulnrelay
restart: unless-stopped
env_file: ./.vuln.env
environment:
- METRICS_DIR=/app/metrics
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- nodeexporter_collectors:/app/metrics
logging:
<<: *logging
watchtower:
Expand All @@ -239,3 +247,4 @@ services:
volumes:
backend-static:
gunicorn-socket:
nodeexporter_collectors:

0 comments on commit 156a2bc

Please sign in to comment.