diff --git a/jmx-metrics/src/test/java/io/opentelemetry/contrib/jmxmetrics/InstrumenterHelperTest.java b/jmx-metrics/src/test/java/io/opentelemetry/contrib/jmxmetrics/InstrumenterHelperTest.java index e6bde674b..9ae5889dd 100644 --- a/jmx-metrics/src/test/java/io/opentelemetry/contrib/jmxmetrics/InstrumenterHelperTest.java +++ b/jmx-metrics/src/test/java/io/opentelemetry/contrib/jmxmetrics/InstrumenterHelperTest.java @@ -438,7 +438,13 @@ void doubleValueCallbackMBeans() throws Exception { String description = "multiple double gauge description"; updateWithHelper( - mBeanHelper, instrumentMethod, instrumentName, description, "Double", new HashMap<>()); + mBeanHelper, + instrumentMethod, + instrumentName, + description, + "Double", + new HashMap<>(), + /* aggregateAcrossMBeans= */ true); assertThat(metricReader.collectAllMetrics()) .satisfiesExactly( @@ -713,7 +719,13 @@ void updateWithHelper( labelFuncs.put( "labelTwo", (Closure) Eval.me("{ mbean -> mbean.name().getKeyProperty('thing') }")); updateWithHelper( - mBeanHelper, instrumentMethod, instrumentName, description, attribute, labelFuncs); + mBeanHelper, + instrumentMethod, + instrumentName, + description, + attribute, + labelFuncs, + /* aggregateAcrossMBeans= */ false); } void updateWithHelper( @@ -722,7 +734,8 @@ void updateWithHelper( String instrumentName, String description, String attribute, - Map> labelFuncs) { + Map> labelFuncs, + boolean aggregateAcrossMBeans) { Closure instrument = (Closure) Eval.me("otel", otel, "otel.&" + instrumentMethod); InstrumentHelper instrumentHelper = new InstrumentHelper( @@ -734,7 +747,7 @@ void updateWithHelper( Collections.singletonMap(attribute, null), instrument, metricEnvironment, - false); + aggregateAcrossMBeans); instrumentHelper.update(); }