diff options
author | Dmitry Razumov <dvrazumov@yandex-team.com> | 2024-05-06 13:13:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 13:13:41 +0200 |
commit | a15355e068029f75cc251340972e8dd880087f96 (patch) | |
tree | cf89dd7ed11eace28f7cd321e91f1ae0980777ce /library/cpp/monlib/encode/prometheus | |
parent | d0fa98329bdfe69907cb73a47bbfee0980743c67 (diff) | |
download | ydb-a15355e068029f75cc251340972e8dd880087f96.tar.gz |
Added test ShouldNotFailOnMetricWithoutSensorLabel for prometheus encoder (#4289)
Co-authored-by: Dmitry Razumov <dvrazumov@yandex-team.ru>
Diffstat (limited to 'library/cpp/monlib/encode/prometheus')
-rw-r--r-- | library/cpp/monlib/encode/prometheus/prometheus_encoder_ut.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/library/cpp/monlib/encode/prometheus/prometheus_encoder_ut.cpp b/library/cpp/monlib/encode/prometheus/prometheus_encoder_ut.cpp index 55a610b841..fe4bbcaf0a 100644 --- a/library/cpp/monlib/encode/prometheus/prometheus_encoder_ut.cpp +++ b/library/cpp/monlib/encode/prometheus/prometheus_encoder_ut.cpp @@ -494,4 +494,22 @@ _99_9 99.9 )"); } + + Y_UNIT_TEST(ShouldNotFailOnMetricWithoutSensorLabel) { + auto result = EncodeToString([](IMetricEncoder* e) { + e->OnStreamBegin(); + e->OnStreamEnd(); + { + e->OnMetricBegin(EMetricType::GAUGE); + { + e->OnLabelsBegin(); + e->OnLabel("name", "cpuUsage"); + e->OnLabelsEnd(); + } + e->OnInt64(TInstant::Zero(), 0); + e->OnMetricEnd(); + } + }); + UNIT_ASSERT_STRINGS_EQUAL(result, "\n"); + } } |