Monitoring optimization

This commit is contained in:
Brieuc Dubois 2023-05-17 11:33:08 +02:00 committed by Bhasher
parent bbaea4003b
commit 879b700e3e
4 changed files with 56 additions and 9 deletions

View File

@ -46,6 +46,25 @@ services:
networks:
- smarthome
nodered:
container_name: nodered
restart: on-failure
image: nodered/node-red:latest
volumes:
- $DATA/nodered:/data
networks:
- smarthome
- external
labels:
- "traefik.enable=true"
- "traefik.http.routers.nodered.rule=Host(`nodered.bhasher.com`)"
- "traefik.http.routers.nodered.entrypoints=internalsecure"
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
- "traefik.http.routers.nodered.tls=true"
- "traefik.http.routers.nodered.tls.certresolver=http"
- "traefik.http.routers.nodered.middlewares=authelia@docker"
networks:
smarthome:
external:

View File

@ -26,11 +26,11 @@ sections:
url: https://jellyfin.bhasher.com
statusCheckUrl: http://jellyfin:8096
id: 0_1507_jellyfin
- title: Autheli
- title: Authelia
icon: hl-authelia
url: https://idp.bhasher.com
statusCheckUrl: http://authelia:9091
id: 1_1507_autheli
id: 1_1507_authelia
- title: Mealie
icon: hl-mealie
url: https://mealie.bhasher.com
@ -122,6 +122,16 @@ sections:
icon: hl-portainer
url: https://portainer.lln.bhasher.com
id: 12_1631_portainerlln
- title: Home assistant
icon: hl-home-assistant
url: https://hass.bhasher.com
statusCheckUrl: http://hass:8123
id: 13_1631_homeassistant
- title: Node-red
icon: hl-node-red
url: https://nodered.bhasher.com
statusCheckUrl: http://nodered:1880
id: 14_1631_nodered
- name: System services
displayData:
sortBy: most-used
@ -199,6 +209,12 @@ sections:
hostname: http://pihole
apiKey: ''
id: 0_1062_piholestats
displayData:
sortBy: default
rows: 1
cols: 2
collapsed: false
hideForGuests: false
- name: Random
widgets:
- type: joke
@ -210,3 +226,9 @@ sections:
options:
comic: random
id: 1_609_xkcdcomic
displayData:
sortBy: default
rows: 1
cols: 2
collapsed: false
hideForGuests: false

View File

@ -1,5 +1,5 @@
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
scrape_interval: 30s # By default, scrape targets every 15 seconds.
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
@ -11,7 +11,6 @@ global:
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
@ -20,21 +19,17 @@ scrape_configs:
- targets: ["host.docker.internal:9323"]
- job_name: 'cadvisor'
scrape_interval: 15s
static_configs:
- targets: ['cadvisor:8080']
- job_name: 'node-exporter'
scrape_interval: 15s
static_configs:
- targets: ['node-exporter:9100']
- job_name: 'treafik'
scrape_interval: 15s
static_configs:
- targets: ['traefik:8080']
- job_name: 'authelia'
scrape_interval: 15s
static_configs:
- targets: ['authelia:9959']

View File

@ -3,6 +3,7 @@ services:
container_name: prometheus
image: prom/prometheus:latest
restart: unless-stopped
user: root
labels:
- "traefik.enable=true"
- "traefik.http.routers.prom.rule=Host(`prometheus.bhasher.com`)"
@ -66,15 +67,25 @@ services:
cadvisor:
container_name: cadvisor
image: gcr.io/cadvisor/cadvisor:v0.47.1
image: gcr.io/cadvisor/cadvisor:v0.47.0 #v0.47.1
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
restart: always
command:
- "--housekeeping_interval=30s"
- "--docker_only=true"
- "--disable_metrics=percpu,sched,tcp,udp,disk,diskIO,hugetlb,referenced_memory,cpu_topology,resctrl"
networks:
- monitoring
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:8080/healthz || exit 1
interval: 15s
timeout: 15s
retries: 5
start_period: 30s
node-exporter:
container_name: node-exporter