Skip to content

Commit 142b013

Browse files
authored
Merge pull request #76 from AET-DevOps26/feature/grafana
Feature/grafana
2 parents b234a21 + deace66 commit 142b013

28 files changed

Lines changed: 1376 additions & 23 deletions

.github/workflows/deploy-azure.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,7 @@ jobs:
118118

119119
- name: Summary
120120
if: success()
121-
run: echo "Deployed to http://${{ steps.tf.outputs.public_ip }}:8081" >> "$GITHUB_STEP_SUMMARY"
121+
run: |
122+
echo "App: http://${{ steps.tf.outputs.public_ip }}:8081" >> "$GITHUB_STEP_SUMMARY"
123+
echo "Prometheus: http://${{ steps.tf.outputs.public_ip }}:9090" >> "$GITHUB_STEP_SUMMARY"
124+
echo "Grafana: http://${{ steps.tf.outputs.public_ip }}:3000" >> "$GITHUB_STEP_SUMMARY"

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,22 @@ Open http://localhost:8081
133133

134134
Drop `--build` on subsequent starts if nothing has changed. To stop: `docker compose down`.
135135

136-
#### Monitoring (Prometheus)
136+
#### Monitoring (Prometheus + Grafana)
137137

138-
`docker compose up` also starts a Prometheus instance that scrapes metrics from all
139-
backend services. The Spring services expose metrics at `/actuator/prometheus` (via
140-
Spring Boot Actuator + Micrometer) and `gen-ai` exposes them at `/metrics`.
138+
`docker compose up` also starts Prometheus and Grafana. Prometheus scrapes metrics
139+
from all backend services. The Spring services expose metrics at
140+
`/actuator/prometheus` (via Spring Boot Actuator + Micrometer) and `gen-ai` exposes
141+
them at `/metrics`.
141142

142143
Open the Prometheus UI at http://localhost:9090 — check http://localhost:9090/targets
143144
to confirm every service is `UP`. The scrape configuration lives in
144145
[`monitoring/prometheus.yml`](monitoring/prometheus.yml).
145146

147+
Open Grafana at http://localhost:3000 and log in with `admin` / `bytebite` unless
148+
you override `GRAFANA_ADMIN_USER` and `GRAFANA_ADMIN_PASSWORD`. Grafana is
149+
provisioned with the Prometheus datasource and a `ByteBite / ByteBite Overview`
150+
dashboard from [`monitoring/grafana`](monitoring/grafana).
151+
146152
---
147153

148154
### Kubernetes
@@ -160,6 +166,12 @@ helm uninstall bytebite --namespace team-bytebite # To take down later
160166

161167
Open http://localhost:80
162168

169+
The local Helm values also expose monitoring services when supported by your
170+
local cluster:
171+
172+
- Prometheus: http://localhost:9090
173+
- Grafana: http://localhost:3000 (`admin` / `bytebite`)
174+
163175
#### Kubernetes Deployment to the AET cluster
164176

165177
Prerequisite: The `team-bytebite` namespace must exist in the cluster.
@@ -180,3 +192,5 @@ helm uninstall bytebite --namespace team-bytebite # To take down later
180192
```
181193

182194
The app is available at https://team-bytebite.stud.k8s.aet.cit.tum.de
195+
Grafana is available at https://team-bytebite.stud.k8s.aet.cit.tum.de/grafana
196+
when `monitoring.enabled` and `monitoring.grafana.ingress.enabled` are true.

compose.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,25 @@ services:
134134
- grocery-service
135135
- gen-ai
136136

137+
grafana:
138+
image: grafana/grafana:11.2.2
139+
container_name: bytebite-grafana
140+
environment:
141+
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
142+
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:-bytebite}
143+
GF_USERS_DEFAULT_THEME: light
144+
GF_METRICS_ENABLED: "true"
145+
volumes:
146+
- grafana-data:/var/lib/grafana
147+
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
148+
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
149+
ports:
150+
- "3000:3000"
151+
depends_on:
152+
- prometheus
153+
137154
volumes:
138155
user-db-data:
139156
grocery-db-data:
140157
prometheus-data:
158+
grafana-data:

helm/bytebite/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ByteBite Helm Chart
22

3-
Deploys the ByteBite application (client, api-gateway, user-service, grocery-service, gen-ai) to Kubernetes.
3+
Deploys the ByteBite application (client, api-gateway, user-service, grocery-service, gen-ai)
4+
and the optional monitoring stack (Prometheus + Grafana) to Kubernetes.
45

56
## Prerequisites
67

@@ -29,6 +30,11 @@ helm uninstall bytebite --namespace team-bytebite
2930
| `ingress.tls` | Enable TLS via cert-manager | `true` |
3031
| `genai.logosKey` | Logos API key for the default gen-ai provider | `""` |
3132
| `genai.openaiApiKey` | OpenAI API key for the selectable OpenAI provider | `""` |
33+
| `monitoring.enabled` | Deploy Prometheus and Grafana | `true` |
34+
| `monitoring.grafana.adminUser` | Grafana admin username | `admin` |
35+
| `monitoring.grafana.adminPassword` | Grafana admin password | `bytebite` |
36+
| `monitoring.grafana.ingress.enabled` | Expose Grafana under the main ingress host | `true` |
37+
| `monitoring.grafana.ingress.path` | Grafana ingress path | `/grafana` |
3238
| `client.image.tag` | Client image tag | `latest` |
3339
| `apiGateway.image.tag` | API gateway image tag | `latest` |
3440
| `userService.image.tag` | User service image tag | `latest` |

0 commit comments

Comments
 (0)