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

(RE-15696) Local Development - Add Grafana and remove redis mount #147

Merged
merged 2 commits into from
Oct 20, 2023
Merged
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
.vagrant/
.idea/
helm-charts/vmpooler/charts/
/docker/data/redis/**
!docker/data/**/.gitkeep
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,19 @@ When a dependency Helm chart is updated, be sure to run `./update-chart-lock` to

These are the default ports used in the docker compose file, to change them edit the `ports` key under the desired service in either `docker/docker-compose.yml` or `docker/docker-compose.local.yml`.

| App/Endpoint | Path |
|--------------------|-------------------------------------------------------------|
| Redis Server | `localhost:6379` (Password: `vmpooler`) |
| Redis Commander | <http://localhost:8080> (Credentials: `admin:admin`) |
| Jaeger | <http://localhost:8081>
| VMPooler API | <http://localhost:8082/api/v3> |
| VMPooler Dashboard | <http://localhost:8082/dashboard> |
| Metrics (API) | <http://localhost:8082/prometheus> |
| Metrics (Manager) | <http://localhost:8083/prometheus> |
Tracing data is sent to the Jaeger instance, a prometheus server scrapes metrics, and both are pre-configured in Grafana as datasources for easy visualization and history of data.

| App/Endpoint | Path |
|--------------------|--------------------------------------------------------------|
| Redis Server | `localhost:6379` (Password: `vmpooler`) |
| Redis Commander | <http://localhost:8080> (Credentials: `admin:admin`) |
| Jaeger | <http://localhost:8081> |
| VMPooler API | <http://localhost:8082/api/v3> |
| VMPooler Dashboard | <http://localhost:8082/dashboard> |
| Metrics (API) | <http://localhost:8082/prometheus> |
| Metrics (Manager) | <http://localhost:8083/prometheus> |
| Prometheus Server | <http://localhost:9090> |
| Grafana Server | <http://localhost:3000> (Credentials: `admin:admin`) |

### Deploy Chart for Testing

Expand Down
Empty file removed docker/data/redis/.gitkeep
Empty file.
24 changes: 20 additions & 4 deletions docker/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ services:
# This should match the major version used in the vmpooler helm chart
image: redis:6
command: "redis-server --requirepass vmpooler"
volumes:
- type: bind
source: ./data/redis
target: /data
ports:
- "6379:6379"

Expand Down Expand Up @@ -99,3 +95,23 @@ services:
links:
- redis-server
- jaeger-aio

prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
links:
- vmpooler-api
- vmpooler-manager

grafana:
image: grafana/grafana-oss:latest
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning
ports:
- '3000:3000'
links:
- prometheus
- jaeger-aio
24 changes: 20 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ services:
# This should match the major version used in the vmpooler helm chart
image: redis:6
command: "redis-server --requirepass vmpooler"
volumes:
- type: bind
source: ./data/redis
target: /data
ports:
- "6379:6379"

Expand Down Expand Up @@ -87,3 +83,23 @@ services:
links:
- redis-server
- jaeger-aio

prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
links:
- vmpooler-api
- vmpooler-manager

grafana:
image: grafana/grafana-oss:latest
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning
ports:
- '3000:3000'
links:
- prometheus
- jaeger-aio
10 changes: 10 additions & 0 deletions docker/grafana/provisioning/datasources/datasource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090

- name: Jaeger
type: jaeger
url: http://jaeger-aio:16686
14 changes: 14 additions & 0 deletions docker/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
global:
scrape_interval: 15s
evaluation_interval: 15s

scrape_configs:
- job_name: vmpooler-api
metrics_path: /prometheus
static_configs:
- targets: ['vmpooler-api:4567']

- job_name: vmpooler-manager
metrics_path: /prometheus
static_configs:
- targets: ['vmpooler-manager:4567']
Loading