Add prometheus and grafana container for visualizing metrics and traces

This commit is contained in:
Jake Spain 2023-10-20 12:10:32 -04:00
parent 1d2f93fc1c
commit bcefcaec8c
No known key found for this signature in database
GPG key ID: BC1C4DA0A085E113
5 changed files with 77 additions and 9 deletions

View file

@ -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`. 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`.
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 | | App/Endpoint | Path |
|--------------------|-------------------------------------------------------------| |--------------------|--------------------------------------------------------------|
| Redis Server | `localhost:6379` (Password: `vmpooler`) | | Redis Server | `localhost:6379` (Password: `vmpooler`) |
| Redis Commander | <http://localhost:8080> (Credentials: `admin:admin`) | | Redis Commander | <http://localhost:8080> (Credentials: `admin:admin`) |
| Jaeger | <http://localhost:8081> | Jaeger | <http://localhost:8081> |
| VMPooler API | <http://localhost:8082/api/v3> | | VMPooler API | <http://localhost:8082/api/v3> |
| VMPooler Dashboard | <http://localhost:8082/dashboard> | | VMPooler Dashboard | <http://localhost:8082/dashboard> |
| Metrics (API) | <http://localhost:8082/prometheus> | | Metrics (API) | <http://localhost:8082/prometheus> |
| Metrics (Manager) | <http://localhost:8083/prometheus> | | Metrics (Manager) | <http://localhost:8083/prometheus> |
| Prometheus Server | <http://localhost:9090> |
| Grafana Server | <http://localhost:3000> (Credentials: `admin:admin`) |
### Deploy Chart for Testing ### Deploy Chart for Testing

View file

@ -95,3 +95,23 @@ services:
links: links:
- redis-server - redis-server
- jaeger-aio - 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

View file

@ -83,3 +83,23 @@ services:
links: links:
- redis-server - redis-server
- jaeger-aio - 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

View file

@ -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
docker/prometheus.yml Normal file
View file

@ -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']