Skip to content

Commit 47554b2

Browse files
committed
fix
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 6f1b6a3 commit 47554b2

File tree

4 files changed

+5
-5
lines changed
  • prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels
  • prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard
  • prometheus-metrics-instrumentation-guava/src/test/java/io/prometheus/metrics/instrumentation/guava
  • prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm

4 files changed

+5
-5
lines changed

prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ private String convertToOpenMetricsFormat(PrometheusRegistry _registry) {
341341
ByteArrayOutputStream out = new ByteArrayOutputStream();
342342
OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true);
343343
try {
344-
writer.write(out, _registry.scrape(), EscapingScheme.NO_ESCAPING);
344+
writer.write(out, _registry.scrape(), EscapingScheme.UNDERSCORE_ESCAPING);
345345
return out.toString(StandardCharsets.UTF_8);
346346
} catch (IOException e) {
347347
throw new RuntimeException(e);

prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5/labels/CustomLabelMapperTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ private String convertToOpenMetricsFormat(MetricSnapshots snapshots) {
219219
ByteArrayOutputStream out = new ByteArrayOutputStream();
220220
OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true);
221221
try {
222-
writer.write(out, snapshots, EscapingScheme.NO_ESCAPING);
223-
return out.toString(StandardCharsets.UTF_8.name());
222+
writer.write(out, snapshots, EscapingScheme.UNDERSCORE_ESCAPING);
223+
return out.toString(StandardCharsets.UTF_8);
224224
} catch (IOException e) {
225225
throw new RuntimeException(e);
226226
}

prometheus-metrics-instrumentation-guava/src/test/java/io/prometheus/metrics/instrumentation/guava/CacheMetricsCollectorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private String convertToOpenMetricsFormat(PrometheusRegistry registry) {
162162
final OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true);
163163
try {
164164
writer.write(out, registry.scrape(), EscapingScheme.NO_ESCAPING);
165-
return out.toString(StandardCharsets.UTF_8.name());
165+
return out.toString(StandardCharsets.UTF_8);
166166
} catch (IOException e) {
167167
throw new UncheckedIOException(e);
168168
}

prometheus-metrics-instrumentation-jvm/src/test/java/io/prometheus/metrics/instrumentation/jvm/TestUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ static String convertToOpenMetricsFormat(MetricSnapshots snapshots) throws IOExc
1313
ByteArrayOutputStream out = new ByteArrayOutputStream();
1414
OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true);
1515
writer.write(out, snapshots, EscapingScheme.NO_ESCAPING);
16-
return out.toString(StandardCharsets.UTF_8.name());
16+
return out.toString(StandardCharsets.UTF_8);
1717
}
1818
}

0 commit comments

Comments
 (0)