Skip to content

Commit

Permalink
refactor: Refactor garafana and prometheus deployment stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed Oct 14, 2024
1 parent d803b9a commit cb36d21
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 122 deletions.
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ include:
- ./scheduler/docker-compose.yml
- ./llm-proxy/docker-compose.yml
- ./integrations-service/docker-compose.yml
- ./prometheus/docker-compose.yml
- ./grafana/docker-compose.yml
- ./monitoring/docker-compose.yml
- ./blob-store/docker-compose.yml

# TODO: Enable after testing
Expand Down
20 changes: 0 additions & 20 deletions grafana/docker-compose.yml

This file was deleted.

35 changes: 11 additions & 24 deletions monitoring/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
# TODO: Fix monitoring services
# SCRUM-25

# Compose sample
### Prometheus & Grafana

Project structure:
```
.
├── compose.yaml
├── README.md
├── docker-compose.yml
├── grafana
│   └── datasource.yml
├── prometheus
│   └── prometheus.yml
└── README.md
│ └── provisioning
│ └── datasources
│ └── datasource.yml
└── prometheus
└── config
└── prometheus.yml
```

[_compose.yaml_](compose.yaml)
```
services:
prometheus:
image: prom/prometheus
...
ports:
- 9090:9090
grafana:
image: grafana/grafana
...
ports:
- 3000:3000
```
The compose file defines a stack with two services `prometheus` and `grafana`.
The docker compose file defines a stack with two services `prometheus` and `grafana`.
When deploying the stack, docker compose maps port the default ports for each service to the equivalent ports on the host in order to inspect easier the web interface of each service.
Make sure the ports 9090 and 3000 on the host are not already in use.

## Deploy with docker compose

```
$ docker volume create grafana_data
$ docker volume create prometheus_data
$ docker compose up -d
Creating network "prometheus-grafana_default" with the default driver
Creating volume "prometheus-grafana_prom_data" with default driver
Expand Down
46 changes: 23 additions & 23 deletions monitoring/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: julep-monitoring

services:
portainer:
image: portainer/portainer-ce:latest
container_name: portainer
restart: unless-stopped
ports:
- "9000:8000"
- "9443:9443"
volumes:
- portainer_data:/data
- /var/run/docker.sock:/var/run/docker.sock

prometheus:
image: prom/prometheus
container_name: prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
restart: unless-stopped
profiles:
- multi-tenant

volumes:
- ./prometheus:/etc/prometheus
- prom_data:/prometheus
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus

depends_on:
agents-api-multi-tenant:
condition: service_started

command:
- '--config.file=/etc/prometheus/prometheus.yml'

grafana:
image: grafana/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
container_name: grafana
ports:
- 3000:3000
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
volumes:
- ./grafana:/etc/grafana/provisioning/datasources
- grafana_data:/var/lib/grafana
- ./provisioning:/etc/grafana/provisioning
profiles:
- multi-tenant

volumes:
prom_data:
portainer_data:
prometheus_data:
external: true
grafana_data:
external: true
9 changes: 0 additions & 9 deletions monitoring/grafana/datasource.yml

This file was deleted.

File renamed without changes.
21 changes: 0 additions & 21 deletions monitoring/prometheus/prometheus.yml

This file was deleted.

23 changes: 0 additions & 23 deletions prometheus/docker-compose.yml

This file was deleted.

0 comments on commit cb36d21

Please sign in to comment.