#pragma once #include "config.h" #if USE_PROMETHEUS_PROTOBUFS #include #include #include namespace DB { class StorageTimeSeries; /// Helper class to support the prometheus remote write protocol. class PrometheusRemoteWriteProtocol : WithContext { public: PrometheusRemoteWriteProtocol(StoragePtr time_series_storage_, const ContextPtr & context_); ~PrometheusRemoteWriteProtocol(); /// Insert time series received by remote write protocol to our table. void writeTimeSeries(const google::protobuf::RepeatedPtrField & time_series); /// Insert metrics metadata received by remote write protocol to our table. void writeMetricsMetadata(const google::protobuf::RepeatedPtrField & metrics_metadata); private: std::shared_ptr time_series_storage; Poco::LoggerPtr log; }; } #endif