2019-11-24 12:06:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
#include <Server/HTTP/HTTPRequestHandler.h>
|
2019-11-24 12:06:10 +00:00
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
#include "PrometheusMetricsWriter.h"
|
2019-11-24 12:06:10 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
class IServer;
|
|
|
|
|
|
|
|
class PrometheusRequestHandler : public HTTPRequestHandler
|
2019-11-24 12:06:10 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
IServer & server;
|
2019-11-24 15:43:53 +00:00
|
|
|
const PrometheusMetricsWriter & metrics_writer;
|
2019-11-24 12:06:10 +00:00
|
|
|
|
|
|
|
public:
|
2020-04-21 11:30:45 +00:00
|
|
|
explicit PrometheusRequestHandler(IServer & server_, const PrometheusMetricsWriter & metrics_writer_)
|
2019-11-24 15:43:53 +00:00
|
|
|
: server(server_)
|
|
|
|
, metrics_writer(metrics_writer_)
|
2019-11-24 12:06:10 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
void handleRequest(HTTPServerRequest & request, HTTPServerResponse & response) override;
|
2019-11-24 12:06:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|