Skip to content

Commit

Permalink
Enable instrumentation of Spring EJB clients
Browse files Browse the repository at this point in the history
  • Loading branch information
zackman0010 committed Apr 10, 2024
1 parent 628136e commit b909af6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.spring.rmi.v4_0;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.ignore.IgnoredTypesBuilder;
import io.opentelemetry.javaagent.extension.ignore.IgnoredTypesConfigurer;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;

@AutoService(IgnoredTypesConfigurer.class)
public class SpringRmiIgnoredTypesConfigurer implements IgnoredTypesConfigurer {

@Override
public void configure(IgnoredTypesBuilder builder, ConfigProperties config) {
// The Spring EJB classes are ignored in the AdditionalLibraryIgnoredTypesConfigurer, but
// are required when utilizing Spring's local-slsb and remote-slsb to access EJBs through RMI.
builder.allowClass("org.springframework.ejb.access.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package io.opentelemetry.javaagent.instrumentation.spring.rmi.v4_0.client;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.extendsClass;
import static io.opentelemetry.javaagent.instrumentation.spring.rmi.v4_0.SpringRmiSingletons.clientInstrumenter;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.named;
Expand All @@ -25,7 +26,8 @@ public class ClientInstrumentation implements TypeInstrumentation {

@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return named("org.springframework.remoting.rmi.RmiClientInterceptor");
return named("org.springframework.remoting.rmi.RmiClientInterceptor")
.or(extendsClass(named("org.springframework.ejb.access.AbstractSlsbInvokerInterceptor")));
}

@Override
Expand Down

0 comments on commit b909af6

Please sign in to comment.