-
Notifications
You must be signed in to change notification settings - Fork 848
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
Use OkHttp for AWS resource detectors #3991
Conversation
assertThat(result).isEmpty(); | ||
} | ||
|
||
@Test | ||
void requestBody() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deleted the code path taking a request body as that was only used by the moved-out xray sampler code
Codecov Report
@@ Coverage Diff @@
## main #3991 +/- ##
============================================
+ Coverage 89.71% 89.76% +0.05%
- Complexity 4272 4274 +2
============================================
Files 513 513
Lines 12941 12941
Branches 1248 1248
============================================
+ Hits 11610 11617 +7
+ Misses 927 924 -3
+ Partials 404 400 -4
Continue to review full report at Codecov.
|
import okhttp3.ResponseBody; | ||
|
||
/** A simple HTTP client based on OkHttp. Not meant for high throughput. */ | ||
final class SimpleHttpClient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Total NIT: as it's bound with OkHttp for good and bad I'd name it: "SimpleOkHttpClient" to note that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might end up swapping OkHttp back to HTTPUrlConnection or something else later, next time won't have to change class name references everywhere by using a more generic name here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
With OTLP exporters having a default dependency on OkHttp now, the vast majority of users will have OkHttp available on the classpath. There isn't a great reason to stick to HttpUrlConnection anymore - notably this will prevent resource detection requests from being traced during agent startup due to open-telemetry/opentelemetry-java-instrumentation#4642