diff options
author | monster <monster@ydb.tech> | 2024-03-18 11:23:24 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2024-03-18 12:10:58 +0300 |
commit | d7c2d188d2464ce858465870a39220c4dfbb5509 (patch) | |
tree | 9a84729d45e2b8461fcb591d2634145f684368b7 | |
parent | f76d5c18094373da03ee99d739fa6e889834348d (diff) | |
download | ydb-d7c2d188d2464ce858465870a39220c4dfbb5509.tar.gz |
skip metrics without name label instead of crashing KIKIMR-21198
c7b986ea7dbf4feee593ab829a2ad361d46c77b0
-rw-r--r-- | library/cpp/monlib/encode/prometheus/prometheus_encoder.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/cpp/monlib/encode/prometheus/prometheus_encoder.cpp b/library/cpp/monlib/encode/prometheus/prometheus_encoder.cpp index f3015c48bc..8083221b63 100644 --- a/library/cpp/monlib/encode/prometheus/prometheus_encoder.cpp +++ b/library/cpp/monlib/encode/prometheus/prometheus_encoder.cpp @@ -370,9 +370,9 @@ namespace NMonitoring { } TMaybe<TLabel> nameLabel = MetricState_.Labels.Extract(MetricNameLabel_); - Y_ENSURE(nameLabel, - "labels " << MetricState_.Labels << - " does not contain label '" << MetricNameLabel_ << '\''); + if (!nameLabel) { + return; + } const TString& metricName = ToString(nameLabel->Value()); if (MetricState_.Type != EMetricType::DSUMMARY) { |