Feat: lab1 done

This commit is contained in:
2026-03-28 02:59:29 +08:00
commit a4566f179c
9 changed files with 156 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
---
services:
prometheus:
image: docker.io/prom/prometheus:v3.9.1
ports:
- 9090:9090
volumes:
- './docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro'
- './docker/prometheus/clients.yml:/etc/prometheus/clients.yml:ro'
node_exporter:
image: quay.io/prometheus/node-exporter:v1.10.2
command: ['--path.rootfs=/host']
network_mode: host
pid: host
restart: unless-stopped
volumes:
- '/:/host:ro,rslave'
process_exporter:
image: docker.io/ncabatoff/process-exporter:v0.8.7
privileged: true
command: ['-procfs', '/host/proc', '-config.path', '/config/config.yml']
ports:
- 9256:9256
volumes:
- '/proc:/host/proc:ro,rslave'
- './docker/process_exporter:/config:ro'

View File

@@ -0,0 +1,5 @@
process_names:
- comm:
- bash
- prometheus
- vim

View File

@@ -0,0 +1,9 @@
- targets:
- controller:9100
- cpu01:9100
- gpu01:9100
- controller:9256
- cpu01:9256
- gpu01:9256
- gpu01:9835
labels: {}

View File

@@ -0,0 +1,40 @@
global:
scrape_interval: 1s
evaluation_interval: 30s
body_size_limit: 15MB
sample_limit: 5000
target_limit: 30
label_limit: 30
label_name_length_limit: 200
label_value_length_limit: 200
query_log_file: query.log
scrape_failure_log_file: fail.log
# scrape_timeout is set to the global default (10s).
runtime:
gogc: 42
scrape_configs:
- job_name: node
file_sd_configs:
- files:
- clients.yml
refresh_interval: 10m
- job_name: prometheus
static_configs:
- targets: ["localhost:9090"]
labels: {}
honor_labels: true
fallback_scrape_protocol: PrometheusText0.0.4
scrape_failure_log_file: fail_prom.log
storage:
tsdb:
out_of_order_time_window: 30m
retention:
time: 1d
size: 1GB