use of io.opentelemetry.javaagent.extension.ignore.IgnoredTypesConfigurer in project opentelemetry-java-instrumentation by open-telemetry.
the class TestAgentListener method buildOtherConfiguredIgnores.
private static Trie<IgnoreAllow> buildOtherConfiguredIgnores() {
Config config = Config.builder().build();
IgnoredTypesBuilderImpl builder = new IgnoredTypesBuilderImpl();
for (IgnoredTypesConfigurer configurer : SafeServiceLoader.loadOrdered(IgnoredTypesConfigurer.class)) {
// skip built-in agent ignores
if (configurer instanceof AdditionalLibraryIgnoredTypesConfigurer || configurer instanceof GlobalIgnoredTypesConfigurer) {
continue;
}
configurer.configure(config, builder);
}
return builder.buildIgnoredTypesTrie();
}
use of io.opentelemetry.javaagent.extension.ignore.IgnoredTypesConfigurer in project opentelemetry-java-instrumentation by open-telemetry.
the class AgentInstaller method configureIgnoredTypes.
private static AgentBuilder configureIgnoredTypes(Config config, AgentBuilder agentBuilder) {
IgnoredTypesBuilderImpl builder = new IgnoredTypesBuilderImpl();
for (IgnoredTypesConfigurer configurer : loadOrdered(IgnoredTypesConfigurer.class)) {
configurer.configure(config, builder);
}
Trie<Boolean> ignoredTasksTrie = builder.buildIgnoredTasksTrie();
InstrumentedTaskClasses.setIgnoredTaskClassesPredicate(ignoredTasksTrie::contains);
return agentBuilder.ignore(any(), new IgnoredClassLoadersMatcher(builder.buildIgnoredClassLoadersTrie())).or(new IgnoredTypesMatcher(builder.buildIgnoredTypesTrie())).or((typeDescription, classLoader, module, classBeingRedefined, protectionDomain) -> {
return HelperInjector.isInjectedClass(classLoader, typeDescription.getName());
});
}
Aggregations