Skip to content

Commit 020dc3f

Browse files
committed
fix incompatible API change
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent b1e1489 commit 020dc3f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.github/renovate.json5

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
extends: ["config:recommended"],
44
platformCommit: "enabled",
55
automerge: true,
6-
dependencyDashboard: false,
76
ignorePaths: [
87
"**/simpleclient-archive/**", // old projects
98
// agent resources packages an OTel API that is the minimum required API version

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ public Boolean getValue() {
8181
}
8282
};
8383

84-
metricRegistry.register("double.gauge", doubleGauge);
85-
metricRegistry.register("long.gauge", longGauge);
86-
metricRegistry.register("integer.gauge", integerGauge);
87-
metricRegistry.register("float.gauge", floatGauge);
88-
metricRegistry.register("boolean.gauge", booleanGauge);
84+
metricRegistry.register(MetricName.parse("double.gauge"), doubleGauge);
85+
metricRegistry.register(MetricName.parse("long.gauge"), longGauge);
86+
metricRegistry.register(MetricName.parse("integer.gauge"), integerGauge);
87+
metricRegistry.register(MetricName.parse("float.gauge"), floatGauge);
88+
metricRegistry.register(MetricName.parse("boolean.gauge"), booleanGauge);
8989

9090
String expected =
9191
"""
@@ -114,7 +114,7 @@ public Boolean getValue() {
114114
public void testInvalidGaugeType() {
115115
Gauge<String> invalidGauge = () -> "foobar";
116116

117-
metricRegistry.register("invalid_gauge", invalidGauge);
117+
metricRegistry.register(MetricName.parse("invalid_gauge"), invalidGauge);
118118

119119
String expected = "# EOF\n";
120120
assertThat(convertToOpenMetricsFormat()).isEqualTo(expected);
@@ -123,7 +123,7 @@ public void testInvalidGaugeType() {
123123
@Test
124124
public void testGaugeReturningNullValue() {
125125
Gauge<String> invalidGauge = () -> null;
126-
metricRegistry.register("invalid_gauge", invalidGauge);
126+
metricRegistry.register(MetricName.parse("invalid_gauge"), invalidGauge);
127127
String expected = "# EOF\n";
128128
assertThat(convertToOpenMetricsFormat()).isEqualTo(expected);
129129
}
@@ -251,7 +251,7 @@ public void testThatMetricHelpUsesOriginalDropwizardName() {
251251
metricRegistry.counter("my.application.namedCounter1");
252252
metricRegistry.meter("my.application.namedMeter1");
253253
metricRegistry.histogram("my.application.namedHistogram1");
254-
metricRegistry.register("my.application.namedGauge1", new ExampleDoubleGauge());
254+
metricRegistry.register(MetricName.parse("my.application.namedGauge1"), new ExampleDoubleGauge());
255255

256256
String expected =
257257
"""

0 commit comments

Comments
 (0)