#pragma once #include #include namespace Poco::Util { class AbstractConfiguration; } namespace DB { class IServer; class HTTPRequestHandlerFactory; using HTTPRequestHandlerFactoryPtr = std::shared_ptr; class AsynchronousMetrics; /// Makes a handler factory to handle prometheus protocols. /// Expects a configuration like this: /// /// /// 1234 /// /metric /// true /// true /// true /// true /// /// /// More prometheus protocols can be supported with using a different configuration /// (which is similar to the section): /// /// /// 1234 /// /// /// /metrics /// /// expose_metrics /// true /// true /// true /// true /// /// /// /// /// /// An alternative port to serve prometheus protocols can be specified in the section: /// /// /// /// 4321 /// prometheus /// /// HTTPRequestHandlerFactoryPtr createPrometheusHandlerFactory( IServer & server, const Poco::Util::AbstractConfiguration & config, const AsynchronousMetrics & asynchronous_metrics, const String & name); /// Makes a HTTP handler factory to handle requests for prometheus metrics for a HTTP rule in the section. /// Expects a configuration like this: /// /// 8123 /// /// /// /metrics /// /// prometheus /// true /// true /// true /// true /// /// /// /// /write /// /// remote_write /// db.time_series_table_name
///
///
/// /// /read /// /// remote_read /// db.time_series_table_name
///
///
///
HTTPRequestHandlerFactoryPtr createPrometheusHandlerFactoryForHTTPRule( IServer & server, const Poco::Util::AbstractConfiguration & config, const String & config_prefix, /// path to "http_handlers.my_handler_1" const AsynchronousMetrics & asynchronous_metrics); /// Makes a HTTP Handler factory to handle requests for prometheus metrics as a part of the default HTTP rule in the section. /// Expects a configuration like this: /// /// 8123 /// /// /// /// /// /metric /// true /// true /// true /// true /// /// /// The "defaults" HTTP handler should serve the prometheus exposing metrics protocol on the http port /// only if it isn't already served on its own port , /// and also if there is no section in the configuration /// (because if that section exists then it must be in charge of how prometheus protocols are handled). HTTPRequestHandlerFactoryPtr createPrometheusHandlerFactoryForHTTPRuleDefaults( IServer & server, const Poco::Util::AbstractConfiguration & config, const AsynchronousMetrics & asynchronous_metrics); /// Makes a handler factory to handle prometheus protocols. /// Supports the "expose_metrics" protocol only. HTTPRequestHandlerFactoryPtr createKeeperPrometheusHandlerFactory( IServer & server, const Poco::Util::AbstractConfiguration & config, const AsynchronousMetrics & asynchronous_metrics, const String & name); }