From 6bddf684179ac0db29e208d6ead82c288fb310e7 Mon Sep 17 00:00:00 2001 From: Christian Hilgenkamp Date: Wed, 26 Mar 2025 16:10:05 +0100 Subject: [PATCH 1/2] Added new Grafana Dashboard, removed deploy.sh and updated README.md --- README.md | 3 ++- deploy.sh | 16 ---------------- .../dashboards/cluster-monitoring-dashboard.json | 9 ++++----- 3 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 deploy.sh diff --git a/README.md b/README.md index fad0553..8a07f57 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# GameRecommender \ No newline at end of file +# GameRecommender +This is a game recommender API which recommends games in a specific genre based on the user's preferences. \ No newline at end of file diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index fdbced8..0000000 --- a/deploy.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -e # Exit immediately if a command fails - -echo "Setting up Kubernetes" -doctl kubernetes cluster kubeconfig save game-cluster # Replace with your cluster name - -echo "Forcing Kubernetes to pull the latest image" -kubectl set image deployment/gameapi gameapi=registry.digitalocean.com/game-recommender/gameapi:latest --record - -echo "Rolling update in progress" -kubectl rollout status deployment/gameapi - -echo "Deployment successful!" - -chmod +x deploy.sh \ No newline at end of file diff --git a/terraform/grafana/dashboards/cluster-monitoring-dashboard.json b/terraform/grafana/dashboards/cluster-monitoring-dashboard.json index 9117724..1eb3401 100644 --- a/terraform/grafana/dashboards/cluster-monitoring-dashboard.json +++ b/terraform/grafana/dashboards/cluster-monitoring-dashboard.json @@ -555,8 +555,7 @@ "lineWidth": 1, "pointSize": 5, "scaleDistribution": { - "log": 2, - "type": "log" + "type": "linear" }, "showPoints": "auto", "spanNulls": false, @@ -611,7 +610,7 @@ "uid": "c0c2d72b-134a-489e-9edf-3060d7a31c0c" }, "editorMode": "code", - "expr": "sum by (status)(rate(http_requests_total{endpoint=\"/recommendation\", status=\"200\"}[5m]))", + "expr": "sum by (status)(increase(http_requests_total{endpoint=\"/recommendation\", status=\"200\"}[1m]))", "instant": false, "legendFormat": "__auto", "range": true, @@ -706,7 +705,7 @@ "uid": "c0c2d72b-134a-489e-9edf-3060d7a31c0c" }, "editorMode": "code", - "expr": "sum by (status)(rate(http_requests_total{endpoint=\"/recommendation\",status=~\"4..|5..\"}[1m]))\r\n", + "expr": "sum by (status)(increase(http_requests_total{endpoint=\"/recommendation\",status=~\"4..|5..\"}[1m]))\r\n", "instant": false, "legendFormat": "__auto", "range": true, @@ -906,6 +905,6 @@ "timezone": "", "title": "gamerecommender monitoring", "uid": "b2f095ce-bdf5-4cf5-9ce5-4a0fe519822c", - "version": 26, + "version": 27, "weekStart": "" } \ No newline at end of file From d4ca939d350c550e2e74a4396dddead395cad25f Mon Sep 17 00:00:00 2001 From: Christian Hilgenkamp Date: Wed, 26 Mar 2025 16:12:51 +0100 Subject: [PATCH 2/2] Updated main.py --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index aee5f60..0d2bb1e 100644 --- a/main.py +++ b/main.py @@ -9,7 +9,7 @@ from app import input_parser as parser from app.database import get_db -VERSION = "1.0" +VERSION = "1.1.3" # Prometheus metrics REQUEST_COUNT = Counter("http_requests_total", "Total HTTP requests", ["method", "endpoint", "status"]) REQUEST_LATENCY = Summary("http_request_latency_seconds", "Request latency in seconds")