From 1d2f93fc1c97462f8182d6c2e52c2d9bf15b0792 Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Fri, 20 Oct 2023 12:08:56 -0400 Subject: [PATCH 1/2] Remove storing redis data on host --- .gitignore | 2 -- docker/data/redis/.gitkeep | 0 docker/docker-compose.dev.yml | 4 ---- docker/docker-compose.yml | 4 ---- 4 files changed, 10 deletions(-) delete mode 100644 docker/data/redis/.gitkeep diff --git a/.gitignore b/.gitignore index 06213b5..5200151 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,3 @@ .vagrant/ .idea/ helm-charts/vmpooler/charts/ -/docker/data/redis/** -!docker/data/**/.gitkeep \ No newline at end of file diff --git a/docker/data/redis/.gitkeep b/docker/data/redis/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index 6899a4c..ab4d055 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -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" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 3a81546..f2dee8a 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -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" From bcefcaec8ca0755dc2b84dbf60a3bf274784bd5a Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Fri, 20 Oct 2023 12:10:32 -0400 Subject: [PATCH 2/2] Add prometheus and grafana container for visualizing metrics and traces --- README.md | 22 +++++++++++-------- docker/docker-compose.dev.yml | 20 +++++++++++++++++ docker/docker-compose.yml | 20 +++++++++++++++++ .../provisioning/datasources/datasource.yml | 10 +++++++++ docker/prometheus.yml | 14 ++++++++++++ 5 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 docker/grafana/provisioning/datasources/datasource.yml create mode 100644 docker/prometheus.yml diff --git a/README.md b/README.md index 9bcc34b..d1ea7fe 100644 --- a/README.md +++ b/README.md @@ -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 | (Credentials: `admin:admin`) | -| Jaeger | -| VMPooler API | | -| VMPooler Dashboard | | -| Metrics (API) | | -| Metrics (Manager) | | +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 | (Credentials: `admin:admin`) | +| Jaeger | | +| VMPooler API | | +| VMPooler Dashboard | | +| Metrics (API) | | +| Metrics (Manager) | | +| Prometheus Server | | +| Grafana Server | (Credentials: `admin:admin`) | ### Deploy Chart for Testing diff --git a/docker/docker-compose.dev.yml b/docker/docker-compose.dev.yml index ab4d055..e9d8d24 100644 --- a/docker/docker-compose.dev.yml +++ b/docker/docker-compose.dev.yml @@ -95,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 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index f2dee8a..6c96d06 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -83,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 diff --git a/docker/grafana/provisioning/datasources/datasource.yml b/docker/grafana/provisioning/datasources/datasource.yml new file mode 100644 index 0000000..509bcd8 --- /dev/null +++ b/docker/grafana/provisioning/datasources/datasource.yml @@ -0,0 +1,10 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + url: http://prometheus:9090 + + - name: Jaeger + type: jaeger + url: http://jaeger-aio:16686 diff --git a/docker/prometheus.yml b/docker/prometheus.yml new file mode 100644 index 0000000..f5b76b6 --- /dev/null +++ b/docker/prometheus.yml @@ -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']