prometheus.h 709 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <library/cpp/monlib/encode/encoder.h>
  3. #include <library/cpp/monlib/encode/format.h>
  4. #include <util/generic/yexception.h>
  5. namespace NMonitoring {
  6. class TPrometheusDecodeException: public yexception {
  7. };
  8. enum class EPrometheusDecodeMode {
  9. DEFAULT,
  10. RAW
  11. };
  12. struct TPrometheusDecodeSettings {
  13. EPrometheusDecodeMode Mode{EPrometheusDecodeMode::DEFAULT};
  14. };
  15. IMetricEncoderPtr EncoderPrometheus(IOutputStream* out, TStringBuf metricNameLabel = "sensor");
  16. void DecodePrometheus(TStringBuf data, IMetricConsumer* c, TStringBuf metricNameLabel = "sensor", const TPrometheusDecodeSettings& settings = TPrometheusDecodeSettings{});
  17. }