Create services/metrics.py
Browse files- services/metrics.py +7 -0
services/metrics.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from prometheus_client import Counter, start_http_server
|
2 |
+
|
3 |
+
# HTTP endpoint for Prometheus to scrape
|
4 |
+
start_http_server(8001)
|
5 |
+
|
6 |
+
CHAT_COUNT = Counter("chat_requests_total", "Total chat requests")
|
7 |
+
OPTIMIZE_COUNT = Counter("optimize_requests_total", "Total optimize requests")
|