File tree Expand file tree Collapse file tree 6 files changed +6
-19
lines changed
prometheus-metrics-instrumentation-dropwizard5/src/test/java/io/prometheus/metrics/instrumentation/dropwizard5
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
prometheus-metrics-simpleclient-bridge/src/test/java/io/prometheus/metrics/simpleclient/bridge Expand file tree Collapse file tree 6 files changed +6
-19
lines changed Original file line number Diff line number Diff line change 11package io .prometheus .metrics .instrumentation .dropwizard ;
22
3- import static io .prometheus .metrics .model .snapshots .PrometheusNaming .nameEscapingScheme ;
43import static org .assertj .core .api .Assertions .assertThat ;
54import static org .assertj .core .api .Assertions .assertThatCode ;
65import static org .assertj .core .api .Assertions .assertThatThrownBy ;
@@ -342,8 +341,7 @@ private String convertToOpenMetricsFormat(PrometheusRegistry _registry) {
342341 ByteArrayOutputStream out = new ByteArrayOutputStream ();
343342 OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter (true , true );
344343 try {
345- nameEscapingScheme = EscapingScheme .NO_ESCAPING ;
346- writer .write (out , _registry .scrape ());
344+ writer .write (out , _registry .scrape (), EscapingScheme .NO_ESCAPING );
347345 return out .toString (StandardCharsets .UTF_8 );
348346 } catch (IOException e ) {
349347 throw new RuntimeException (e );
Original file line number Diff line number Diff line change 11package io .prometheus .metrics .instrumentation .dropwizard5 ;
22
3- import static io .prometheus .metrics .model .snapshots .PrometheusNaming .nameEscapingScheme ;
43import static org .assertj .core .api .Assertions .assertThat ;
54import static org .assertj .core .api .Assertions .assertThatThrownBy ;
65import static org .assertj .core .data .Offset .offset ;
@@ -351,8 +350,7 @@ private String convertToOpenMetricsFormat(PrometheusRegistry _registry) {
351350 ByteArrayOutputStream out = new ByteArrayOutputStream ();
352351 OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter (true , true );
353352 try {
354- nameEscapingScheme = EscapingScheme .NO_ESCAPING ;
355- writer .write (out , _registry .scrape ());
353+ writer .write (out , _registry .scrape (), EscapingScheme .NO_ESCAPING );
356354 return out .toString (StandardCharsets .UTF_8 .name ());
357355 } catch (IOException e ) {
358356 throw new RuntimeException (e );
Original file line number Diff line number Diff line change 11package io .prometheus .metrics .instrumentation .dropwizard5 .labels ;
22
3- import static io .prometheus .metrics .model .snapshots .PrometheusNaming .nameEscapingScheme ;
43import static org .assertj .core .api .Assertions .assertThat ;
54import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
65
@@ -220,8 +219,7 @@ private String convertToOpenMetricsFormat(MetricSnapshots snapshots) {
220219 ByteArrayOutputStream out = new ByteArrayOutputStream ();
221220 OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter (true , true );
222221 try {
223- nameEscapingScheme = EscapingScheme .NO_ESCAPING ;
224- writer .write (out , snapshots );
222+ writer .write (out , snapshots , EscapingScheme .NO_ESCAPING );
225223 return out .toString (StandardCharsets .UTF_8 .name ());
226224 } catch (IOException e ) {
227225 throw new RuntimeException (e );
Original file line number Diff line number Diff line change 11package io .prometheus .metrics .instrumentation .guava ;
22
3- import static io .prometheus .metrics .model .snapshots .PrometheusNaming .nameEscapingScheme ;
43import static org .assertj .core .api .Assertions .assertThat ;
54import static org .mockito .ArgumentMatchers .anyString ;
65import static org .mockito .Mockito .mock ;
@@ -163,8 +162,7 @@ private String convertToOpenMetricsFormat(PrometheusRegistry registry) {
163162 final ByteArrayOutputStream out = new ByteArrayOutputStream ();
164163 final OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter (true , true );
165164 try {
166- nameEscapingScheme = EscapingScheme .NO_ESCAPING ;
167- writer .write (out , registry .scrape ());
165+ writer .write (out , registry .scrape (), EscapingScheme .NO_ESCAPING );
168166 return out .toString (StandardCharsets .UTF_8 .name ());
169167 } catch (IOException e ) {
170168 throw new UncheckedIOException (e );
Original file line number Diff line number Diff line change 77import java .io .IOException ;
88import java .nio .charset .StandardCharsets ;
99
10- import static io .prometheus .metrics .model .snapshots .PrometheusNaming .nameEscapingScheme ;
11-
1210class TestUtil {
1311
1412 static String convertToOpenMetricsFormat (MetricSnapshots snapshots ) throws IOException {
1513 ByteArrayOutputStream out = new ByteArrayOutputStream ();
1614 OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter (true , true );
17- nameEscapingScheme = EscapingScheme .NO_ESCAPING ;
18- writer .write (out , snapshots );
15+ writer .write (out , snapshots , EscapingScheme .NO_ESCAPING );
1916 return out .toString (StandardCharsets .UTF_8 .name ());
2017 }
2118}
Original file line number Diff line number Diff line change 11package io .prometheus .metrics .simpleclient .bridge ;
22
3- import static io .prometheus .metrics .model .snapshots .PrometheusNaming .nameEscapingScheme ;
43import static org .assertj .core .api .Assertions .assertThat ;
54
65import io .prometheus .client .Collector ;
@@ -269,8 +268,7 @@ private String origOpenMetrics() throws IOException {
269268 private String newOpenMetrics () throws IOException {
270269 ByteArrayOutputStream out = new ByteArrayOutputStream ();
271270 OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter (true , false );
272- nameEscapingScheme = EscapingScheme .NO_ESCAPING ;
273- writer .write (out , newRegistry .scrape ());
271+ writer .write (out , newRegistry .scrape (), EscapingScheme .NO_ESCAPING );
274272 return out .toString (StandardCharsets .UTF_8 .name ());
275273 }
276274}
You can’t perform that action at this time.
0 commit comments