Skip to content

Commit bea5b44

Browse files
committed
added Thanos for multi-cluster in dashboard
Signed-off-by: cloudbehl <cloudbehl@gmail.com>
1 parent 138b293 commit bea5b44

5 files changed

Lines changed: 45 additions & 3 deletions

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ PROMETHEUS_ALERTS_DIR=monitoring/ceph-mixin
2323

2424
PROMETHEUS_HOST_PORT=9090
2525
#PROMETHEUS_IMAGE=
26+
THANOS_IMAGE=thanosio/thanos:main-2023-10-16-77fac93
2627
NODE_EXPORTER_HOST_PORT=9100
2728
#NODE_EXPORTER_IMAGE=
2829
ALERTMANAGER_HOST_PORT=9093

docker-compose.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,37 @@ services:
121121
- ./docker/prometheus:/etc/prometheus:Z
122122
- ${CEPH_REPO_DIR}/${PROMETHEUS_ALERTS_DIR:-monitoring/ceph-mixin}:/etc/prometheus/alerts:Z
123123

124+
thanos-sidecar:
125+
image: ${THANOS_IMAGE}
126+
container_name: thanos-sidecar
127+
hostname: thanos-sidecar
128+
volumes_from:
129+
- prometheus:rw
130+
command:
131+
- "sidecar"
132+
- "--tsdb.path=/prometheus"
133+
- "--prometheus.url=http://prometheus:9090"
134+
expose:
135+
- 10901
136+
- 10902
137+
depends_on:
138+
- prometheus
139+
140+
thanos-querier:
141+
image: ${THANOS_IMAGE}
142+
container_name: thanos-querier
143+
hostname: thanos-querier
144+
command:
145+
- "query"
146+
- "--store=thanos-sidecar:10901"
147+
expose:
148+
- 10902
149+
- 10901
150+
ports:
151+
- "10902:10902"
152+
depends_on:
153+
- thanos-sidecar
154+
124155
node-exporter:
125156
image: ${NODE_EXPORTER_IMAGE:-prom/node-exporter:v1.5.0}
126157
container_name: node-exporter

docker/grafana/provisioning/datasources/prometheus.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ datasources:
1111
orgId: 1
1212
url: http://prometheus:9090
1313
editable: true
14+
15+
- name: Thanos
16+
type: prometheus
17+
access: proxy
18+
orgId: 1
19+
url: http://thanos-querier:10902
20+
editable: true

docker/prometheus/ceph-targets.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[
22
{
33
"targets": [ "ceph:9283" ],
4-
"labels": {}
4+
"labels": {
5+
cluster: "cluster1"
6+
}
57
},
68
{
79
"targets": [ "ceph2:9283" ],
810
"labels": {}
911
}
10-
]
12+
]

docker/prometheus/prometheus.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
global:
22
scrape_interval: 5s
33
evaluation_interval: 5s
4-
4+
external_labels:
5+
cluster: cluster1
56
scrape_configs:
67
- job_name: 'node-exporter'
78
file_sd_configs:

0 commit comments

Comments
 (0)