Skip to content

Commit f06eb57

Browse files
author
Andrew Kent
committed
Convert apache-http, akka, and play to muzzle plugin
1 parent c6841c9 commit f06eb57

5 files changed

Lines changed: 45 additions & 55 deletions

File tree

dd-java-agent/instrumentation/akka-http-10.0/akka-http-10.0.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ compileLagomTestGroovy {
1616
targetCompatibility = 1.8
1717
}
1818

19+
20+
muzzle {
21+
pass {
22+
group = 'com.typesafe.akka'
23+
module = 'akka-http_2.11'
24+
versions = "[10.0.0,10.0.12)"
25+
}
26+
pass {
27+
group = 'com.typesafe.akka'
28+
module = 'akka-http_2.12'
29+
versions = "[10.0.0,10.0.12)"
30+
}
31+
}
32+
1933
dependencies {
2034
compileOnly group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '10.0.0'
2135

dd-java-agent/instrumentation/apache-httpclient-4.3/apache-httpclient-4.3.gradle

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1-
apply plugin: 'version-scan'
2-
3-
versionScan {
4-
group = "org.apache.httpcomponents"
5-
module = "httpclient"
6-
versions = "[4.3,)"
7-
legacyGroup = "commons-httpclient"
8-
legacyModule = "commons-httpclient"
9-
verifyPresent = [
10-
// The commented out classes are required for the instrumentation (this is checked by our bytebuddy rules).
11-
// Once the verifier can report on the failed versions these classes can be commented out and the pass range can be widened.
12-
13-
// "org.apache.http.HttpException" : null,
14-
// "org.apache.http.HttpRequest" : null,
15-
// "org.apache.http.client.RedirectStrategy" : null,
16-
"org.apache.http.client.methods.CloseableHttpResponse": null,
17-
"org.apache.http.client.methods.HttpExecutionAware" : null,
18-
"org.apache.http.client.methods.HttpRequestWrapper" : null,
19-
"org.apache.http.client.protocol.HttpClientContext" : null,
20-
// "org.apache.http.conn.routing.HttpRoute" : null,
21-
"org.apache.http.impl.execchain.ClientExecChain" : null
22-
]
23-
}
24-
251
apply from: "${rootDir}/gradle/java.gradle"
262

3+
muzzle {
4+
pass {
5+
group = "org.apache.httpcomponents"
6+
module = "httpclient"
7+
versions = "[4.3,)"
8+
}
9+
pass {
10+
group = "commons-httpclient"
11+
module = "commons-httpclient"
12+
versions = "[4.3,)"
13+
}
14+
fail {
15+
group = "org.apache.httpcomponents"
16+
module = "httpclient"
17+
versions = "[,4.3)"
18+
}
19+
}
20+
2721
apply plugin: 'org.unbroken-dome.test-sets'
2822

2923
testSets {

dd-java-agent/instrumentation/apache-httpclient-4.3/src/main/java/datadog/trace/instrumentation/apachehttpclient/ApacheHttpClientInstrumentation.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package datadog.trace.instrumentation.apachehttpclient;
22

33
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
4-
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
54
import static io.opentracing.log.Fields.ERROR_OBJECT;
65
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
76
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
@@ -36,22 +35,6 @@ public ElementMatcher<TypeDescription> typeMatcher() {
3635
.or(safeHasSuperType(named("org.apache.http.impl.client.CloseableHttpClient")));
3736
}
3837

39-
@Override
40-
public ElementMatcher<ClassLoader> classLoaderMatcher() {
41-
return classLoaderHasClasses(
42-
"org.apache.http.HttpException",
43-
"org.apache.http.HttpRequest",
44-
"org.apache.http.client.RedirectStrategy",
45-
"org.apache.http.client.methods.CloseableHttpResponse",
46-
"org.apache.http.client.methods.HttpExecutionAware",
47-
"org.apache.http.client.methods.HttpRequestWrapper",
48-
"org.apache.http.client.protocol.HttpClientContext",
49-
"org.apache.http.conn.routing.HttpRoute",
50-
"org.apache.http.impl.execchain.ClientExecChain",
51-
"org.apache.http.impl.client.CloseableHttpClient",
52-
"org.apache.http.impl.client.InternalHttpClient");
53-
}
54-
5538
@Override
5639
public String[] helperClassNames() {
5740
return new String[] {

dd-java-agent/instrumentation/play-2.4/play-2.4.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ testSets {
77
latestDepTest
88
}
99

10+
muzzle {
11+
pass {
12+
group = 'com.typesafe.play'
13+
module = 'play_2.11'
14+
versions = '[2.4.0,2.7.0-M1)'
15+
}
16+
pass {
17+
group = 'com.typesafe.play'
18+
module = 'play_2.12'
19+
versions = '[2.4.0,2.7.0-M1)'
20+
}
21+
}
22+
1023
dependencies {
1124
compileOnly group: 'com.typesafe.play', name: 'play_2.11', version: '2.4.0'
1225

dd-java-agent/instrumentation/play-2.4/src/main/java/datadog/trace/instrumentation/play/PlayInstrumentation.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package datadog.trace.instrumentation.play;
22

33
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
4-
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClassWithMethod;
5-
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
64
import static io.opentracing.log.Fields.ERROR_OBJECT;
75
import static net.bytebuddy.matcher.ElementMatchers.named;
86
import static net.bytebuddy.matcher.ElementMatchers.returns;
@@ -50,18 +48,6 @@ public ElementMatcher<TypeDescription> typeMatcher() {
5048
return safeHasSuperType(named("play.api.mvc.Action"));
5149
}
5250

53-
@Override
54-
public ElementMatcher<ClassLoader> classLoaderMatcher() {
55-
return classLoaderHasClasses(
56-
"akka.japi.JavaPartialFunction",
57-
"play.api.mvc.Action",
58-
"play.api.mvc.Result",
59-
"scala.Option",
60-
"scala.Tuple2",
61-
"scala.concurrent.Future")
62-
.and(classLoaderHasClassWithMethod("play.api.mvc.Request", "tags"));
63-
}
64-
6551
@Override
6652
public String[] helperClassNames() {
6753
return new String[] {

0 commit comments

Comments
 (0)