Skip to content
Merged
47 changes: 46 additions & 1 deletion infra/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,15 @@ services:
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=15d
- --web.enable-lifecycle
- --web.external-url=https://localhost/prometheus
- --web.route-prefix=/prometheus
restart: unless-stopped
networks:
- transcendence-network
- grafana-monitoring-network
expose:
- "9090"


node-exporter:
container_name: node-exporter
Expand All @@ -167,6 +173,8 @@ services:
- '--path.rootfs=/rootfs'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($|/)'
restart: unless-stopped
expose:
- "9100"

postgres-exporter:
container_name: postgres-exporter
Expand All @@ -183,6 +191,8 @@ services:
restart: unless-stopped
depends_on:
- postgres
expose:
- "9187"

redis-exporter:
image: oliver006/redis_exporter:v1.62.0
Expand All @@ -194,15 +204,45 @@ services:
- redis
networks:
- transcendence-network
expose:
- "9121"

blackbox-exporter:
image: prom/blackbox-exporter:v0.25.0
container_name: blackbox-exporter
restart: unless-stopped
volumes:
- ./blackbox/config/blackbox.yml:/etc/blackbox_exporter/config.yml:ro
- ../blackbox/config/blackbox.yml:/etc/blackbox_exporter/config.yml:ro
networks:
- transcendence-network
expose:
- "9115"

grafana:
image: grafana/grafana:11.2.2
container_name: grafana
env_file:
- ../../.env
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_AUTH_ANONYMOUS_ENABLED=false
- GF_SECURITY_COOKIE_SECURE=true
- GF_SECURITY_COOKIE_SAMESITE=strict
- GF_SERVER_ROOT_URL=${GRAFANA_ROOT_URL}
- GF_SERVER_SERVE_FROM_SUB_PATH=true
- GF_METRICS_ENABLED=true
volumes:
- ../grafana/provisioning/datasources/prometheus.yml:/etc/grafana/provisioning/datasources/prometheus.yml:ro
- grafana_data:/var/lib/grafana
restart: unless-stopped
expose:
- "3000"
depends_on:
- prometheus
networks:
- grafana-monitoring-network

redis:
image: redis:7-alpine
Expand Down Expand Up @@ -261,6 +301,7 @@ services:
container_name: nginx
networks:
- transcendence-network
- grafana-monitoring-network

frontend:
build:
Expand Down Expand Up @@ -402,6 +443,7 @@ volumes:
postgres_data:
minio_data:
prometheus_data:
grafana_data:

networks:
transcendence-network:
Expand All @@ -412,3 +454,6 @@ networks:
elk-storage-network:
driver: bridge
internal: true
grafana-monitoring-network:
driver: bridge
internal: true
10 changes: 10 additions & 0 deletions infra/grafana/provisioning/datasources/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: 1

datasources:
- name: Prometheus
uid: prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false
Comment thread
luaraggio marked this conversation as resolved.
29 changes: 29 additions & 0 deletions infra/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ http {
server kibana:5601;
}

# upstream grafana {
# server grafana:3000;
# }

server {
listen 80;
server_name localhost;
Expand Down Expand Up @@ -224,6 +228,31 @@ http {
proxy_buffering off;
}

# Prometheus proxy
location /prometheus/ {
proxy_pass http://prometheus:9090;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
proxy_buffering off;
}

# Grafana proxy
location /grafana/ {

proxy_pass http://grafana:3000;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
proxy_buffering off;

}

# Frontend proxy
location / {
limit_req zone=frontend_limit burst=50 nodelay;
Expand Down
Loading