-
Notifications
You must be signed in to change notification settings - Fork 870
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
feat: instruments finagle's netty-based stack #10141
Conversation
Looking into netty test failures before considering this ready for review. |
Netty errors addressed -- was my bad. Ready for review. |
...a/io/opentelemetry/javaagent/instrumentation/finagle/H2StreamChannelInitInstrumentation.java
Outdated
Show resolved
Hide resolved
...c/main/java/io/opentelemetry/instrumentation/netty/v4_1/internal/ProtocolSpecificEvents.java
Outdated
Show resolved
Hide resolved
...javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/finagle/ServerH2Test.java
Outdated
Show resolved
Hide resolved
...javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/finagle/ServerH2Test.java
Outdated
Show resolved
Hide resolved
...java/io/opentelemetry/javaagent/instrumentation/finagle/ChannelTransportInstrumentation.java
Outdated
Show resolved
Hide resolved
...java/io/opentelemetry/javaagent/instrumentation/finagle/ChannelTransportInstrumentation.java
Outdated
Show resolved
Hide resolved
...telemetry/javaagent/instrumentation/finagle/GenStreamingServerDispatcherInstrumentation.java
Outdated
Show resolved
Hide resolved
...http/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finagle/Helpers.java
Outdated
Show resolved
Hide resolved
...http/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/finagle/Helpers.java
Outdated
Show resolved
Hide resolved
22c6b7e
to
c166bd8
Compare
@laurit I made changes according to your suggestions. At this point, to my eye the finagle side looks good, lean, and hopefully more intelligible. There's still the open netty questions. When you get a chance, can you provide some direction on what you might like to see wrt those? Specifically:
|
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.
.../java/io/opentelemetry/javaagent/instrumentation/v23_11/ChannelTransportInstrumentation.java
Outdated
Show resolved
Hide resolved
...va/io/opentelemetry/javaagent/instrumentation/v23_11/H2StreamChannelInitInstrumentation.java
Outdated
Show resolved
Hide resolved
...va/io/opentelemetry/javaagent/instrumentation/v23_11/H2StreamChannelInitInstrumentation.java
Outdated
Show resolved
Hide resolved
...gent/src/test/java/io/opentelemetry/javaagent/instrumentation/finagle/v23_11/ClientTest.java
Outdated
Show resolved
Hide resolved
...c/main/java/io/opentelemetry/instrumentation/netty/v4_1/internal/ProtocolSpecificEvents.java
Outdated
Show resolved
Hide resolved
7e80879
to
03d7e8a
Compare
Review feedback applied, doc updated, and rebased. Just need an answer to #10141 (comment) and possibly recommendations on how to proceed. |
89b4258
to
b509930
Compare
...ntelemetry/javaagent/instrumentation/v23_11/GenStreamingServerDispatcherInstrumentation.java
Outdated
Show resolved
Hide resolved
...23.11/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/v23_11/Helpers.java
Outdated
Show resolved
Hide resolved
.../finagle-http-23.11/javaagent/src/main/java/com/twitter/finagle/ChannelTransportHelpers.java
Outdated
Show resolved
Hide resolved
ffb230b
to
cc02f2a
Compare
Thank you for the time and attention 🙏. I've rebased and checked back on all the docs and notes I've left -- happy with where this landed. I'll get over to semantic-conventions with the question about HTTP |
...t/java/io/opentelemetry/javaagent/instrumentation/finagle/v23_11/FinagleClientExtension.java
Outdated
Show resolved
Hide resolved
...nt/src/test/java/io/opentelemetry/javaagent/instrumentation/finagle/v23_11/ServerH2Test.java
Outdated
Show resolved
Hide resolved
5f780da
to
161da8a
Compare
161da8a
to
f4c3eb8
Compare
.../finagle-http-23.11/javaagent/src/main/java/io/netty/channel/ChannelInitializerDelegate.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
Instruments the twitter finagle http (netty-based) stack for otel tracing, building on the existing netty-4 instrumentation. This includes the necessary bits in
finagle-netty4
,finagle-http2
, andfinagle-base-http
modules.finagle-http
is the aggregate module and so this segments along those lines.Covered explicitly:
http/1.1
tracinghttp/2
tracing (limited -- see doc in code)101
(Switching Protocols) handlingCovered implicitly (by other instrumentations, e.g.), and therefore not explicitly instrumented:
Future
s (doc) are covered by the existing Java Executor instrumentations, as everything bound for a Future via all the typical twitter/finagle means end up in appropriately-wrappedCallable
s,Runnable
s, etc.Not covered:
thrift
A word on netty HTTP 101 support
I'm no HTTP ref spec expert, but based on the documentation for Protocol upgrade mechanism provided by MDN I pieced together the handling of the response code as presented by a netty-based server and experienced by a netty-based client to not end the span when 101 is seen as the existing netty instrumentation would normally do.
Why: simple reason is because status code
101
-- unlike the others, afaict -- represents a response continuation (preamble?) rather than a termination, and the existing netty instrumentation treats all status codes as terminations. IOW, the existing netty instrumentation unsuccessfully handles these101
s, which finagle emits (afaict, correctly), and afterwards -- upon seeing the final response -- tries to set attributes on already-ended Spans, resulting in test failures.So given the situation, there seemed to me to be two options: a) try to rewrite things to handle this condition a bit more fancily (i.e. statefully), or b) simply emit this as an event. I chose the latter, simply because in the course of creating and consuming
101
s, it strikes me as more a preamble -- and this can't be stressed enough -- without any client acknowledgement, or reciprocation with, the server. And while it's indeed bytes sent back from a server to a client, it's more "cumulative metadata" than trace-worthy and so warranted capturing as something -- just not a full span.Very much curious about any thoughts regarding this, as option (a) to rewrite things seemed far less straightforward.