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;
|
2019-11-24 15:43:53 +00:00
|
|
|
|
2019-12-10 08:31:59 +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";
|
2019-11-24 15:43:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|