-
Notifications
You must be signed in to change notification settings - Fork 1k
migrate more http clients to indy-ready #13897
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
Conversation
…nstrumentation into indy-migration-2
…nstrumentation into indy-migration-2
…nstrumentation into indy-migration-2
| @SuppressWarnings("unused") | ||
| public static class JettyHttpClient12SendAdvice { | ||
|
|
||
| public static class AdviceLocals { |
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.
[for reviewer] when leaving it as "locals storage" only, we keep the AdviceLocals class name, we could also use the AdviceScope like in other places for consistency.
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 prefer to keep it as AdviceLocals in this case.
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 agree with you on keeping the naming AdviceLocals here when it's just a way to carry the previously advice-local variables, what I meant was more: should we make this an AdviceScope, including moving parts of the logic from advice code ?
| public final Context context; | ||
| public final Scope scope; | ||
|
|
||
| public AdviceLocals(Context context, Scope scope) { |
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.
[for reviewer] same here we could migrate this to AdviceScope for better consistency with other changes.
.../opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9/AsyncHttpClientSingletons.java
Outdated
Show resolved
Hide resolved
.../opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9/AsyncHttpClientSingletons.java
Outdated
Show resolved
Hide resolved
.../opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientSingletons.java
Outdated
Show resolved
Hide resolved
...entelemetry/javaagent/instrumentation/googlehttpclient/GoogleHttpRequestInstrumentation.java
Outdated
Show resolved
Hide resolved
...entelemetry/javaagent/instrumentation/googlehttpclient/GoogleHttpRequestInstrumentation.java
Outdated
Show resolved
Hide resolved
...ava/io/opentelemetry/javaagent/instrumentation/javahttpclient/HttpClientInstrumentation.java
Outdated
Show resolved
Hide resolved
...ava/io/opentelemetry/javaagent/instrumentation/javahttpclient/HttpClientInstrumentation.java
Outdated
Show resolved
Hide resolved
...ava/io/opentelemetry/javaagent/instrumentation/javahttpclient/HttpClientInstrumentation.java
Outdated
Show resolved
Hide resolved
| @SuppressWarnings("unused") | ||
| public static class JettyHttpClient12SendAdvice { | ||
|
|
||
| public static class AdviceLocals { |
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 prefer to keep it as AdviceLocals in this case.
...lemetry/javaagent/instrumentation/jetty/httpclient/v9_2/JettyHttpClient9Instrumentation.java
Outdated
Show resolved
Hide resolved
| public boolean end(@Nullable HttpResponse<?> response, @Nullable Throwable throwable) { | ||
| // non-null call depth only used for async to prevent recursion | ||
| if (callDepth != null) { | ||
| if (callDepth.decrementAndGet() > 0) { | ||
| // async end nested call | ||
| return false; | ||
| } | ||
|
|
||
| scope.close(); | ||
| if (throwable != null) { | ||
| // async end with exception: ending span and no wrapping needed | ||
| instrumenter().end(context, request, response, throwable); | ||
| return false; | ||
| } | ||
|
|
||
| // async end without exception: | ||
| return true; | ||
| } | ||
|
|
||
| // synchronous end | ||
| scope.close(); | ||
| instrumenter().end(context, httpRequest, httpResponse, throwable); | ||
| instrumenter().end(context, request, response, throwable); | ||
| return false; | ||
| } |
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.
making a single end method requires to handle both the synchronous and asynchronous cases here, we use the fact that callDepth is null when doing synchronous calls and not when doing asynchronous calls.
...entelemetry/javaagent/instrumentation/googlehttpclient/GoogleHttpRequestInstrumentation.java
Outdated
Show resolved
Hide resolved
...telemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientInstrumentation.java
Outdated
Show resolved
Hide resolved
...io/opentelemetry/javaagent/instrumentation/asynchttpclient/v1_9/ResponseInstrumentation.java
Outdated
Show resolved
Hide resolved
...nt/instrumentation/jetty/httpclient/v12_0/JettyClient12ResponseListenersInstrumentation.java
Show resolved
Hide resolved
...nt/instrumentation/jetty/httpclient/v12_0/JettyClient12ResponseListenersInstrumentation.java
Show resolved
Hide resolved
...nt/instrumentation/jetty/httpclient/v12_0/JettyClient12ResponseListenersInstrumentation.java
Show resolved
Hide resolved
Co-authored-by: Lauri Tulmin <[email protected]>
...nt/instrumentation/jetty/httpclient/v12_0/JettyClient12ResponseListenersInstrumentation.java
Outdated
Show resolved
Hide resolved
...metry/javaagent/instrumentation/jetty/httpclient/v12_0/JettyHttpClient12Instrumentation.java
Outdated
Show resolved
Hide resolved
| @Advice.Local("otelScope") Scope scope) { | ||
| if (scope == null) { | ||
| @Advice.Enter @Nullable AdviceLocals locals) { | ||
|
|
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.
...metry/javaagent/instrumentation/jetty/httpclient/v12_0/JettyHttpClient12Instrumentation.java
Outdated
Show resolved
Hide resolved
...lemetry/javaagent/instrumentation/jetty/httpclient/v9_2/JettyHttpClient9Instrumentation.java
Outdated
Show resolved
Hide resolved
...lemetry/javaagent/instrumentation/jetty/httpclient/v9_2/JettyHttpClient9Instrumentation.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Lauri Tulmin <[email protected]>
…nstrumentation into indy-migration-2
...ava/io/opentelemetry/javaagent/instrumentation/javahttpclient/HttpClientInstrumentation.java
Outdated
Show resolved
Hide resolved
…nt/src/main/java/io/opentelemetry/javaagent/instrumentation/jetty/httpclient/v12_0/JettyClient12ResponseListenersInstrumentation.java Co-authored-by: Lauri Tulmin <[email protected]>
…nt/src/main/java/io/opentelemetry/javaagent/instrumentation/jetty/httpclient/v12_0/JettyHttpClient12Instrumentation.java Co-authored-by: Lauri Tulmin <[email protected]>
…nt/src/main/java/io/opentelemetry/javaagent/instrumentation/jetty/httpclient/v12_0/JettyHttpClient12Instrumentation.java Co-authored-by: Lauri Tulmin <[email protected]>
…nstrumentation into indy-migration-2
Migrate the following http clients instrumentations to be indy-ready:
async-http-clientgoogle-http-clientjava-http-clientjetty-httpclientpart of #13031