-
Notifications
You must be signed in to change notification settings - Fork 873
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
Implement HTTP resend spec for Reactor Netty (excl CONNECT spans) #8111
Implement HTTP resend spec for Reactor Netty (excl CONNECT spans) #8111
Conversation
if (HttpClientResend.get(instrumentationContexts.getParentContext()) == 0) { | ||
// TODO: emit connection error span | ||
|
||
// FIXME: this branch requires lots of changes around the NettyConnectionInstrumenter | ||
// currently it also creates that connection error span (when the connection telemetry is | ||
// turned off), but without HTTP semantics - it does not have access to any HTTP information | ||
// after all | ||
// it should be possible to completely disable it, and just start and end the span here | ||
// this requires lots of refactoring and pretty uninteresting changes in the netty code, so | ||
// I'll do that in a separate PR - for better readability | ||
} |
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.
Here's where the connection span will be added -- similar to the ConnectionErrorSpanInterceptor
in the OkHttp instrumentation, it's only emitted on error and when there were no HTTP requests made.
02a4d2c
to
51014a1
Compare
dd82a2e
to
d1ff9c6
Compare
@open-telemetry/java-instrumentation-approvers please review this PR 🙏 |
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.
Looks good to me. A few small nits, otherwise looking good. Not having the error span in there makes the state a little weird, but I definitely prefer this incremental work. 👍🏻
...ntelemetry/javaagent/instrumentation/reactornetty/v1_0/HttpResponseReceiverInstrumenter.java
Outdated
Show resolved
Hide resolved
...ntelemetry/javaagent/instrumentation/reactornetty/v1_0/HttpResponseReceiverInstrumenter.java
Outdated
Show resolved
Hide resolved
...ntelemetry/javaagent/instrumentation/reactornetty/v1_0/HttpResponseReceiverInstrumenter.java
Outdated
Show resolved
Hide resolved
...ntelemetry/javaagent/instrumentation/reactornetty/v1_0/HttpResponseReceiverInstrumenter.java
Outdated
Show resolved
Hide resolved
...va/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/InstrumentationContexts.java
Outdated
Show resolved
Hide resolved
...va/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/InstrumentationContexts.java
Show resolved
Hide resolved
...va/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/InstrumentationContexts.java
Show resolved
Hide resolved
@@ -78,6 +78,12 @@ public final void waitAndAssertSortedTraces( | |||
waitAndAssertTraces(traceComparator, Arrays.asList(assertions), true); | |||
} | |||
|
|||
public final void waitAndAssertSortedTraces( |
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.
😎
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.
nice
equalTo(SemanticAttributes.USER_AGENT_ORIGINAL, USER_AGENT), | ||
equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200), | ||
equalTo(SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH, 0), |
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.
nice
// TODO: remove this test altogether? this scenario is (was) only implemented in reactor-netty, | ||
// all other HTTP clients worked in a different way | ||
// optionsBuilder.enableTestCallbackWithImplicitParent(); |
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.
👍
public String getUrlFull(HttpClientRequest request) { | ||
return request.resourceUrl(); |
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.
so much better 😅
54e6780
to
70be753
Compare
Part of #5722
Similar to #7652, it implements the resend spec in Reactor Netty. This PR does not include the connection error span implementation, since that requires some changes in the Netty instrumentation as well. It does prepare the code for the connection error changes though -- I'll just add them in a separate PR (based on this one) to make things easier to read.