Skip to content

Akka server indy support #12243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@
import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
import java.util.List;
import net.bytebuddy.matcher.ElementMatcher;

@AutoService(InstrumentationModule.class)
public class AkkaHttpServerInstrumentationModule extends InstrumentationModule {
public class AkkaHttpServerInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public AkkaHttpServerInstrumentationModule() {
super("akka-http", "akka-http-10.0", "akka-http-server");
}

@Override
public String getModuleGroup() {
return "akka-http";
}

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// in GraphInterpreterInstrumentation we instrument a class that belongs to akka-streams, make
// sure this runs only when akka-http is present to avoid muzzle failures
return hasClassesNamed("akka.http.scaladsl.HttpExt");
}

@Override
public boolean isIndyModule() {
// AkkaHttpServerInstrumentationModule and AkkaHttpServerRouteInstrumentationModule share
// AkkaRouteHolder class
return false;
}

@Override
public List<TypeInstrumentation> typeInstrumentations() {
return asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
import java.util.List;

/**
* This instrumentation applies to classes in akka-http.jar while
* AkkaHttpServerInstrumentationModule applies to classes in akka-http-core.jar
*/
@AutoService(InstrumentationModule.class)
public class AkkaHttpServerRouteInstrumentationModule extends InstrumentationModule {
public class AkkaHttpServerRouteInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {
public AkkaHttpServerRouteInstrumentationModule() {
super("akka-http", "akka-http-10.0", "akka-http-server", "akka-http-server-route");
}

@Override
public boolean isIndyModule() {
// AkkaHttpServerInstrumentationModule and AkkaHttpServerRouteInstrumentationModule share
// AkkaRouteHolder class
return false;
public String getModuleGroup() {
return "akka-http";
}

@Override
Expand Down
Loading