Skip to content

Commit 66c9c73

Browse files
committed
Fix handling of without_type_suffix with gauges
1 parent 019083d commit 66c9c73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

exporters/prometheus/src/exporter_utils.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,9 @@ std::string PrometheusExporterUtils::MapToPrometheusName(
530530

531531
// Special case - gauge
532532
if (unit == "1" && prometheus_type == prometheus_client::MetricType::Gauge &&
533-
sanitized_name.find("ratio") == std::string::npos && !without_type_suffix)
533+
sanitized_name.find("ratio") == std::string::npos && !without_units)
534534
{
535+
// this is replacing the unit name
535536
sanitized_name += "_ratio";
536537
}
537538

0 commit comments

Comments
 (0)