mirror of
https://github.com/aykhans/my-self-host-services.git
synced 2025-04-21 07:09:46 +00:00
Add prometheus
This commit is contained in:
parent
d2789c07aa
commit
98faa391f0
2
prometheus/.gitignore
vendored
Normal file
2
prometheus/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/data/*
|
||||||
|
!/data/config
|
18
prometheus/data/config/prometheus.yaml
Normal file
18
prometheus/data/config/prometheus.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 10s
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: "node_exporter"
|
||||||
|
scrape_interval: 2s
|
||||||
|
static_configs:
|
||||||
|
- targets: ["node_exporter:9100"]
|
||||||
|
|
||||||
|
- job_name: "cadvisor"
|
||||||
|
scrape_interval: 2s
|
||||||
|
static_configs:
|
||||||
|
- targets: ["cadvisor:8080"]
|
||||||
|
|
||||||
|
- job_name: caddy
|
||||||
|
scrape_interval: 2s
|
||||||
|
static_configs:
|
||||||
|
- targets: ["caddy:2019"]
|
48
prometheus/docker-compose.yml
Normal file
48
prometheus/docker-compose.yml
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
networks:
|
||||||
|
prometheus:
|
||||||
|
external: false
|
||||||
|
grafana:
|
||||||
|
name: grafana
|
||||||
|
driver: bridge
|
||||||
|
external: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
prometheus:
|
||||||
|
image: prom/prometheus:v3.2.1
|
||||||
|
container_name: prometheus
|
||||||
|
networks:
|
||||||
|
- prometheus
|
||||||
|
- grafana
|
||||||
|
command: "--config.file=/etc/prometheus/prometheus.yaml --storage.tsdb.retention.time=10d storage.tsdb.retention.size=5GB"
|
||||||
|
volumes:
|
||||||
|
- ./data/config/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
|
||||||
|
- prometheus-data:/prometheus
|
||||||
|
|
||||||
|
node_exporter:
|
||||||
|
image: quay.io/prometheus/node-exporter:v1.9.1
|
||||||
|
container_name: node_exporter
|
||||||
|
networks:
|
||||||
|
- prometheus
|
||||||
|
command:
|
||||||
|
- "--path.rootfs=/host"
|
||||||
|
pid: host
|
||||||
|
volumes:
|
||||||
|
- "/:/host:ro,rslave"
|
||||||
|
|
||||||
|
cadvisor:
|
||||||
|
image: gcr.io/cadvisor/cadvisor:v0.49.1
|
||||||
|
container_name: cadvisor
|
||||||
|
networks:
|
||||||
|
- prometheus
|
||||||
|
volumes:
|
||||||
|
- "/:/rootfs:ro"
|
||||||
|
- "/var/run:/var/run:ro"
|
||||||
|
- "/sys:/sys:ro"
|
||||||
|
- "/var/lib/docker/:/var/lib/docker:ro"
|
||||||
|
- "/dev/disk/:/dev/disk:ro"
|
||||||
|
privileged: true
|
||||||
|
devices:
|
||||||
|
- "/dev/kmsg:/dev/kmsg"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
prometheus-data:
|
Loading…
x
Reference in New Issue
Block a user