add prometheus, cadvisor and node-exporter
This commit is contained in:
parent
68f29949a4
commit
e8a2304ec9
|
@ -0,0 +1,31 @@
|
|||
# my global config
|
||||
global:
|
||||
scrape_interval: 60s # By default, scrape targets every 15 seconds.
|
||||
evaluation_interval: 60s # By default, scrape targets every 15 seconds.
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
# Attach these labels to any time series or alerts when communicating with
|
||||
# external systems (federation, remote storage, Alertmanager).
|
||||
external_labels:
|
||||
monitor: 'my-project'
|
||||
|
||||
# Load and evaluate rules in this file every 'evaluation_interval' seconds.
|
||||
rule_files:
|
||||
- "alert.rules"
|
||||
# - "first.rules"
|
||||
# - "second.rules"
|
||||
|
||||
# A scrape configuration containing exactly one endpoint to scrape:
|
||||
# Here it's Prometheus itself.
|
||||
scrape_configs:
|
||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||
- job_name: 'prometheus'
|
||||
|
||||
# Override the global default and scrape targets from this job every 5 seconds.
|
||||
scrape_interval: 20s
|
||||
|
||||
# metrics_path defaults to '/metrics'
|
||||
# scheme defaults to 'http'.
|
||||
|
||||
static_configs:
|
||||
- targets: ['localhost:9090','cadvisor:8080','node-exporter-loki:9100']
|
|
@ -4,7 +4,7 @@
|
|||
# Carbon metrics are kept for 30 days in resolution of 10 seconds.
|
||||
[carbon]
|
||||
pattern = ^carbon\.
|
||||
retentions = 10s:30d
|
||||
retentions = 1m:30d
|
||||
|
||||
# User metrics are kept for:
|
||||
# 24 hours in resolution of 5 seconds
|
||||
|
@ -12,5 +12,5 @@ retentions = 10s:30d
|
|||
# 1 year in resolution of 5 minutes
|
||||
[user]
|
||||
pattern = .*
|
||||
retentions = 5s:24h,1m:30d,5m:1y
|
||||
retentions = 30s:48h,2m:30d,20m:1y,2h:5y
|
||||
|
||||
|
|
|
@ -21,6 +21,39 @@ services:
|
|||
depends_on:
|
||||
- go-carbon
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus
|
||||
hostname: prometheus
|
||||
container_name: prometheus
|
||||
volumes:
|
||||
- ./configs:/etc/prometheus
|
||||
- ./prometheus/:/prometheus
|
||||
command:
|
||||
- '-config.file=/etc/prometheus/prometheus.yml'
|
||||
- '-storage.local.path=/prometheus'
|
||||
- '-storage.local.retention=744h'
|
||||
expose:
|
||||
- 9090
|
||||
depends_on:
|
||||
- cadvisor
|
||||
|
||||
node-exporter:
|
||||
image: prom/node-exporter
|
||||
container_name: node-exporter-loki
|
||||
hostname: node-exporter-loki
|
||||
|
||||
cadvisor:
|
||||
image: google/cadvisor
|
||||
container_name: cadvisor
|
||||
hostname: cadvisor
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:rw
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker/:/var/lib/docker:ro
|
||||
expose:
|
||||
- 8080
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana
|
||||
hostname: grafana
|
||||
|
@ -34,4 +67,5 @@ services:
|
|||
- ./logs:/var/log/grafana
|
||||
depends_on:
|
||||
- carbonapi
|
||||
- prometheus
|
||||
|
||||
|
|
Loading…
Reference in New Issue