2019-11-24 15:43:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2019-11-26 20:27:24 +00:00
|
|
|
#include <Interpreters/AsynchronousMetrics.h>
|
|
|
|
|
2019-11-24 15:43:53 +00:00
|
|
|
#include <IO/WriteBuffer.h>
|
2019-11-26 20:27:24 +00:00
|
|
|
|
2019-11-24 15:43:53 +00:00
|
|
|
#include <Poco/Util/AbstractConfiguration.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Write metrics in Prometheus format
|
|
|
|
class PrometheusMetricsWriter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PrometheusMetricsWriter(
|
2019-11-26 20:27:24 +00:00
|
|
|
const Poco::Util::AbstractConfiguration & config, const std::string & config_name,
|
|
|
|
const AsynchronousMetrics & async_metrics_);
|
2019-11-24 15:43:53 +00:00
|
|
|
|
2019-11-24 20:03:09 +00:00
|
|
|
void write(WriteBuffer & wb) const;
|
2019-11-24 15:43:53 +00:00
|
|
|
|
|
|
|
private:
|
2019-11-26 20:27:24 +00:00
|
|
|
const AsynchronousMetrics & async_metrics;
|
|
|
|
|
2019-11-24 15:43:53 +00:00
|
|
|
const bool send_events;
|
|
|
|
const bool send_metrics;
|
2019-11-26 20:27:24 +00:00
|
|
|
const bool send_asynchronous_metrics;
|
2020-03-11 15:30:02 +00:00
|
|
|
const bool send_status_info;
|
2019-11-24 15:43:53 +00:00
|
|
|
|
2019-12-21 17:47:44 +00:00
|
|
|
static inline constexpr auto profile_events_prefix = "ClickHouseProfileEvents_";
|
|
|
|
static inline constexpr auto current_metrics_prefix = "ClickHouseMetrics_";
|
|
|
|
static inline constexpr auto asynchronous_metrics_prefix = "ClickHouseAsyncMetrics_";
|
2020-03-11 15:30:02 +00:00
|
|
|
static inline constexpr auto current_status_prefix = "ClickHouseStatusInfo_";
|
2019-11-24 15:43:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|