Skip to content

Commit

Permalink
Merge pull request #143 from ydb-platform/compose-monitoring
Browse files Browse the repository at this point in the history
Setup monitoring for compose
  • Loading branch information
polRk authored Oct 18, 2024
2 parents df235cf + 35e1e82 commit a3e5c80
Show file tree
Hide file tree
Showing 8 changed files with 895 additions and 14 deletions.
91 changes: 84 additions & 7 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
x-template: &ydb-common

x-node: &ydb-common
image: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7
restart: always
hostname: localhost
platform: linux/amd64
privileged: true
network_mode: host
volumes:
- ./cfg/config.yaml:/opt/ydb/cfg/config.yaml
- ./configs/ydb/config.yaml:/opt/ydb/cfg/config.yaml

x-deploy: &ydb-deploy
restart_policy:
condition: any
resources:
limits:
cpus: '1'
memory: 1000M
reservations:
cpus: '0.1'
memory: 250M

name: ydb

services:

static-0:
<<: *ydb-common
container_name: static-0
container_name: ydb-static-0
command:
- /opt/ydb/bin/ydbd
- server
Expand All @@ -39,6 +51,8 @@ services:
timeout: 1s
retries: 3
start_period: 30s
deploy:
<<: *ydb-deploy

static-init:
<<: *ydb-common
Expand Down Expand Up @@ -77,7 +91,7 @@ services:

dynamic-1:
<<: *ydb-common
container_name: dynamic-1
container_name: ydb-dynamic-1
command:
- /opt/ydb/bin/ydbd
- server
Expand Down Expand Up @@ -112,10 +126,12 @@ services:
condition: service_completed_successfully
tenant-init:
condition: service_completed_successfully
deploy:
<<: *ydb-deploy

dynamic-2:
<<: *ydb-common
container_name: dynamic-2
container_name: ydb-dynamic-2
command:
- /opt/ydb/bin/ydbd
- server
Expand Down Expand Up @@ -150,10 +166,12 @@ services:
condition: service_completed_successfully
tenant-init:
condition: service_completed_successfully
deploy:
<<: *ydb-deploy

dynamic-3:
<<: *ydb-common
container_name: dynamic-3
container_name: ydb-dynamic-3
command:
- /opt/ydb/bin/ydbd
- server
Expand Down Expand Up @@ -188,4 +206,63 @@ services:
condition: service_completed_successfully
tenant-init:
condition: service_completed_successfully
deploy:
<<: *ydb-deploy

prometheus:
image: prom/prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
network_mode: host
deploy: &monitoring-deploy
resources:
limits:
cpus: '0.1'
memory: 1000M
reservations:
cpus: '0.001'
memory: 50M

prometheus-pushgateway:
image: prom/pushgateway
restart: unless-stopped
ports:
- "9091:9091"
network_mode: host
deploy:
<<: *monitoring-deploy

grafana:
image: grafana/grafana-oss
restart: unless-stopped
platform: linux/amd64
ports:
- "10000:10000"
volumes:
- ./configs/grafana/provisioning:/etc/grafana/provisioning
environment:
- GF_SERVER_HTTP_PORT=10000
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_NAME=Main Org.
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_RENDERING_SERVER_URL=http://localhost:10001/render
- GF_RENDERING_CALLBACK_URL=http://localhost:10000/
network_mode: host
deploy:
<<: *monitoring-deploy

grafana-renderer:
image: grafana/grafana-image-renderer
ports:
- "10001:10001"
volumes:
- ./configs/grafana/renderer/config.json:/usr/src/app/config.json
network_mode: host
deploy:
<<: *monitoring-deploy

6 changes: 6 additions & 0 deletions docker/configs/grafana/provisioning/dashboards/dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: 1

providers:
- name: 'SLO'
options:
path: /etc/grafana/provisioning/dashboards
Loading

0 comments on commit a3e5c80

Please sign in to comment.