1#pragma once
2
3#include <string>
4
5#include <Interpreters/AsynchronousMetrics.h>
6
7#include <IO/WriteBuffer.h>
8
9#include <Poco/Util/AbstractConfiguration.h>
10
11namespace DB
12{
13
14/// Write metrics in Prometheus format
15class PrometheusMetricsWriter
16{
17public:
18 PrometheusMetricsWriter(
19 const Poco::Util::AbstractConfiguration & config, const std::string & config_name,
20 const AsynchronousMetrics & async_metrics_);
21
22 void write(WriteBuffer & wb) const;
23
24private:
25 const AsynchronousMetrics & async_metrics;
26
27 const bool send_events;
28 const bool send_metrics;
29 const bool send_asynchronous_metrics;
30
31 static inline constexpr auto profile_events_prefix = "ClickHouseProfileEvents_";
32 static inline constexpr auto current_metrics_prefix = "ClickHouseMetrics_";
33 static inline constexpr auto asynchronous_metrics_prefix = "ClickHouseAsyncMetrics_";
34};
35
36}
37