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