Skip to content

Commit 4cba709

Browse files
committed
promtheus scrap not working w Cad
1 parent 01a41cd commit 4cba709

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

examples/docker/docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,33 @@ services:
8080
- books
8181
- customers
8282
- orders
83+
84+
cadvisor:
85+
image: gcr.io/cadvisor/cadvisor:latest
86+
container_name: cadvisor
87+
ports:
88+
- 8080:8080
89+
volumes:
90+
- /:/rootfs:ro
91+
- /var/run:/var/run:rw
92+
- /sys:/sys:ro
93+
- /var/lib/docker/:/var/lib/docker:ro
94+
depends_on:
95+
- frontend
96+
- books
97+
- customers
98+
- orders
99+
100+
prometheus:
101+
image: prom/prometheus:latest
102+
container_name: prometheus
103+
ports:
104+
- 9090:9090
105+
command:
106+
- --config.file=/etc/prometheus/prometheus.yml
107+
volumes:
108+
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
109+
depends_on:
110+
- cadvisor
111+
112+

examples/docker/prometheus.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# my global config
2+
global:
3+
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
4+
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
5+
# scrape_timeout is set to the global default (10s).
6+
7+
# Attach these labels to any time series or alerts when communicating with
8+
# external systems (federation, remote storage, Alertmanager).
9+
external_labels:
10+
monitor: 'codelab-monitor'
11+
12+
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
13+
rule_files:
14+
# - "first.rules"
15+
# - "second.rules"
16+
17+
scrape_configs:
18+
- job_name: cadvisor
19+
scrape_interval: 5s
20+
static_configs:
21+
- targets:
22+
- cadvisor:8080
23+
# - job_name: 'frontend'
24+
# static_configs:
25+
# - targets: ['localhost:3333']
26+
27+
# - job_name: 'books'
28+
# static_configs:
29+
# - targets: ['localhost:8888']
30+
31+
# - job_name: 'customers'
32+
# static_configs:
33+
# - targets: ['localhost:5555']
34+
35+
# - job_name: 'orders'
36+
# static_configs:
37+
# - targets: ['localhost:7777']

0 commit comments

Comments
 (0)