#pragma once #include #include #include #include #include namespace DB { /// Write metrics in Prometheus format class PrometheusMetricsWriter { public: PrometheusMetricsWriter( const Poco::Util::AbstractConfiguration & config, const std::string & config_name, const AsynchronousMetrics & async_metrics_); virtual void write(WriteBuffer & wb) const; virtual ~PrometheusMetricsWriter() = default; protected: const AsynchronousMetrics & async_metrics; const bool send_events; const bool send_metrics; const bool send_asynchronous_metrics; const bool send_errors; }; class KeeperPrometheusMetricsWriter : public PrometheusMetricsWriter { using PrometheusMetricsWriter::PrometheusMetricsWriter; void write(WriteBuffer & wb) const override; }; using PrometheusMetricsWriterPtr = std::shared_ptr; }