Update HTTPHandlerFactory.cpp

This commit is contained in:
alexey-milovidov 2020-05-18 22:46:32 +03:00 committed by GitHub
parent f54435e7fd
commit 551fbf8519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,6 +129,8 @@ static inline Poco::Net::HTTPRequestHandlerFactory * createHTTPHandlerFactory(
query_handler->allowPostAndGetParamsRequest();
factory->addHandler(query_handler.release());
/// We check that prometheus handler will be served on current (default) port.
/// Otherwise it will be created separately, see below.
if (server.config().has("prometheus") && server.config().getInt("prometheus.port", 0) == 0)
{
auto prometheus_handler = std::make_unique<HandlingRuleHTTPHandlerFactory<PrometheusRequestHandler>>(