Skip to content

Commit

Permalink
Hardcode path separator used for metric type (#253)
Browse files Browse the repository at this point in the history
Using Java Paths class to combine string leads to different
path-separators depending on the OS of the machine code runs on. For
metric names, only the linux path-separators are valid, so hardcoding
this.
  • Loading branch information
psx95 authored Jun 16, 2023
1 parent e6c6a2b commit b391c4a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.MetricDataType;
import io.opentelemetry.sdk.metrics.data.SumData;
import java.nio.file.Paths;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -226,7 +225,7 @@ private static String mapMetricType(String instrumentName, String prefix) {
return instrumentName;
}
}
return Paths.get(prefix, instrumentName).toString();
return String.join("/", prefix, instrumentName);
}

private static Distribution.Exemplar mapExemplar(ExemplarData exemplar, String projectId) {
Expand Down

0 comments on commit b391c4a

Please sign in to comment.