ClickHouse/dbms/programs/server/PrometheusMetricsWriter.h

39 lines
998 B
C++
Raw Normal View History

#pragma once
#include <string>
2019-11-26 20:27:24 +00:00
#include <Interpreters/AsynchronousMetrics.h>
#include <IO/WriteBuffer.h>
2019-11-26 20:27:24 +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 20:03:09 +00:00
void write(WriteBuffer & wb) const;
private:
2019-11-26 20:27:24 +00:00
const AsynchronousMetrics & async_metrics;
const bool send_events;
const bool send_metrics;
2019-11-26 20:27:24 +00:00
const bool send_asynchronous_metrics;
const bool send_status_info;
static inline constexpr auto profile_events_prefix = "ClickHouseProfileEvents_";
static inline constexpr auto current_metrics_prefix = "ClickHouseMetrics_";
static inline constexpr auto asynchronous_metrics_prefix = "ClickHouseAsyncMetrics_";
static inline constexpr auto current_status_prefix = "ClickHouseStatusInfo_";
};
}