fix double instrumentation (#13337)

This commit is contained in:
Gregor Zeitlinger 2025-02-18 11:46:48 +01:00 committed by GitHub
parent d52a3b5110
commit 47c032c5d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ public class Java8RuntimeMetricsInstaller implements AgentListener {
@Override
public void afterAgent(AutoConfiguredOpenTelemetrySdk autoConfiguredSdk) {
if (Double.parseDouble(System.getProperty("java.specification.version")) >= 17) {
return;
}
RuntimeMetrics runtimeMetrics =
RuntimeMetricsConfigUtil.configure(
RuntimeMetrics.builder(GlobalOpenTelemetry.get()), AgentInstrumentationConfig.get());