aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/monlib/encode/prometheus
diff options
context:
space:
mode:
authorDmitry Razumov <dvrazumov@yandex-team.com>2024-05-06 13:13:41 +0200
committerGitHub <noreply@github.com>2024-05-06 13:13:41 +0200
commita15355e068029f75cc251340972e8dd880087f96 (patch)
treecf89dd7ed11eace28f7cd321e91f1ae0980777ce /library/cpp/monlib/encode/prometheus
parentd0fa98329bdfe69907cb73a47bbfee0980743c67 (diff)
downloadydb-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.cpp18
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");
+ }
}