Replies: 1 comment
-
|
You could use reflection. I'd guess that you can't cast the current span to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I raised an issue at open-telemetry/semantic-conventions#3237 about the (currently .NET specific) convention for traces related to HTTP connection setup.
In the meantime, curious to see if it could be implemented using the Java agent, I made an attempt to instrument the classes in the JDK responsible for DNS, socket and TLS related operations.
In practice, I instrumented:
java.net.InetAddress::getAllByNamejava.net.Socket::connectjavax.net.ssl.SSLSocket::startHandshakeI've managed to get something working as a proof of concept, but I ran into the issue that these classes are called in more situations than only HTTP requests.
So I thought of checking what the current span is before producing a new span: i.e. do it only when the current one is
kind=CLIENTandhttp.request.method=XXX.But the issue is that I couldn't find a reliable way to determine if the current span is one for an client HTTP request.
As the only
ReadableSpanimplementation isio.opentelemetry.sdk.trace.SdkTrace, which is not a public class.So what are the options? Apart from hacking the output of the
toString()method 😅Beta Was this translation helpful? Give feedback.
All reactions