Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Thanos for multi-cluster in dashboard #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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