Skip to content
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

Ratpack/Netty connect errors not being emitted correctly #3949

Closed
necrolyte2 opened this issue Aug 25, 2021 · 8 comments
Closed

Ratpack/Netty connect errors not being emitted correctly #3949

necrolyte2 opened this issue Aug 25, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@necrolyte2
Copy link

Describe the bug
Netty http connections that have connect errors are being reported as a generic connect span tagged with an error vs being reported as a normal http span with details about the http connection and tagged with an error(screenshots attached in code linked below)

Steps to reproduce
https://github.com/necrolyte2/ratpack-kotlin-otel/releases/tag/6.0.0

What did you expect to see?
Netty http spans that have an error related to the connection should emit a regular http span with an error and maybe a message about why it failed.

What did you see instead?
Only a connect span with an error attached

What version are you using?
1.5.0

Environment
Compiler: AdoptOpenJDK 11.0.6

Additional context
Add any other context about the problem here.

@necrolyte2 necrolyte2 added the bug Something isn't working label Aug 25, 2021
@necrolyte2
Copy link
Author

I did finally find that you can add OTEL_INSTRUMENTATION_NETTY_ALWAYS_CREATE_CONNECT_SPAN=true to get connect errors with better information, but it still seems that http spans should be emitted with the error vs creating a completely different span name.

@iNikem
Copy link
Contributor

iNikem commented Sep 13, 2021

I did finally find that you can add OTEL_INSTRUMENTATION_NETTY_ALWAYS_CREATE_CONNECT_SPAN=true to get connect errors with better information, but it still seems that http spans should be emitted with the error vs creating a completely different span name.

If I remember correctly, we create a separate generic span because in case of connection errors we don't have enough information to create a proper http span with all required semantic attributes.

@trask
Copy link
Member

trask commented Jun 26, 2022

hi @necrolyte2, I think this may be resolved by #4787 which introduced real ratpack http client instrumentation instead of relying on the underlying netty instrumentation which has some limitations like this, can you give this a try with a recent javaagent version and let us know how it goes?

@necrolyte2
Copy link
Author

I'm going to be on vacation for few weeks, but will see if somebody on my team can do it otherwise when I get back I'll try to replicate/validate

@necrolyte2
Copy link
Author

It seems there is plenty of information available on the error now so 👍

One interesting thing though is that if I use the zipkin exporter you do not get the same information as the Jaeger or OTLP exporters. Not sure if that is a limitation of zipkin or if we need a bug reported for that.

Zipkin

Screen Shot 2022-07-18 at 2 15 07 PM

Jaeger

Screen Shot 2022-07-18 at 2 26 25 PM
Screen Shot 2022-07-18 at 2 26 01 PM

@mateuszrzeszutek
Copy link
Member

That is a limitation of Zipkin. Zipkin spans cannot contain event attributes (exceptions are span events in opentelemetry, with e.g. stacktrace attached as an attribute), links or resource information.

@necrolyte2
Copy link
Author

Is the expectation that separate CONNECT and RESOLVE spans are emitted vs adding that information into the actual HTTP span?

Probably fine either way at this point, but wondering what other's thoughts are

@mateuszrzeszutek
Copy link
Member

We thought that separate spans make slightly more sense in this case because the connection, DNS resolution, SSL handshake are not events, but processes -- they take time, are not instantaneous; and they themselves might contain event information (exceptions).
(There are also netty-specific problems, where a CONNECT span appears before the HTTP span and thus you can't add any info to the HTTP span, but you won't experience it unless you're using raw netty)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants