ADD Prometheus, grafana config (non working lol)

This commit is contained in:
stcb 2024-11-21 17:08:11 +01:00
parent cba188f8ea
commit 8243addc8d
3 changed files with 72 additions and 7 deletions

View File

@ -6,8 +6,8 @@ services:
image: "traefik:latest"
container_name: "traefik"
command:
# - "--log.level=DEBUG"
- "--api.insecure=true"
# - "--log.level=DEBUG" # disable in prod
- "--api.insecure=true" # disable in prod
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.file.directory=/etc/traefik/dynamic_conf.d"
@ -38,8 +38,31 @@ services:
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
depends_on:
- traefik
#networks:
# - traefik-net
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
volumes:
- ./grafana:/etc/grafana/provisioning/datasources
prometheus:
image: "prom/prometheus:latest"
container_name: "prometheus"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
restart: unless-stopped
volumes:
- ./prometheus:/etc/prometheus
- prom_data:/prometheus
#labels: # We might want to reserve this interface to a closed network
# - "traefik.enable=true"
# - "traefik.http.routers.prometheus.rule=Host(`prom.clps.ch`)"
# - "traefik.http.routers.prometheus.entrypoints=https"
# - "traefik.http.routers.prometheus.tls.certresolver=letsencrypt"
# - "traefik.http.routers.prometheus.tls=true"
# - "traefik.http.services.prometheus.loadbalancer.server.port=9090"
depends_on:
- traefik
nextcloud:
image: "nextcloud/all-in-one:latest"
@ -49,8 +72,8 @@ services:
- "APACHE_PORT=11000"
- "APACHE_IP_BINDING=0.0.0.0"
ports:
- "8080:8080"
- "8443:8443"
- "8080:8080" # disable in prod
- "8443:8443" # disable in prod
volumes:
- "nextcloud_aio_mastercontainer:/mnt/docker-aio-config"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
@ -60,4 +83,4 @@ services:
volumes:
nextcloud_aio_mastercontainer:
prom_data:

21
grafana/datasource.yml Normal file
View File

@ -0,0 +1,21 @@
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
api_version: v1
scrape_configs:
- job_name: prometheus
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- prometheus:9090

21
prometheus/prometheus.yml Normal file
View File

@ -0,0 +1,21 @@
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets: []
scheme: http
timeout: 10s
api_version: v2
scrape_configs:
- job_name: prometheus
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090