diff --git a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelper.java b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelper.java index b4ba94d4709..a0ca81669d9 100644 --- a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelper.java +++ b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelper.java @@ -154,16 +154,6 @@ private static String getPrometheusUnit(String unitAbbreviation) { return "gigabytes"; case "TBy": return "terabytes"; - case "B": - return "bytes"; - case "KB": - return "kilobytes"; - case "MB": - return "megabytes"; - case "GB": - return "gigabytes"; - case "TB": - return "terabytes"; // SI case "m": return "meters"; @@ -186,8 +176,6 @@ private static String getPrometheusUnit(String unitAbbreviation) { return ""; case "%": return "percent"; - case "$": - return "dollars"; default: return unitAbbreviation; } diff --git a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelperTest.java b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelperTest.java index a510e726215..01e2616d276 100644 --- a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelperTest.java +++ b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelperTest.java @@ -24,18 +24,13 @@ private static Stream providePrometheusOTelUnitEquivalentPairs() { return Stream.of( // Simple expansion - storage Bytes Arguments.of("By", "bytes"), - Arguments.of("B", "bytes"), // Simple expansion - storage KB - Arguments.of("KB", "kilobytes"), Arguments.of("KBy", "kilobytes"), // Simple expansion - storage MB - Arguments.of("MB", "megabytes"), Arguments.of("MBy", "megabytes"), // Simple expansion - storage GB - Arguments.of("GB", "gigabytes"), Arguments.of("GBy", "gigabytes"), // Simple expansion - storage TB - Arguments.of("TB", "terabytes"), Arguments.of("TBy", "terabytes"), // Simple expansion - storage KiBy Arguments.of("KiBy", "kibibytes"), @@ -61,8 +56,6 @@ private static Stream providePrometheusOTelUnitEquivalentPairs() { Arguments.of("min", "minutes"), // Simple expansion - special symbol - % Arguments.of("%", "percent"), - // Simple expansion - special symbols - $ - Arguments.of("$", "dollars"), // Simple expansion - frequency Arguments.of("Hz", "hertz"), // Simple expansion - temperature @@ -90,7 +83,7 @@ private static Stream providePrometheusOTelUnitEquivalentPairs() { // Units expressing rate - per month Arguments.of("J/mo", "joules_per_month"), // Units expressing rate - per year - Arguments.of("TB/y", "terabytes_per_year"), + Arguments.of("TBy/y", "terabytes_per_year"), // Units expressing rate - 'per' units, both units unknown Arguments.of("v/v", "v_per_v"), // Units expressing rate - 'per' units, first unit unknown