Allow instrumenting built-in class loaders
ADD
instrumentation/internal/internal-class-loader/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/classloader/ClassLoaderIgnoredTypesConfigurer.java
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+package io.opentelemetry.javaagent.instrumentation.internal.classloader;
+
+import com.google.auto.service.AutoService;
+import io.opentelemetry.instrumentation.api.config.Config;
+import io.opentelemetry.javaagent.extension.ignore.IgnoredTypesBuilder;
+import io.opentelemetry.javaagent.extension.ignore.IgnoredTypesConfigurer;
+
+@AutoService(IgnoredTypesConfigurer.class)
+public class ClassLoaderIgnoredTypesConfigurer implements IgnoredTypesConfigurer {
+
+ @Override
+ public void configure(Config config, IgnoredTypesBuilder builder) {
+ builder.allowClass("jdk.internal.loader.BuiltinClassLoader");
+ builder.allowClass("sun.misc.Launcher$AppClassLoader");
+ }
+}

Allow instrumenting built-in class loaders (#6093)