feat(monitoring): add Redis exporter + Sentry docs to deployment guide
Some checks failed
Some checks failed
- Add redis-exporter container to docker-compose (oliver006/redis_exporter, 32MB) - Add Redis scrape target to Prometheus config - Add 4 Redis alert rules: RedisDown, HighMemory, HighConnections, RejectedConnections - Document Step 19b (Sentry Error Tracking) in Hetzner deployment guide - Document Step 19c (Redis Monitoring) in Hetzner deployment guide - Update resource budget and port reference tables Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -134,8 +134,8 @@ if __name__ == "__main__":
|
||||
curl -X POST "http://localhost:8000/register" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"email": "user@example.com",
|
||||
"username": "newuser",
|
||||
"email": "user@example.com",
|
||||
"username": "newuser",
|
||||
"password": "password123"
|
||||
}'
|
||||
```
|
||||
@@ -158,7 +158,7 @@ curl -X POST "http://localhost:8000/register" \
|
||||
curl -X POST "http://localhost:8000/login" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"username": "admin",
|
||||
"username": "admin",
|
||||
"password": "admin123"
|
||||
}'
|
||||
```
|
||||
@@ -202,8 +202,8 @@ curl -X POST "http://localhost:8000/products" \
|
||||
-H "Authorization: Bearer YOUR_JWT_TOKEN_HERE" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"marketplace_product_id": "TEST001",
|
||||
"title": "Test MarketplaceProduct",
|
||||
"marketplace_product_id": "TEST001",
|
||||
"title": "Test MarketplaceProduct",
|
||||
"description": "A test product for demonstration",
|
||||
"price": "19.99",
|
||||
"brand": "Test Brand",
|
||||
@@ -267,13 +267,13 @@ Authorization: Bearer <your_jwt_token>
|
||||
def safe_api_call(token, endpoint, method="GET", data=None):
|
||||
"""Make API call with proper error handling"""
|
||||
headers = {"Authorization": f"Bearer {token}"}
|
||||
|
||||
|
||||
try:
|
||||
if method == "GET":
|
||||
response = requests.get(f"{BASE_URL}{endpoint}", headers=headers)
|
||||
elif method == "POST":
|
||||
response = requests.post(f"{BASE_URL}{endpoint}", json=data, headers=headers)
|
||||
|
||||
|
||||
if response.status_code == 401:
|
||||
print("Authentication failed - token may be expired")
|
||||
return None
|
||||
@@ -285,7 +285,7 @@ def safe_api_call(token, endpoint, method="GET", data=None):
|
||||
else:
|
||||
print(f"API call failed: {response.status_code} - {response.text}")
|
||||
return None
|
||||
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"Request failed: {e}")
|
||||
return None
|
||||
@@ -340,7 +340,7 @@ class APIClient {
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({username, password})
|
||||
});
|
||||
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
this.token = data.access_token;
|
||||
@@ -361,17 +361,17 @@ class APIClient {
|
||||
if (data) config.body = JSON.stringify(data);
|
||||
|
||||
const response = await fetch(`${this.baseURL}${endpoint}`, config);
|
||||
|
||||
|
||||
if (response.status === 401) {
|
||||
// Token expired, redirect to login
|
||||
localStorage.removeItem('jwt_token');
|
||||
window.location.href = '/login';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
return response.json();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This authentication system provides secure access control for all API endpoints while maintaining ease of use for developers integrating with the system.
|
||||
This authentication system provides secure access control for all API endpoints while maintaining ease of use for developers integrating with the system.
|
||||
|
||||
Reference in New Issue
Block a user