Skip to content

Commit

Permalink
Simplify Apache HttpAsyncClient instrumentation (open-telemetry#1894)
Browse files Browse the repository at this point in the history
* Simplify Apache HttpAsyncClient instrumentation

* Bump baseline version to 4.1

* Remove all the Intellij auto-formatting of README
  • Loading branch information
trask authored Dec 14, 2020
1 parent c741eaa commit 8bcd5f1
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 106 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Because the automatic instrumentation runs in a different classpath than the ins
| Library/Framework | Versions |
|---------------------------------------------------------------------------------------------------------------------------------------|--------------------------------|
| [Akka HTTP](https://doc.akka.io/docs/akka-http/current/index.html) | 10.0+ |
| [Apache HttpAsyncClient](https://hc.apache.org/index.html) | 4.0+ |
| [Apache HttpAsyncClient](https://hc.apache.org/index.html) | 4.1+ |
| [Apache HttpClient](https://hc.apache.org/index.html) | 2.0+ |
| [Armeria](https://armeria.dev) | 0.99.8+ |
| [AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client) | 1.9+ (not including 2.x yet) |
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apply from: "$rootDir/gradle/instrumentation.gradle"

muzzle {
pass {
group = "org.apache.httpcomponents"
module = "httpasyncclient"
// 4.0 and 4.0.1 don't copy over the traceparent (etc) http headers on redirect
versions = "[4.1,)"
// TODO implement a muzzle check so that 4.0.x (at least 4.0 and 4.0.1) do not get applied
// and then bring back assertInverse
}
}

dependencies {
library group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
@AutoService(InstrumentationModule.class)
public class ApacheHttpAsyncClientInstrumentationModule extends InstrumentationModule {
public ApacheHttpAsyncClientInstrumentationModule() {
super("apache-httpasyncclient", "apache-httpasyncclient-4.0");
super("apache-httpasyncclient", "apache-httpasyncclient-4.1");
}

@Override
public List<TypeInstrumentation> typeInstrumentations() {
return asList(
new ApacheHttpAsyncClientInstrumentation(), new ApacheHttpClientRedirectInstrumentation());
return asList(new ApacheHttpAsyncClientInstrumentation());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
implementation project(':instrumentation:elasticsearch:elasticsearch-rest-common:javaagent')

testImplementation project(':instrumentation:apache-httpclient:apache-httpclient-4.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.1:javaagent')

testImplementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
implementation project(':instrumentation:elasticsearch:elasticsearch-rest-common:javaagent')

testImplementation project(':instrumentation:apache-httpclient:apache-httpclient-4.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.1:javaagent')
//TODO: review the following claim, we are not using embedded ES anymore
// Netty is used, but it adds complexity to the tests since we're using embedded ES.
//testImplementation project(':instrumentation:netty:netty-4.1:javaagent')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {

// Ensure no cross interference
testImplementation project(':instrumentation:elasticsearch:elasticsearch-rest-5.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.1:javaagent')
testImplementation project(':instrumentation:netty:netty-4.1:javaagent')

testImplementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {

implementation project(':instrumentation:elasticsearch:elasticsearch-transport-common:javaagent')

testImplementation project(':instrumentation:apache-httpasyncclient-4.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.1:javaagent')
testImplementation project(':instrumentation:netty:netty-4.1:javaagent')
testImplementation project(':instrumentation:spring:spring-data-1.8:javaagent')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {

// Ensure no cross interference
testImplementation project(':instrumentation:elasticsearch:elasticsearch-rest-5.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.0:javaagent')
testImplementation project(':instrumentation:apache-httpasyncclient-4.1:javaagent')
testImplementation project(':instrumentation:netty:netty-4.1:javaagent')

testLibrary group: 'org.elasticsearch.plugin', name: 'transport-netty4-client', version: '6.0.0'
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ include ':smoke-tests'
include ':instrumentation:akka-actor-2.5:javaagent'
include ':instrumentation:akka-http-10.0:javaagent'
include ':instrumentation:apache-camel-2.20:javaagent'
include ':instrumentation:apache-httpasyncclient-4.0:javaagent'
include ':instrumentation:apache-httpasyncclient-4.1:javaagent'
include ':instrumentation:apache-httpclient:apache-httpclient-2.0:javaagent'
include ':instrumentation:apache-httpclient:apache-httpclient-4.0:javaagent'
include ':instrumentation:armeria-1.0:javaagent'
Expand Down

0 comments on commit 8bcd5f1

Please sign in to comment.