aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorvalerybitsoev <valerybitsoev@yandex-team.com>2023-11-23 21:58:28 +0300
committervalerybitsoev <valerybitsoev@yandex-team.com>2023-11-23 22:26:06 +0300
commit7b1701b1c40fea4015925f883a628af9e20f8f6d (patch)
treece85fbb8a939d00b6706636fbb27dcf0b3d6092b /library/cpp
parentf330971f637115368558cea161aaae7a51a11924 (diff)
downloadydb-7b1701b1c40fea4015925f883a628af9e20f8f6d.tar.gz
allow multiple equal TYPE in prom metrics
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/monlib/encode/prometheus/prometheus_decoder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/cpp/monlib/encode/prometheus/prometheus_decoder.cpp b/library/cpp/monlib/encode/prometheus/prometheus_decoder.cpp
index d37961a241..fb6466dba9 100644
--- a/library/cpp/monlib/encode/prometheus/prometheus_decoder.cpp
+++ b/library/cpp/monlib/encode/prometheus/prometheus_decoder.cpp
@@ -234,8 +234,10 @@ namespace NMonitoring {
SkipSpaces();
EPrometheusMetricType nextType = ReadType();
- bool inserted = SeenTypes_.emplace(nextName, nextType).second;
- Y_PARSER_ENSURE(inserted, "second TYPE line for metric " << nextName);
+ auto emplaceResult = SeenTypes_.emplace(nextName, nextType);
+ if (!emplaceResult.second) {
+ Y_PARSER_ENSURE(emplaceResult.first->second == nextType, "second diferent TYPE for metric " << nextName);
+ }
if (nextType == EPrometheusMetricType::HISTOGRAM) {
if (!HistogramBuilder_.Empty()) {