Skip to content
Draft
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 @@ -53,11 +53,11 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClassp
io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
io.undertow:undertow-core:2.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath
io.undertow:undertow-core:2.2.39.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-core:2.2.40.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-servlet:2.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath
io.undertow:undertow-servlet:2.2.39.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-servlet:2.2.40.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-websockets-jsr:2.0.0.Final=testCompileClasspath,testRuntimeClasspath
io.undertow:undertow-websockets-jsr:2.2.39.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-websockets-jsr:2.2.40.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
jaxen:jaxen:2.0.0=spotbugs
junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public HttpRequestParserInstrumentation() {

@Override
public String hierarchyMarkerType() {
// removed in https://github.com/undertow-io/undertow/pull/1949/changes
// see RequestParserInstrumentation for the new type
return "io.undertow.server.protocol.http.HttpRequestParser";
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package datadog.trace.instrumentation.undertow;

import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;

import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.agent.tooling.InstrumenterModule;

@AutoService(InstrumenterModule.class)
public class RequestParserInstrumentation extends InstrumenterModule.Tracing
implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice {
public RequestParserInstrumentation() {
super("undertow", "undertow-2.2", "undertow-request-parse");
}

@Override
public String instrumentedType() {
// new class added in new minor versions in
// https://github.com/undertow-io/undertow/pull/1949/changes
// from 2.2.40, 2.3.25 and 2.4.0
// not instrumenting the hierarchy like in its predecessor HttpRequestParserInstrumentation
// because RequestParser is marked final.
return "io.undertow.server.protocol.http.RequestParser";
}

@Override
public void methodAdvice(MethodTransformer transformer) {
transformer.applyAdvice(
isMethod()
.and(named("handle"))
.and(takesArgument(2, named("io.undertow.server.HttpServerExchange"))),
HttpRequestParserInstrumentation.class.getName() + "$RequestParseFailureAdvice");
}

@Override
public String[] helperClassNames() {
return new String[] {
packageName + ".HttpServerExchangeURIDataAdapter",
packageName + ".UndertowDecorator",
packageName + ".UndertowBlockingHandler",
packageName + ".IgnoreSendAttribute",
packageName + ".UndertowBlockResponseFunction",
packageName + ".UndertowExtractAdapter",
packageName + ".UndertowExtractAdapter$Request",
packageName + ".UndertowExtractAdapter$Response"
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ io.smallrye.common:smallrye-common-ref:2.4.0=latestDepForkedTestRuntimeClasspath
io.sqreen:libsqreen:17.3.0=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
io.undertow:undertow-core:2.2.14.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath
io.undertow:undertow-core:2.2.20.Final=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath
io.undertow:undertow-core:2.3.24.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-core:2.3.25.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-servlet-jakarta:2.2.14.Final=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
io.undertow:undertow-servlet-jakarta:2.2.20.Final=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath
io.undertow:undertow-servlet:2.3.24.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-servlet:2.3.25.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-websockets-jsr-jakarta:2.2.14.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
io.undertow:undertow-websockets-jsr-jakarta:2.2.20.Final=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath
io.undertow:undertow-websockets-jsr:2.3.24.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
io.undertow:undertow-websockets-jsr:2.3.25.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.0.0=compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
jakarta.servlet:jakarta.servlet-api:5.0.0=compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
Expand Down
Loading