import tornado
from prometheus_client import CONTENT_TYPE_LATEST

from core.prometheus_metrics_handler import get_metrics


class PrometheusMetricsHandler(tornado.web.RequestHandler):
    """Handler for Prometheus metrics endpoint"""

    def get(self):
        self.write(get_metrics())
        self.set_status(200)
        self.set_header('Content-Type', CONTENT_TYPE_LATEST)
