Skip to content
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
1 change: 1 addition & 0 deletions project5_fastapi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"message":"Welcome to my DevOps API!"}
Binary file added project5_grafana_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions project5_healthcheck.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"status":"healthy","env":"production"}
1 change: 1 addition & 0 deletions project5_metrics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"custom_requests_total","endpoint":"health","instance":"fastapi:80","job":"fastapi"},"value":[1756879591.164,"98"]}]}}
35 changes: 35 additions & 0 deletions project5_metrics_rate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"status": "success",
"data": {
"resultType": "vector",
"result": [
{
"metric": {
"endpoint": "health",
"instance": "fastapi:80",
"job": "fastapi"
},
"value": [1756897364.474, "19.51929824561403"
]
},
{
"metric": {
"endpoint": "root",
"instance": "fastapi:80",
"job": "fastapi"
},
"value": [1756897364.474, "0.01568627450980392"
]
},
{
"metric": {
"endpoint": "info",
"instance": "fastapi:80",
"job": "fastapi"
},
"value": [1756897364.474, "0"
]
}
]
}
}
7 changes: 7 additions & 0 deletions project5_pods.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NAME READY STATUS RESTARTS AGE
fastapi-6f9f9488d6-6cjh5 1/1 Running 0 2m5s
fastapi-6f9f9488d6-f4rr8 1/1 Running 0 84s
fastapi-6f9f9488d6-gprdd 1/1 Running 0 105s
grafana-8d59bb64b-f7rtj 1/1 Running 1 (10h ago) 11h
nginx-596fb74657-5jscb 1/1 Running 4 (2m11s ago) 35h
prometheus-7ff48ccd8-zv27g 1/1 Running 1 (10h ago) 11h
6 changes: 6 additions & 0 deletions project5_services.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
fastapi ClusterIP 10.99.233.181 <none> 80/TCP 36h
grafana LoadBalancer 10.101.198.72 <pending> 3000:32193/TCP 11h
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 39h
nginx LoadBalancer 10.108.198.49 <pending> 80:30391/TCP 36h
prometheus LoadBalancer 10.100.196.39 <pending> 9090:30197/TCP 11h
13 changes: 13 additions & 0 deletions project5_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.4.1, pluggy-1.6.0 -- /home/ubuntu/server-setup/venv/bin/python3
cachedir: .pytest_cache
rootdir: /home/ubuntu/server-setup
plugins: anyio-4.10.0, httpx-0.35.0
collecting ... collected 4 items

test_main.py::test_root PASSED [ 25%]
test_main.py::test_health PASSED [ 50%]
test_main.py::test_info PASSED [ 75%]
test_main.py::test_metrics PASSED [100%]

============================== 4 passed in 0.39s ===============================
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fastapi>=0.116.1
uvicorn>=0.35.0
prometheus-fastapi-instrumentator>=7.1.0
httpx>=0.28.1