Skip to content

Commit 5d9efb1

Browse files
authored
use duration parser in jmx metrics (#10532)
1 parent 485b8f4 commit 5d9efb1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

instrumentation/jmx-metrics/javaagent/src/main/java/io/opentelemetry/instrumentation/javaagent/jmx/JmxMetricInsightInstaller.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.io.InputStream;
2121
import java.nio.file.Files;
2222
import java.nio.file.Paths;
23+
import java.time.Duration;
2324
import java.util.List;
2425

2526
/** An {@link AgentListener} that enables JMX metrics during agent startup. */
@@ -46,8 +47,9 @@ private static long beanDiscoveryDelay(ConfigProperties configProperties) {
4647

4748
// If discovery delay has not been configured, have a peek at the metric export interval.
4849
// It makes sense for both of these values to be similar.
49-
long exportInterval = configProperties.getLong("otel.metric.export.interval", 60000);
50-
return exportInterval;
50+
return configProperties
51+
.getDuration("otel.metric.export.interval", Duration.ofMinutes(1))
52+
.toMillis();
5153
}
5254

5355
private static String resourceFor(String platform) {

0 commit comments

Comments
 (0)