refine dc and configs
This commit is contained in:
+10
-2
@@ -1,6 +1,8 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
scrape_interval: 60s
|
||||
evaluation_interval: 60s
|
||||
scrape_timeout: 10s
|
||||
sample_limit: 1000 # Limit samples per scrape to prevent overload
|
||||
|
||||
# Rule files
|
||||
rule_files:
|
||||
@@ -14,11 +16,13 @@ alerting:
|
||||
scrape_configs:
|
||||
# Prometheus itself
|
||||
- job_name: 'prometheus'
|
||||
sample_limit: 50000
|
||||
static_configs:
|
||||
- targets: ['prometheus:9090']
|
||||
|
||||
# Container metrics via cAdvisor
|
||||
- job_name: 'cadvisor'
|
||||
sample_limit: 50000
|
||||
static_configs:
|
||||
- targets: ['cadvisor:8080']
|
||||
metrics_path: /metrics
|
||||
@@ -26,20 +30,24 @@ scrape_configs:
|
||||
|
||||
# Host metrics via node-exporter
|
||||
- job_name: 'node-exporter'
|
||||
sample_limit: 50000
|
||||
static_configs:
|
||||
- targets: ['node-exporter:9100']
|
||||
|
||||
# Loki metrics
|
||||
- job_name: 'loki'
|
||||
sample_limit: 50000
|
||||
static_configs:
|
||||
- targets: ['loki:3100']
|
||||
|
||||
# Grafana metrics
|
||||
- job_name: 'grafana'
|
||||
sample_limit: 50000
|
||||
static_configs:
|
||||
- targets: ['grafana:3000']
|
||||
|
||||
# Alloy metrics
|
||||
- job_name: 'alloy'
|
||||
sample_limit: 50000
|
||||
static_configs:
|
||||
- targets: ['alloy:12345']
|
||||
|
||||
+14
-5
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
# Grafana for visualization
|
||||
grafana:
|
||||
grafanao:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
healthcheck:
|
||||
@@ -32,9 +32,6 @@ services:
|
||||
container_name: loki
|
||||
ports:
|
||||
- "9020:3100"
|
||||
volumes:
|
||||
- ./config/loki.yml:/etc/loki/local-config.yaml
|
||||
- loki-data:/var/loki
|
||||
command: -config.file=/etc/loki/local-config.yaml
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
@@ -70,12 +67,25 @@ services:
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--storage.tsdb.retention.time=15d'
|
||||
- '--storage.tsdb.retention.size=10GB'
|
||||
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
||||
- '--web.console.templates=/etc/prometheus/consoles'
|
||||
- '--web.enable-lifecycle'
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- monitoring
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 2G
|
||||
reservations:
|
||||
memory: 1G
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
window: 120s
|
||||
|
||||
# cAdvisor for container metrics
|
||||
cadvisor:
|
||||
@@ -116,7 +126,6 @@ services:
|
||||
|
||||
volumes:
|
||||
grafana-data:
|
||||
loki-data:
|
||||
prometheus-data:
|
||||
alloy-data:
|
||||
driver: local
|
||||
|
||||
Reference in New Issue
Block a user