mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 01:04:33 +00:00
13 lines
392 B
Python
13 lines
392 B
Python
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)
|