mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 01:04:33 +00:00
Split up some code for sanity #3
This commit is contained in:
12
server/handlers/metrics.py
Normal file
12
server/handlers/metrics.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import tornado
|
||||
from prometheus_client.openmetrics.exposition import CONTENT_TYPE_LATEST
|
||||
|
||||
from core.prometheus_metrics_handler import get_metrics
|
||||
|
||||
|
||||
# Handler for Prometheus metrics endpoint
|
||||
class PrometheusMetricsHandler(tornado.web.RequestHandler):
|
||||
def get(self):
|
||||
self.write(get_metrics())
|
||||
self.set_status(200)
|
||||
self.set_header('Content-Type', CONTENT_TYPE_LATEST)
|
||||
Reference in New Issue
Block a user