Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
refactor: 🧱 update monitoring stack (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
keinsell authored Apr 11, 2024
1 parent 299d97a commit 2f2ad3c
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 141 deletions.
29 changes: 29 additions & 0 deletions .idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 98 additions & 0 deletions infrastructure/layers/self-managed/11_monitoring/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: monitoring
services:
grafana:
image: grafana/grafana
user: '472'
restart: always
environment:
- GF_INSTALL_PLUGINS=grafana-clock-panel
- GF_RENDERING_SERVER_URL=http://renderer:8081/render
- GF_RENDERING_CALLBACK_URL=http://grafana:3000/
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/:/etc/grafana/provisioning/
env_file:
- ./grafana/config.monitoring
ports:
- 3000:3000
depends_on:
- prometheus
networks:
- monitoring

renderer:
image: grafana/grafana-image-renderer:latest
ports:
- 8081
networks:
- monitoring

prometheus:
image: prom/prometheus
restart: always
volumes:
- ./prometheus:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
depends_on:
- node-exporter
- cadvisor
networks:
- monitoring

node-exporter:
image: prom/node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- --collector.filesystem.ignored-mount-points
- '^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)'
ports:
- 9100:9100
restart: always
privileged: true
deploy:
mode: global
networks:
- monitoring

cadvisor:
image: gcr.io/cadvisor/cadvisor
container_name: cadvisor
privileged: true
cgroup: host
userns_mode: "host"
ipc: private
shm_size: 128M
expose:
- "8080"
networks:
- monitoring
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
# Fucking cgroup bullshit
- /sys/fs/cgroup:/sys/fs/cgroup:ro
deploy:
mode: global

networks:
monitoring:
name: monitoring

volumes:
grafana_data:
name: "grafana_data"
prometheus_data:
name: "prometheus_data"
141 changes: 0 additions & 141 deletions infrastructure/layers/self-managed/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,36 +111,6 @@ services:
- docker_proxy

# ----------------------------------------
# Server Dashboard
# ----------------------------------------
# There is a need for two dashboards, the one
# for the public network and people who ten use
# my infrastructure and applications and
# the second one for the internal network and
# mostly myself.
#
# https://github.com/ProductiveOps/dokemon
# https://github.com/louislam/dockge?tab=readme-ov-file
# https://github.com/hywax/mafl
# https://github.com/ordinary-dev/phoenix
# ----------------------------------------
homepage:
image: ghcr.io/gethomepage/homepage:latest
container_name: homepage
labels:
- "traefik.enable=true"
- "traefik.http.routers.homepage.rule=PathPrefix(`/`)"
- "traefik.http.routers.homepage.entrypoints=http"
ports:
- 3010:3000
volumes:
- type: bind
source: ./homepage
target: /app/config
networks:
- docker_proxy
- reverse_proxy
# ----------------------------------------

# ----------------------------------------
# Object Storage
Expand Down Expand Up @@ -331,117 +301,6 @@ services:
# TODO: IPFS
# ----------------------------------------

# ----------------------------------------
# Observability Services
# ----------------------------------------
# These are the core services that are required
# to run the application.
# ----------------------------------------
prometheus:
image: prom/prometheus
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.prometheus.rule=Host(`prometheus.${DOMAIN}`)"
- "traefik.http.services.prometheus.loadbalancer.server.port=9090"
- "traefik.http.routers.prometheus.entrypoints=http"
volumes:
- ./prometheus:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
depends_on:
- node-exporter
- cadvisor
deploy:
resources: *resource-preset-x025
restart_policy: *restart_policy
networks:
- monitoring

node-exporter:
image: prom/node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- --collector.filesystem.ignored-mount-points
- '^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)'
ports:
- 9100:9100
restart: always
deploy:
mode: global
resources: *resource-preset-x025
restart_policy: *restart_policy
networks:
- monitoring

# https://gvisor.dev/
cadvisor:
image: gcr.io/cadvisor/cadvisor
container_name: cadvisor
privileged: true
cgroup: host
userns_mode: "host"
ipc: private
shm_size: 128M
expose:
- "8080"
networks:
- monitoring
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
# Fucking cgroup bullshit
- /sys/fs/cgroup:/sys/fs/cgroup:ro
deploy:
mode: global
resources: *resource-preset-x025
restart_policy: *restart_policy

grafana:
image: grafana/grafana
user: '472'
restart: always
environment:
- GF_INSTALL_PLUGINS=grafana-clock-panel
- GF_RENDERING_SERVER_URL=http://renderer:8081/render
- GF_RENDERING_CALLBACK_URL=http://grafana:3000/
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/:/etc/grafana/provisioning/
env_file:
- 11_monitoring/grafana/config.monitoring
ports:
- 3000:3000
depends_on:
- prometheus
deploy:
resources: *resource-preset-x025
restart_policy: *restart_policy
networks:
- monitoring

renderer:
image: grafana/grafana-image-renderer:latest
ports:
- 8081
deploy:
resources: *resource-preset-x025
restart_policy: *restart_policy
networks:
- monitoring

# TODO: HyperDX
# TODO: Grafana
# TODO: Prometheus
Expand Down

0 comments on commit 2f2ad3c

Please sign in to comment.