Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus exporter: remove non-ucum units from conversion #5719

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -186,8 +176,6 @@ private static String getPrometheusUnit(String unitAbbreviation) {
return "";
case "%":
return "percent";
case "$":
return "dollars";
default:
return unitAbbreviation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@ private static Stream<Arguments> providePrometheusOTelUnitEquivalentPairs() {
return Stream.of(
// Simple expansion - storage Bytes
Arguments.of("By", "bytes"),
Arguments.of("B", "bytes"),
// Simple expansion - storage KB
Arguments.of("KB", "kilobytes"),
// Simple expansion - storage KBy
Arguments.of("KBy", "kilobytes"),
// Simple expansion - storage MB
Arguments.of("MB", "megabytes"),
// Simple expansion - storage MBy
Arguments.of("MBy", "megabytes"),
// Simple expansion - storage GB
Arguments.of("GB", "gigabytes"),
// Simple expansion - storage GBy
Arguments.of("GBy", "gigabytes"),
// Simple expansion - storage TB
Arguments.of("TB", "terabytes"),
// Simple expansion - storage TBy
Arguments.of("TBy", "terabytes"),
// Simple expansion - storage KiBy
Arguments.of("KiBy", "kibibytes"),
Expand All @@ -61,8 +56,6 @@ private static Stream<Arguments> 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
Expand Down Expand Up @@ -90,7 +83,7 @@ private static Stream<Arguments> 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
Expand Down