Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Aug 21, 2023
1 parent 13e5fc6 commit 44da63b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static String mapToPrometheusName(MetricData rawMetric, PrometheusType p
&& !name.contains(prometheusEquivalentUnit);
// trim counter's _total suffix so the unit is placed before it.
if (prometheusType == PrometheusType.COUNTER && name.endsWith("_total")) {
name = name.substring(0, name.length() - 6);
name = name.substring(0, name.length() - "_total".length());
}
// append prometheus unit if not null or empty.
if (shouldAppendUnit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ String headerName(String name, MetricData rawMetric, PrometheusType type) {
// header.
String sanitizedOriginalName = NameSanitizer.INSTANCE.apply(rawMetric.getName());
if (!sanitizedOriginalName.endsWith("_total") && (type == PrometheusType.COUNTER)) {
return name.substring(0, name.length() - 6);
return name.substring(0, name.length() - "_total".length());
}
return name;
}
Expand Down

0 comments on commit 44da63b

Please sign in to comment.