Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Simplify instrumentation
  • Loading branch information
Mariovido committed Nov 13, 2024
commit c7ffba16628ae52c9a2c6860b55b73d9e7a7e1bf
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package datadog.trace.instrumentation.apachehttpcore5;

import static net.bytebuddy.matcher.ElementMatchers.any;
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;

import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;
import java.net.URI;
import net.bytebuddy.asm.Advice;

@AutoService(InstrumenterModule.class)
Expand All @@ -22,7 +24,9 @@ public String instrumentedType() {

@Override
public void methodAdvice(MethodTransformer transformer) {
transformer.applyAdvice(any(), BasicHttpRequestInstrumentation.class.getName() + "$CtorAdvice");
transformer.applyAdvice(
isConstructor().and(takesArguments(String.class, URI.class)),
BasicHttpRequestInstrumentation.class.getName() + "$CtorAdvice");
}

public static class CtorAdvice {
Expand Down