Skip to content

Commit

Permalink
added Thanos for multi-cluster in dashboard
Browse files Browse the repository at this point in the history
Signed-off-by: cloudbehl <[email protected]>
  • Loading branch information
cloudbehl committed Oct 20, 2023
1 parent 138b293 commit bea5b44
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ PROMETHEUS_ALERTS_DIR=monitoring/ceph-mixin

PROMETHEUS_HOST_PORT=9090
#PROMETHEUS_IMAGE=
THANOS_IMAGE=thanosio/thanos:main-2023-10-16-77fac93
NODE_EXPORTER_HOST_PORT=9100
#NODE_EXPORTER_IMAGE=
ALERTMANAGER_HOST_PORT=9093
Expand Down
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,37 @@ services:
- ./docker/prometheus:/etc/prometheus:Z
- ${CEPH_REPO_DIR}/${PROMETHEUS_ALERTS_DIR:-monitoring/ceph-mixin}:/etc/prometheus/alerts:Z

thanos-sidecar:
image: ${THANOS_IMAGE}
container_name: thanos-sidecar
hostname: thanos-sidecar
volumes_from:
- prometheus:rw
command:
- "sidecar"
- "--tsdb.path=/prometheus"
- "--prometheus.url=http://prometheus:9090"
expose:
- 10901
- 10902
depends_on:
- prometheus

thanos-querier:
image: ${THANOS_IMAGE}
container_name: thanos-querier
hostname: thanos-querier
command:
- "query"
- "--store=thanos-sidecar:10901"
expose:
- 10902
- 10901
ports:
- "10902:10902"
depends_on:
- thanos-sidecar

node-exporter:
image: ${NODE_EXPORTER_IMAGE:-prom/node-exporter:v1.5.0}
container_name: node-exporter
Expand Down
7 changes: 7 additions & 0 deletions docker/grafana/provisioning/datasources/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ datasources:
orgId: 1
url: http://prometheus:9090
editable: true

- name: Thanos
type: prometheus
access: proxy
orgId: 1
url: http://thanos-querier:10902
editable: true
6 changes: 4 additions & 2 deletions docker/prometheus/ceph-targets.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[
{
"targets": [ "ceph:9283" ],
"labels": {}
"labels": {
cluster: "cluster1"
}
},
{
"targets": [ "ceph2:9283" ],
"labels": {}
}
]
]
3 changes: 2 additions & 1 deletion docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
global:
scrape_interval: 5s
evaluation_interval: 5s

external_labels:
cluster: cluster1
scrape_configs:
- job_name: 'node-exporter'
file_sd_configs:
Expand Down

0 comments on commit bea5b44

Please sign in to comment.