Skip to content

Commit

Permalink
Fix handling of without_type_suffix with gauges
Browse files Browse the repository at this point in the history
  • Loading branch information
psx95 committed Oct 16, 2024
1 parent 019083d commit 66c9c73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exporters/prometheus/src/exporter_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,9 @@ std::string PrometheusExporterUtils::MapToPrometheusName(

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

Expand Down

0 comments on commit 66c9c73

Please sign in to comment.