Add prometheus metrics endpoint. Closes #67

This commit is contained in:
Ian Renton
2025-10-30 13:37:53 +00:00
parent 9768f976c5
commit 6c95e845a4

View File

@@ -7,27 +7,27 @@ disable_created_metrics()
registry = CollectorRegistry()
page_requests_counter = Counter(
"page_requests",
"spothole_page_requests",
"Total number of page requests received",
registry=registry,
)
api_requests_counter = Counter(
"api_requests",
"spothole_api_requests",
"Total number of API requests received",
registry=registry
)
spots_gauge = Gauge(
"spots",
"spothole_spots",
"Number of spots currently in the software",
registry=registry
)
alerts_gauge = Gauge(
"alerts",
"spothole_alerts",
"Number of alerts currently in the software",
registry=registry
)
memory_use_gauge = Gauge(
"memory_usage_bytes",
"spothole_memory_usage_bytes",
"Current memory usage of the software in bytes",
registry=registry
)